Quickstart

This guide walks you through installing the Fyntune SDK, wrapping your first LLM call, running an eval, and reading the results. Estimated time: 15 minutes.

Prerequisites

  • Python 3.9+ or Node.js 18+
  • A Fyntune account (sign up free)
  • Your Fyntune API key from the dashboard

Step 1: Install the SDK

# Python
pip install fyntune-sdk

# TypeScript / Node.js
npm install @fyntune/sdk

Step 2: Set your API key

Export your API key as an environment variable. Never hard-code it in source files.

export FYNTUNE_API_KEY="ck_your_api_key_here"

Step 3: Wrap your LLM call

Use the @track decorator on any function that calls an LLM. Fyntune captures the inputs and outputs automatically without changing your function's behavior.

from fyntune import track
import openai

@track(feature="summarization", version="v1")
def summarize(text: str) -> str:
    response = openai.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": "You are a helpful summarization assistant."},
            {"role": "user", "content": text}
        ]
    )
    return response.choices[0].message.content

Step 4: Make a call

Call your function normally. Fyntune captures the data and runs the eval asynchronously.

result = summarize("The quarterly earnings report showed a 12% increase in revenue...")
print(result)
# Your LLM output appears immediately. Eval runs in background.

Step 5: Read the results

Go to your Fyntune dashboard. You'll see an eval run in progress — it typically completes within 90 seconds. The result shows per-criterion scores for your feature.

Example eval output in the dashboard:

Feature: summarization  Version: v1  Run: #0001

  Criterion               Score    Threshold  Status
  ─────────────────────── ──────── ───────── ──────
  Semantic Similarity     0.874    0.820     PASS
  Factuality              0.921    0.900     PASS
  Guardrail Compliance    0.997    0.980     PASS
  Response Coherence      0.882    0.850     PASS
  Tone Consistency        0.908    0.880     PASS

  Overall: PASS  ✓  Eval run #0001 complete (67s)

Next steps