Langfuse evaluation is the process of testing and scoring a language model application inside Langfuse, an open-source platform for LLM observability and evaluation. It turns the question “is our model getting better or worse?” into something a team can answer with recorded traces, versioned prompts, test datasets and repeatable scores. The central question for any team is simple: how do you know a change to a prompt or a model actually helped? Langfuse evaluation answers it by running the same inputs through each version and comparing the results side by side.
Most teams start with Langfuse because debugging without a record is painful: a user reports a wrong answer, and nobody can see the exact prompt, the retrieved documents or the model version. Langfuse records each step as a trace, so the failure can be replayed and fixed.
Key takeaways
- Langfuse evaluation combines tracing, prompt management, datasets and scoring in one open-source platform.
- Traces record prompts, model calls, tool calls, latency, tokens and cost for every request.
- Offline evaluation runs a dataset through a prompt or model version before it ships.
- Online evaluation scores production traces as they arrive, so regressions surface quickly.
- Scores can come from code, from human reviewers, or from an LLM acting as a judge.
What is Langfuse?
Langfuse is an open-source LLM engineering platform that helps teams build and operate applications powered by language models. It is not a model provider, and it does not replace the application. It sits alongside it, recording what it does, and covers tracing, prompt management, scoring, datasets and evaluation runs in one place.
Language model behaviour is hard to reason about from code alone: the same prompt can produce different answers on different days, and small wording changes can shift quality unpredictably. Langfuse records real behaviour — what was asked, what the model returned, how long it took, and what it cost. It can run cloud-hosted or self-hosted, which matters when traces contain customer data.
How Langfuse evaluation works
Langfuse evaluation starts with a dataset: test inputs, usually with expected outputs or reference answers. Some datasets are written by hand by domain experts; others are built from production traces, where real requests are sampled into repeatable test cases. Either way, the dataset is the fixed yardstick for every version.
An evaluation run executes the application, or a single prompt, against each item, recording every execution as a trace with one or more scores — deterministic checks, model-based grades, or human review. Results are then compared across runs, showing whether a new prompt improved accuracy or a cheaper model held up. For a broader view, see our guide to building an LLM evaluation framework.
Tracing: the foundation of every evaluation
Tracing is the feature most teams meet first, and it underpins everything else. A trace records one user request or agent session as observations: spans for units of work such as a retrieval step or tool call, and generations for individual model calls, with tokens, latency and cost.
That timeline makes debugging practical. When an answer is wrong, the trace shows whether retrieval returned the wrong documents, the model ignored good context, or a tool call failed silently. Consistent metadata matters too: tagging traces with the feature, session, prompt version and model makes filtering and comparison possible. Our guide to LLM observability explains why this visibility matters.
Prompt management and versioning
Prompts are code, and Langfuse treats them that way. Prompts are stored as versioned objects with a name, template text, variable placeholders and model configuration. Each logged generation links to the prompt version that produced it, so any result can be traced back to the exact wording and settings used.
This matters because prompt changes are the most frequent change in most LLM applications, and the hardest to track. Editing prompts directly in code leaves no easy way to compare old and new wording, or to roll back when a change makes things worse. Versioned prompts solve that: the old version still exists, the new one is tested against the same dataset, and the comparison decides which ships. A playground also lets prompts be tried against sample inputs first.
Scores, datasets and evaluation runs
Scores are the output of evaluation, and Langfuse supports several kinds. Code-based scores check objective properties such as exact matches, format rules or required content. Model-based scores use a language model as a judge, grading outputs against criteria like relevance, correctness or faithfulness. Human scores capture judgements such as tone that neither code nor a model can make reliably.
Each kind has a weakness. Code-based scores are precise but narrow; model-based scores are flexible but can be biased or inconsistent and need validation; human scores are trusted but slow and costly. A sensible evaluation uses more than one kind and treats scores as evidence, not truth. Our guide to LLM judge reliability covers the limits of model-based grading. Datasets deserve the same care: good ones mix common requests with edge cases and past failures, and Langfuse snapshots them per run so results stay reproducible.
Offline evaluation before release
Offline evaluation runs a dataset through a new prompt or model version before it reaches users — the main gate for changes. If the new version scores worse, the change does not ship until the cause is understood. Best for: testing prompt changes, comparing model versions and catching regressions before release. Its strength is control; its weakness is coverage, since no dataset contains every request users will make.
Online evaluation in production
Online evaluation scores traces as they arrive in production, using automated scorers or sampled human review. It catches failures a fixed dataset cannot: new kinds of request, shifts in the underlying data, and slow drift over time. Best for: monitoring live quality, spotting drift and finding new test cases from real usage. Scoring every trace can be expensive, so most teams score a sample.
Langfuse evaluation compared with other approaches
| Approach | What it does well | Main limitation | Best for |
|---|---|---|---|
| Langfuse evaluation | Tracing, prompts, datasets and scores in one platform | Needs instrumentation and dataset upkeep | Teams that want one open-source home for LLM quality |
| Ad-hoc manual testing | Fast and flexible for a few examples | Not repeatable or comparable | Early prototypes and quick checks |
| Standalone benchmark suites | Standardised comparisons across models | May not match real product tasks | Choosing a base model |
| Human review only | Trusted judgement on hard cases | Slow, costly and hard to scale | High-stakes or specialist outputs |
| Spreadsheet score tracking | Simple to start | Breaks down as versions multiply | Very small teams with one model |
The comparison shows why Langfuse fits teams past the prototype stage. Manual testing and spreadsheets do not scale with the versions, prompts and models a real product accumulates, and benchmark suites compare models in general rather than a team’s own application on its own tasks.

Setting up a Langfuse evaluation workflow
Start by instrumenting the application so traces flow into Langfuse, using the Python or TypeScript software development kits, or the OpenTelemetry integration. The goal is coverage: every model call, retrieval step and tool call should appear in a trace with useful metadata.
Next, build a first dataset of twenty to fifty well-chosen cases: the main things the application must do, cases it has failed on before, and the most common user requests. Add expected outputs where they exist, and note ambiguous cases so their scores are read with care.
Then define a small set of scores — one code-based check plus one model-based score — and run the current version to establish a baseline before testing any change. For a fuller treatment of this pipeline, see our guide to building an LLM evaluation pipeline. Finally, add online scoring for a sample of production traces, review the lowest-scoring ones weekly, and add genuine failures to the dataset.
Common Langfuse evaluation mistakes
The most common mistake is evaluating without a baseline. A correctness score of 0.82 means little on its own: it is good or bad only against the previous version. Run the current version first, record its scores, and judge every change against that baseline.
The second mistake is trusting a single score. A judge can be fooled, a code-based check can be gamed, and a human reviewer can be inconsistent. Use several scores that measure different things, and look at failing cases rather than only the average.
The third mistake is letting the dataset go stale. Products, users and retrieved data all change, and a dataset that is never updated stops representing real usage. Review it whenever the product changes, and add cases from production failures as a routine.
The fourth mistake is scoring prompts in isolation. A prompt can look excellent on its own and still fail in production because retrieval returned poor context or a tool errored. Evaluate the whole application end to end, and use traces to find which step caused each failure.
Langfuse evaluation checklist
- Traces cover every model call, retrieval step and tool call, with feature, session, prompt version and model tagged.
- A dataset exists with twenty to fifty cases covering common requests, edge cases and past failures.
- A baseline score for the current version is recorded before any change is tested.
- At least one code-based score and one model-based or human score are defined.
- Evaluation runs are compared side by side before a prompt or model change ships.
- Production traces are sampled and scored, and genuine failures are added to the dataset.
- Datasets are snapshotted per run so results stay reproducible.
- Low-scoring traces are reviewed weekly, not only when something breaks.
- Prompt versions are linked to the traces that used them, so results can be traced back.
- The team reviews the dataset whenever the product or its data changes.
Frequently asked questions
What is Langfuse evaluation?
Langfuse evaluation is the use of Langfuse to test and score a language model application. It combines tracing, versioned prompts, datasets and scores so teams can compare prompt and model versions before release and monitor quality in production.
Is Langfuse open source?
Yes. Langfuse is an open-source LLM engineering platform, and it can be self-hosted in a team’s own infrastructure or used as a cloud-hosted service. Self-hosting keeps trace data inside the team’s own systems.
What is the difference between offline and online evaluation in Langfuse?
Offline evaluation runs a fixed dataset through a version before it ships, under controlled conditions. Online evaluation scores production traces as they arrive, catching failures and drift that a fixed dataset cannot predict.
Does Langfuse support LLM-as-a-judge scoring?
Yes. Scores can come from code-based checks, from human reviewers, or from a language model grading outputs against written criteria. Model-based scores are flexible but need validation, since judges can be biased or inconsistent.
How do traces help with evaluation?
Traces record the prompts, model calls, retrieval steps, tool calls, latency, tokens and cost for each request. They show where a failure happened, and failing production traces can be added to a dataset so the same failure is tested on every future version.
When is Langfuse evaluation the right choice?
It suits teams that have a language model application in or near production and need repeatable evidence for prompt and model changes. Smaller prototypes may be fine with manual testing, but that approach stops scaling once versions multiply.







