For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trace evaluations

client.trace_evaluations — run a judge against a trace, poll, retrieve results, estimate cost.

A trace evaluation runs a single judge against a single trace.

Estimate cost

Always estimate before running large batches:

estimate = client.trace_evaluations.estimate_cost(
 trace_ids=[t.id for t in traces],
 judge_id=judge.id,
)
# CostEstimateResponse fields: trace_count, input_tokens, output_tokens, model

Create

trace_eval = client.trace_evaluations.create(
 trace_id=trace.id,
 judge_id=judge.id,
)
# trace_eval.id and trace_eval.status (TraceEvaluationStatus enum: pending, in_progress, success, failure)

Wait for completion

trace_eval = client.trace_evaluations.wait_for_completion(
 trace_eval.id,
 interval_seconds=3,
 timeout_seconds=300, # None for indefinite
)

Get results

Get by ID

List with filters

Async / concurrent

See also

Last updated

Was this helpful?