Evaluate
Agent evals that score inside the trace
Evaluate agents and LLM apps on datasets from production traces, run the suite from your code, and compare candidate against a baseline.
Why evaluation
You can't unit test a language model
Run the same input twice and you can get two different outputs, both arguably correct. “It seems better” ends up being the release decision.
An eval replaces that with a fixed set of cases, scored by code, another model, or a person, run before you ship and against live traffic after. The score lands on the span it scored, next to the tool call and the retry that explain it. The eval is part of the trace, not a separate tool beside it.
How it works
The same scorer, before release and in production
-
Dataset
Inputs you control, and the output you expect
-
Task
The thing under test, a single call or a whole agent
-
Scorer
Code or an LLM judge, run over every case
-
Experiment
One run over the dataset, compared against the baseline
-
Live
The same scorer, pointed at real traffic
What you get
Every part of the eval workflow
-
Datasets
Build them in code or in the UI, or save a failing span straight from a trace. Every dataset keeps the experiment history.
-
Evaluators
Built-ins like Equals and MaxDuration, agent scorers like ToolCorrectness, or write your own. Each returns a pass, a label or a number.
-
LLM judges
Score against a rubric, with the reasoning attached. When judges disagree, the run goes to a human.
-
Assertions on spans
Assert the tool actually fired, not just that the answer looked right. HasMatchingSpan queries the spans inside the run.
-
Live monitoring
Score every agent as traffic arrives. Run the cheap checks on everything, the expensive judge on one percent.
-
Annotation queues
Queue runs for a human verdict. Their answers become calibration data or new test cases.
Use cases
What people use Evaluate for
- Evaluate an agent
Turn a production failure into a test case
Open the trace that went wrong, save it as a dataset case, and it becomes a regression test every future change has to pass.
- Read the experiments guide
Prove a change made things better
Run the candidate against the baseline on the same dataset and read the difference per case, not as one blended average.
- Review experiments
Show a regulator how the AI behaves
Every run is a stored artifact with inputs, outputs, scores, and a timestamp. The eval becomes the release gate and the evidence.
Customer stories
Teams who ship on evidence
-
How Evergreen.ai runs its offline judges against live traffic
“The same evaluators we use with our actual eval dataset are now being applied against a real-time dataset”
Bryan Godwin CTO
-
How Qualio turned plain-language criteria into release gates
98.6% Overall score on the compliance intelligence eval, across 24 tests
-
How STCC made every clinical answer reviewable
0% Hallucinations across 329 clinician-validated triage scenarios
FAQ
What is an eval?
A test for behavior with no single correct answer. Instead of asserting one exact output, you collect a dataset of cases, define scorers that judge each result, and track how the scores move when you change the prompt, model, or retrieval. In Logfire, eval results are stored as queryable telemetry next to the traces they scored, so you can query how a change scored with SQL.
What's the difference between offline and online evaluation?
Offline evaluation runs against a curated dataset while you develop, so it catches regressions before you deploy. Online evaluation scores real production traffic after it runs, so you catch regressions on inputs your dataset didn't contain yet. Most teams use both: offline to gate a release, online to watch what happens once it's live.
Do I need an eval suite to start?
No. Instrument your agent and Logfire records the runs you'll later turn into cases. Online evaluation scores real traffic without a curated dataset, so you get signal from day one. When you want to gate a release on numbers, save failing runs into a dataset and evaluate against it.
How is Logfire different from Braintrust for evals?
Both run evals, but Logfire keeps eval results as queryable telemetry next to the traces they scored, so a score links to the run that produced it. If you're already on Braintrust, the Braintrust SDK's Eval runs work against Logfire by changing two environment variables, for the standard Eval flow in Python and TypeScript. Braintrust-hosted datasets, prompts, and the model proxy are not covered. See Logfire vs Braintrust for the full comparison.
How do production failures become test cases?
A bad response in production is a trace in Logfire. Add it to a dataset with a click, and it becomes a case the next version has to pass. Over time the dataset records the actual ways your application has failed, so your test suite tracks real production behavior instead of cases you wrote up front.
Get started with Logfire for free
Sign up today and see your first trace in under 2 minutes
01 — Install
$ uv add logfire
Resolved 7 packages in 128ms
Installed 7 packages in 89ms
+ logfire 02 — Instrument
import logfire
logfire.configure()
logfire.info('Hello {name}', name='world') Free up to 10m records per month No credit card needed