To reduce the cost of AI agent evals, first measure how much goes to running the agent, its tools and its judges. In our 12-task synthetic incident-triage suite, requiring the agent to investigate every dependency produced about 18 model calls per task. The agent cost $4.69 of the $5.62 run. The most expensive judge cost $0.84.
That was a deliberately long investigation with fixture tools and three model judges. Our shorter baseline spent roughly half its budget on execution. Neither result establishes where your suite spends its money.
Start by measuring the split. Then distinguish changes that retain the evaluation workload, such as prompt caching, from changes that reduce coverage, such as running fewer tasks. This guide demonstrates both in Laminar, with measured costs and explicit limits on what each result tells you.
Measured LLM cost for 12 tasks with one trial each. Tools returned deterministic fixtures, so the split excludes live tool and sandbox costs. All three judges count toward this experimental run's total.
Why are AI agent evals expensive?
An agent evaluation can rerun an entire investigation for every task, trial and prompt change. Each investigation may include several model calls, paid tools and a sandbox. Judges add another layer of work.
Our agent loop resends the conversation history on each step: instructions, tool definitions and previous tool results. Later steps therefore pay to process earlier context again. A full-transcript judge reads that accumulated history once. Agents that compact history or use different context strategies can have a different cost profile.
We measured an on-call triage agent using Claude Sonnet 5.5. Its tools return dependencies, deploys, configuration changes, metrics and logs. It finishes by submitting a root-cause service and category for an incident with a known answer.
A code evaluator checks that answer. Two Opus 5.5 judges score the final diagnosis and full transcript separately; a Haiku 5.5 judge scores the same full transcript for comparison.
Grouping the shorter baseline's 36 trials by agent call count shows a crossover:
| Agent LLM calls | Trials | Agent input tokens | Judge input tokens | Agent cost | Full-transcript judge cost |
|---|---|---|---|---|---|
| 2 | 6 | 6,468 | 4,274 | $0.019 | $0.026 |
| 3 | 13 | 14,149 | 7,757 | $0.036 | $0.039 |
| 4 | 16 | 27,528 | 11,038 | $0.065 | $0.052 |
| 5 | 1 | 43,051 | 12,225 | $0.100 | $0.057 |
These are per-trial averages, with Opus as the transcript judge. Between the two-call and five-call groups, agent input increased 6.7 times and judge input 2.9 times. The five-call group contains only one trial; this is an observed breakdown, not a scaling benchmark.
The longer run added a policy requiring the agent to rule out every service in the dependency chain, one tool call at a time. Execution then accounted for 83% of model spend.
Measurements were taken on November 23, 2026, using a local Laminar stack. Costs are Laminar-computed amounts using a price table that matches Anthropic's list prices. We measured model spend, not latency improvements.
Measure agent and judge spend in Laminar
Each trial in a Laminar evaluation has an evaluation root span, an executor child and one child per evaluator, named after its dictionary key. Instrumented LLM calls nest beneath the component that made them.
For this trace structure, the second segment of an LLM span's path identifies the component: evaluation.executor.anthropic.chat belongs to the agent; evaluation.judge_trajectory.anthropic.chat belongs to that judge.
Run this in the SQL editor, replacing the evaluation id:
SELECT
splitByChar('.', path)[2] AS side,
count() AS llm_calls,
sum(input_tokens) AS input_tokens,
round(sum(total_cost), 2) AS cost_usd
FROM spans
WHERE span_type = 'LLM'
AND start_time > now() - INTERVAL 7 DAY
AND trace_id IN (
SELECT trace_id
FROM evaluation_trials
WHERE evaluation_id = '<your evaluation id>'
)
GROUP BY side
ORDER BY cost_usd DESC
The time filter covers the last seven days; adjust it for older runs. The subquery selects trial traces from one evaluation. On the long-horizon run, the query returned:
| Side | LLM calls | Input tokens | Cost |
|---|---|---|---|
| executor, Sonnet 5.5 | 214 | 2,260,604 | $4.69 |
| judge_trajectory, Opus 5.5 | 12 | 184,264 | $0.84 |
| judge_report, Opus 5.5 | 12 | 5,433 | $0.07 |
| judge_trajectory_cheap, Haiku 5.5 | 12 | 184,264 | $0.02 |
The total matches the run's $5.62 cost. Paid APIs and sandboxes require separate accounting because this query sums only LLM spans. If CI speed is your constraint, record wall-clock duration alongside cost rather than assuming the cheapest configuration is the fastest.
Cache repeated agent context before removing coverage
Prompt caching reduces the price of repeatedly processing eligible context while retaining that context in the request. The agent still generates its responses live.
With Anthropic's API, this top-level parameter enables automatic caching:
resp = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1500,
system=SYSTEM,
tools=TOOLS,
messages=messages,
cache_control={"type": "ephemeral"},
)
This example was tested with Anthropic's Python SDK 2.12.0. We reran the long-horizon configuration with automatic caching enabled:
| Run | Agent calls | Agent cost | Input read from cache | Run total | Root cause correct |
|---|---|---|---|---|---|
| No caching | 214 | $4.69 | 0% | $5.62 | 11/12 |
| Automatic caching | 215 | $0.78 | 93% | $1.70 | 12/12 |
Observed agent spend fell 83%, and total run spend fell 70%. A separate run using an explicit breakpoint on the newest message cost $0.88 for execution, with 91% of input read from cache.
These comparisons used one trial per incident. The 12/12 result does not establish a quality improvement: the uncached run missed one incident, while the explicit-breakpoint run missed a different incident. Inspect investigation scores as well as final-answer correctness.
Anthropic's pricing page lists Sonnet 5.5 cache reads at 0.05 times its base input rate and five-minute cache writes at 1.25 times that rate. One cache read pays back the write premium under those rates. Other models can have different multipliers.
To make caching useful:
- Keep reusable prefixes stable. Changing timestamps in the system prompt or reordering tool definitions can reduce reuse. Inspect cache_read_input_tokens on the agent's spans rather than assuming the setting worked.
- Check eligibility and expiry. Minimum cacheable length depends on the model. Short prefixes are silently uncached. Five-minute entries refresh on reads, but long pauses can still matter. Zero cache reads can indicate a short prefix, expiry or configuration trouble, as well as changing content.
- Preserve the workload. Keep the same tasks, model and evaluators for the comparison. Record call counts and scores so a shorter investigation does not masquerade as a caching saving.
This optimization also applies outside evals. Measure the production agent's cache behavior separately before projecting these savings onto its workload.
Iterate on subsets with stable task ids
A targeted subset can make a prompt-change loop affordable, but it cannot establish that omitted tasks still pass. Use it for iteration and retain a full-suite gate or scheduled regression run.
Laminar matches comparison rows by task id, not position. Dataset task ids travel through take, select and shuffle. Without an explicit or dataset-provided id, the default comes from the row's position before those transformations.
from lmnr import LaminarDataset, evaluate
full = LaminarDataset("incident-triage")
evaluate(
data=full.select([0, 2, 5]),
executor=triage,
evaluators=evaluators,
group_name="incident-triage",
trials=3,
)
Our three-incident subset with three trials each cost $0.91, compared with $3.48 for all twelve incidents using the same evaluators. Both comparisons exclude the experimental Haiku judge. This subset experiment used the shorter baseline configuration; its saving was not measured on top of caching.
The subset retained task ids inc-checkout-5xx, inc-gateway-401 and inc-notifications-lag. The comparison view matches rows by task id, so it lines those rows up with the full baseline and shows per-task score deltas.
Include tasks targeted by the change and previously passing cases that could regress. Keep examples of important tool paths or failure modes even when a random sample would omit them. shuffle(seed) gives reproducible ordering, but reproducibility alone does not make a sample representative.
If you rebuild source data in a different order, assign explicit task ids. Positional defaults cannot preserve identity across arbitrary source reordering.
Allocate trials using observed variation
evaluate(trials=N) runs each task N times. Each trial gets its own trace, and the task row shows the average across trials. Additional trials increase execution and scoring work, although their individual costs can differ.
In the baseline, nine of twelve tasks had identical scores on all four evaluators across three trials. Three tasks varied on the Opus judges. That observation suggests where additional trials might be useful; three matching scores do not prove a task is stable.
This query finds variation in the transcript judge's score:
SELECT
task_id,
count() AS trials,
min(JSONExtractFloat(scores, 'judge_trajectory')) AS worst,
max(JSONExtractFloat(scores, 'judge_trajectory')) AS best,
round(avg(total_cost), 3) AS cost_per_trial
FROM evaluation_trials
WHERE evaluation_id = '<your evaluation id>'
GROUP BY task_id
HAVING worst != best
Repeat the check for other scores that affect your decision. All baseline trials passed the exact root-cause check, so looking only at that metric would have hidden variation in investigation scores.
One possible allocation is one trial for the nine apparently stable tasks and three for the other three: 18 trials instead of 36. We did not run that allocation or measure its savings. Because trials applies to a whole evaluation call, use separate subset runs for groups receiving different trial counts.
Base reductions on recent evidence, revisit them after prompt or model changes, and retain periodic full multi-trial runs. The two different incidents missed by separate long-horizon runs show why a single pass is weak evidence of reliability.
Replay tools only when the fixture fits the change
Our tools already returned fixtures, so these experiments provide no measurement of tool-side savings. Live sandboxes, browsers and paid APIs can add costs that the LLM split query misses.
The worked example in turning production traces into an eval dataset uses a ReplayTools fixture to serve recorded tool results and log calls. It returns an explicit error for a call absent from the recording.
Replay avoids repeating those live requests and holds their recorded outputs fixed. It is useful for prompt, model and agent-logic changes that mostly follow recorded paths. If a change introduces new calls or changes state across calls, use a suitable stateful stub or retain live integration tests. Otherwise, you may score compatibility with the recording rather than the behavior you intended to test.
For debugging one trace, Laminar's debugger caching can also serve recorded LLM responses for an unchanged prefix and run later calls live. Keep that distinction explicit: provider prompt caching retains live generation, while recorded-response replay does not retest the replayed decisions.
Reduce judge cost without changing the question accidentally
After automatic caching, our Opus transcript judge cost $0.83, slightly more than the agent's $0.78. Rerun the split query after each optimization; the next useful target can change.
Match judge input to the score
On the uncached long-horizon run, the final-diagnosis judge cost $0.07 and the full-transcript judge $0.84, roughly twelve times as much. They assessed different evidence. A correct diagnosis alone cannot establish that the investigation was sound.
Arize's "8 ways to reduce the cost of evals" reports reducing roughly 155,000-token web-agent traces to about 6,500 tokens on AgentRewardBench, with equal or better judge accuracy. That supports testing selective trimming, not assuming the same result for incident investigations. Check cases where omitted tool results could change the grade.
Define deterministic gates explicitly
A code check can reject an invalid result without another model call. Our root-cause check compares service and category. If an incorrect root cause should force a composite quality score to zero, a gate can implement that rule:
def investigation_quality(output, target):
if not root_cause(output, target):
return 0
return llm_judge(output["transcript"], target)
llm_judge represents your judge call. This changes the score's definition: failed root causes receive no independent investigation assessment. Keep separate diagnostic scoring if reasoning on failed cases matters, and do not compare the gated score with the old standalone score as though they were identical.
Only two of our 72 trials failed the root-cause check, so this gate would have skipped few calls. We did not measure a gated run. Arize separately reports schema checks resolving 38% of BFCL tool calls before judging; the opportunity depends on your workload.
Calibrate cheaper judges against human labels
Haiku's transcript judge cost about one forty-second as much as Opus on the uncached long-horizon run. Across 72 trials, however, Haiku assigned 1.0 to all ten transcripts Opus scored 0.75. Both judges scored the two incorrect root causes low.
Baseline exact agreement was 29 of 36, with every disagreement giving Haiku the higher score. Opus is a comparison judge here, not human ground truth. Before substituting Haiku, label representative cases, including partial successes, and examine disagreement direction rather than agreement rate alone.
Batch asynchronous work
OpenAI and Anthropic document 50% batch discounts on model token prices. Both allow up to 24 hours; Anthropic says most batches finish within an hour. Anthropic also says its caching and batch discounts stack.
Braintrust's "Run evals 50% cheaper with workflow evals" describes batching both tasks and scorers. The discount can apply to generation as well as judging, but it does not halve tool bills. Dependent agent steps must still wait for preceding results, so batching can lengthen the feedback loop. Use it where delayed results are acceptable, such as asynchronous scoring or nightly workloads. We did not benchmark batching here.
FAQ
Why does Laminar's input_tokens include cached tokens?
input_tokens counts all input, including cache reads and writes. cache_read_input_tokens and cache_creation_input_tokens expose those portions separately, while total_cost prices them at their respective rates. For an aggregate cache-read share, divide summed cache-read tokens by summed input tokens over the agent's LLM spans. Avoid averaging per-call percentages, which gives a tiny call the same weight as a large one. The SQL editor reference documents the columns.
Should I test a cheaper agent model to save eval money?
Use the model whose behavior you need to assess. Substituting a cheaper model does not tell you whether the production model regressed. It can still help smoke-test dataset loading and evaluator execution before a full run. If the cheaper model is itself a deployment candidate, evaluating it is appropriate; treat that as a model comparison rather than a lower-cost proxy for the original agent.
How should I track evaluation spend over time?
evaluation_trials contains per-trial total_cost; evaluations holds run names, groups and metadata. Sum costs by evaluation_id and chart them in Laminar dashboards. Record task count, trial count and evaluator configuration alongside the total. Otherwise, a smaller suite can look like a more efficient agent. Keep separately billed tools in your accounting and compare scores on matching task ids.
How small can an iteration subset be?
There is no universal minimum. A small targeted subset can expose a specific regression, but passing it cannot certify the omitted workload. Arize's sampling example at a 35% failure rate gives margins of about ±9 percentage points for 100 examples and ±4 for 500. Those figures do not establish precision for our twelve synthetic incidents. Choose subsets for diagnostic coverage and use broader runs for release decisions. The datasets documentation explains take, select and shuffle.