TOOL WIKI · EVALUATION & TESTING
Braintrust
Connects experiments, datasets, and evaluation workflows for AI applications.
Jump to a section 10 sections
EXAMPLE USE CASE
Track a candidate comparison as a managed experiment
A developer needs repeatable cases and explicit grading before changing a prompt, model or agent implementation.
- Input
- Two synthetic cases, a candidate adapter and an exact_status scorer.
- Expected output
- A managed experiment containing outputs and per-case scores.
- Success check: A managed experiment records the two synthetic cases and exact_status scores.
- Try a failure: An always-packed candidate must score zero on the unknown order.
Example scope: Actual managed reporting call; the toy candidate/scorer themselves use no model.
Official reference · Braintrust
Keep fixtures and expected outcomes separate from candidate inputs.
executeTo 02 · Candidate systemRecord code, prompts, model settings, and tool schemas for this run.
observationsTo 03 · BraintrustComparing candidate behavior and investigating production failures. Define dataset governance, grader criteria, and retention for recorded runs.
resultsTo 04 · Failure examplesInspect the failing task and trace rather than relying only on an aggregate score.
reviewTo 05 · Release gateBlock a release on critical permission failures and unacceptable task regression.
Result or stopping pointConvert confirmed production failures into reviewed, versioned fixtures.
Comparing candidate behavior and investigating production failures. Define dataset governance, grader criteria, and retention for recorded runs.
When to consider it
- Comparing candidate behavior and investigating production failures.
A design decision to make
- Define dataset governance, grader criteria, and retention for recorded runs.
Prerequisites and setup
- A Braintrust account/project and key. Running writes a new experiment containing the displayed synthetic fixtures.
python3 -m venv .venv
source .venv/bin/activate
pip install braintrust
export BRAINTRUST_API_KEY="YOUR_KEY"Try a small integration
experiment.py
from braintrust import Eval
def candidate(input):
return {"A104":"packed"}.get(input,"not_found")
def exact_status(input, output, expected):
return 1.0 if output == expected else 0.0
Eval("ASG demo evaluation", data=lambda:[
{"input":"A104","expected":"packed"},
{"input":"A999","expected":"not_found"},
], task=candidate, scores=[exact_status])Run and check the result
python experiment.py- A managed experiment records the two synthetic cases and exact_status scores.
- This example calls Braintrust to store results, but the candidate/scorer make no model calls.
Common failures
- A passing score on one fixture is not evidence of general reliability; include missing-data, permission and adversarial cases.
- A judge timeout or parser error must be reported separately from a low-quality answer.
Production decisions
- Version the dataset, prompt, model, tool schema and scorer together; keep a held-out set separate from tuning examples.
- Gate releases on critical failures as well as aggregate quality, latency and cost. Review false positives and grader disagreement.
- Redact or approve evaluation data before sending it to managed reporting; configure project access and retention.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.