TOOL WIKI · EVALUATION & TESTING

Braintrust

Connects experiments, datasets, and evaluation workflows for AI applications.

Download example files Code + setup + checks in a ZIP
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

WHAT IT ISEvaluation platform
WHERE IT FITSEvaluation & testing
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
executeobservationsresultsreviewimproveRepresentative datasetNormal + boundary casesCandidate systemPinned configurationBraintrustEvaluation platformFailure examplesConcrete observationsRelease gateQuality + cost limitsProduction feedbackNew regression cases
  1. Keep fixtures and expected outcomes separate from candidate inputs.

  2. Record code, prompts, model settings, and tool schemas for this run.

  3. Comparing candidate behavior and investigating production failures. Define dataset governance, grader criteria, and retention for recorded runs.

  4. Inspect the failing task and trace rather than relying only on an aggregate score.

  5. Block a release on critical permission failures and unacceptable task regression.

    Result or stopping point
  6. Convert confirmed production failures into reviewed, versioned fixtures.

Braintrust

Comparing candidate behavior and investigating production failures. Define dataset governance, grader criteria, and retention for recorded runs.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

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.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install braintrust
export BRAINTRUST_API_KEY="YOUR_KEY"

Try a small integration

experiment.py

Python · 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

Shell
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

AI agent evaluation: frameworks, tools and an exampleAn evaluation gate for agent releases

Explore the same layer

promptfoogarakRagasDeepEval

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.