Skip to content

Benchmarks

You tightened a prompt, switched a model, or added a tool. Did your changes make the workflow better or worse, and does it now use more tokens? abt bench answers that.

It runs the same cases twice, with your changes (your checkout, uncommitted edits included) and without them (the baseline: where you forked from the default branch), and compares what each node produced. Nothing is posted anywhere.

Use abt bench for workflows and abt test for single agents.

In short: write a few cases (below), run abt bench -s my_workflow, and read the first line. ✓ green means quality held, ✗ red means it got worse, ? yellow means the cases can't tell yet (add more) or some took a different path, ! yellow means tokens grew. The colour drops out in pipes and when NO_COLOR is set; the symbol stays.

1. Write down a few cases

A case is a realistic input plus what a good answer looks like. One file per benchmark, under benchmarks/:

# benchmarks/support_ticket.yaml
workflow: support_ticket

cases:
  - name: late_refund
    sources:
      ticket: "Tour cancelled by the supplier, still no refund for my 84 EUR. — Ana"
    agents:
      triage:
        output:
          route: refund
      refund:
        says:
          - mentions a refund of 84 EUR

  - name: outage
    sources:
      ticket: "Checkout returns HTTP 500 for every customer."
    agents:
      escalate:
        says:
          - describes checkout failing

Read it as: when the ticket source returns this text, the triage agent's output should have route: refund, and the refund agent should mention the 84 EUR. Use the names from your own project: support_ticket is a file in workflows/, ticket is a source node in it, and triage and refund are agents in it.

Start with a few cases and add more over time: with one run per case, abt only calls quality clearly better or clearly worse once at least 5 cases changed in the same direction (and none the other way), however many cases you have. With --runs above 1, each case's pass rate counts, so a case slipping from 5/5 to 3/5 registers, but at least 5 cases still have to change. To benchmark a single agent, wrap it in a one-step workflow (steps: [my-agent]).

2. Run it

abt bench -s support_ticket                 # your changes vs where you forked
abt bench -s support_ticket --against v1.4  # vs any git ref
abt bench -s support_ticket --no-baseline   # just score your changes
abt bench -s support_ticket -n late_refund  # just one case
abt bench -s support_ticket --runs 5        # 5 runs per case and side (default 1); averaged per case

To try a cheaper model, change model_id: and run it. No commit needed.

While it runs, each step gets a live row (in a terminal only; CI logs get just the report):

✓ compile your changes                 9s
✓ compile main @ 3b2e238               8s
⠇ run main               4/6 ━━━━━━──── 1 failed · 2 running (late_refund: triage 40s, outage: refund 1m10s) · 2m

A running case shows the node it is in once that node has run for 3 seconds, so a slow node is told apart from a stuck one. Up to two nodes are listed, oldest first.

All benchmarks run at once, one side after the other, so adding a benchmark costs little extra time. With --runs above 1, each repetition swaps which side goes first, so a slow hour at the model provider doesn't land on one side only; --runs 5 can take up to three times as long as one run. The pool holds abt --threads N runs at a time (default 4). Runs mostly wait on the model provider, so raise it for big suites; rate-limited runs are retried, and the report says how many were left out:

abt --threads 16 bench                      # before the subcommand, like every abt command

3. Read the answer

? Your changes vs main: can't tell if quality changed (0 better, 1 worse), 21% more tokens, 2 cases took a different path.
support_ticket · 10 cases × 1 run · your changes = feat/tighter-triage @ a1b2c3d + uncommitted · main = main @ 9f8e7d6 (merge-base)

                passed   tokens/case   time/case
  main           8/10    2.0k          9s
  your changes   7/10    2.4k          11s

  quality   can't tell yet (p=0.50): 7 of 10 cases passed (was 8 of 10)
  tokens    +21% for a typical case, clearly more (p<0.01; likely between +12% and +30%); refund +143% · escalate +40%
            2 cases on a different path: +95% for a typical case, can't tell yet (p=0.31)
            to show a quality change, at least 5 cases must change the same way (so far: 0 better, 1 worse)

  ⚠ different path
    late_refund   was refund  →  now escalate

  ✗ newly failing
    late_refund   triage route = 'refund' (got 'escalate')

  outputs: target/bench/20260923T101500-support_ticket/outputs
  • First line: the answer, led by a coloured symbol (✓ quality held or improved, ✗ worse or nothing ran, ! tokens grew, ? can't tell, or cases took a different path). It only says better or worse when the data clearly shows it, and same tokens only when the data rules out a big change. It names the side if no run finished there (e.g. a tool that fails to load).
  • quality: how many cases passed now and before (the mean pass rate when --runs is above 1). It reads clearly better or clearly worse when the change is too big to be luck, can't tell yet when something changed but not enough to be sure, and no change when no case moved, which with few cases doesn't mean quality is the same. With few cases most real changes stay at can't tell yet: add cases rather than lowering the bar. An extra line says how many cases would have to change to show a quality change, or that there are too few cases for that.
  • tokens: the change for a typical case (each case is compared with itself, so one huge case barely moves it and the figure can differ from the table's averages; it is not the total bill). A clear change shows its likely range and which nodes moved. It reads about the same only when the data backs it: the change is under 3%, or nothing showed and the likely range stays within ±10%. If nothing showed, an extra line says how small a change your cases can catch; smaller ones are easy to miss. When only some cases took a different path, a second line compares just those, so a change that touches a few cases isn't averaged away by the rest.
  • table: tokens and time are per case (the median over cases for time; grading and judge calls are not timed). Both count runs that failed after spending tokens; runs that hit provider errors or crashed before any model call are left out (so are runs that crash without returning a result, since their tokens aren't known). The two sides run one after the other, so treat time as a rough guide: a slow minute at the provider can show up as a difference. results.jsonl splits tokens into prompt_tokens and completion_tokens (under metrics), since the two are priced differently.
  • p: if nothing really changed, how often luck alone would produce a change at least this big. Below 0.05 we call the change clear. A high p doesn't mean nothing changed, only that this run can't show it. It is the only number the report asks you to read.
  • different path: cases that ran other nodes or called other tools (node:tool). Look at these even when quality looks the same.
  • newly failing: which check broke and how often. With --runs above 1 this reads pass rate dropped and lists every case whose pass rate fell, with pass rate rose for the ones that improved.
  • outputs: every node's output per case, side and run (outputs/<case>/<side>/run<N>/<node>.md), so you can diff the two sides.

Writing cases

A case has a name (no spaces, so abt bench -n late_refund needs no quotes), what goes in, and what the agents should do:

Key What it is Same as
prompt The message the run starts from abt dispatch -p
sources What each source returns, by source name. Every source of the workflow needs one; nothing is fetched live. --mock-sources
vars Template variables, e.g. what a trigger would set --vars
agents Checks on the workflow's agents, by agent name (below)

agents: — what the agents should do

A listed agent must have run; an empty one (escalate:) only checks that it ran, which is handy for pinning the branch. Exposures aren't checked: they send nothing during a benchmark.

Check Example Passes when
says - asks for the order number An LLM judge agrees the output says this (any wording). It sees the input too.
contains ["5–7 business days"] This exact text appears
not_contains ["**", "<@U"] This exact text doesn't appear
output {route: refund} The structured output (output_schema) has these values, the same output.route a workflow edge reads
called [access-request-handler] The tool or subagent was called
not_called [create_ticket] The tool or subagent wasn't called

Every other check from Testing works here too (matches, json_schema, python, golden, max_tokens, max_seconds); max_tokens counts only that node's own tokens, not the upstream nodes it ran (unlike abt test, which counts the whole run). max_seconds is the whole run, and golden reads the baseline from your checkout for both sides. abt test uses these same checks, written directly on a test case.

Prefer says for wording that can vary; keep contains for things that must be exact. The judge model is config.testing.judge_model_id in abt.yaml (else the profile's default model).

Keeping tools from doing real things

Stub any tool that writes (so nothing changes for real) or reads data that moves (so both sides see the same thing):

workflow: support_ticket

stub_tools:
  - push                                   # no response: "not executed, assume it worked"
  - jira_create_issue: "Created OPS-1234"  # always returns this
  - jira_search:                           # first match wins
      - when: {jql: "project = OPS"}       # these args must match (others are ignored)
        returns: "OPS-1: bookings table stale"
      - returns: "No issues found"         # fallback

cases:
  - name: late_refund
    sources:
      ticket: "Tour cancelled by the supplier, still no refund for my 84 EUR."
    agents:
      refund:

A name can be written like a tools: entry (montecarlo__updateAlert) or as the tool is bound (update_alert). called: still sees stubbed calls. If a stub name matches no tool (a typo, a renamed tool), the benchmark stops after its first run instead of letting the real tool run. Built-in agent tools (write_file, edit_file, task, …) can't be stubbed.

Mistakes are caught early

abt compile checks every benchmark file and adds it to manifest.json, so a typo'd key, an unknown agent or a missing source fails the compile (and CI), not the benchmark:

case 'late_refund' › agents › refund › say: unknown key

In CI

- uses: actions/checkout@v4
  with: { fetch-depth: 0 }   # needed to find where the PR forked
- run: abt bench -s support_ticket --fail-on-regression --fail-on-token-increase 20 --output-md bench.md

--fail-on-regression fails when quality is clearly worse. A small suite rarely shows a clear drop, so it rarely trips this gate. With several benchmarks in one run, abt allows for chance across all of them, even the ones that got better, so a harmless change rarely fails the build. This is deliberately cautious: a real drop in one benchmark can pass with a note such as b0: quality looks worse, but with 3 benchmarks in this run that could be chance, so the gate passes.

--fail-on-quality-drop POINTS is the stricter one: it fails unless your results confirm that quality dropped by less than POINTS points of pass rate. --fail-on-token-increase PCT gates on the typical-case change described above. The gates need a baseline, so they can't be combined with --no-baseline. The results have to show it, so a suite that is too small fails even when nothing changed, and the message says how small a drop it can confirm:

support_ticket: can't confirm quality dropped by less than 5 points: these results allow a drop of up to 7 points. A suite this size can only confirm drops smaller than about 10 points; add cases.

When even that is out of reach the message says 3 cases are too few to tell. Add cases. The figure is worked out as if one more case had improved and one more had got worse, so a very small suite looks a little worse than it is.

Skipping benchmarks nothing changed for

--changed-only skips a benchmark when none of the files it uses differ from the baseline, so a README edit or a change to an unrelated agent costs no tokens:

abt bench --changed-only --fail-on-regression --output-md bench.md
support_ticket: skipped (nothing it uses changed)

A skipped benchmark has no report, takes no part in the gates (they pass when every benchmark is skipped) and gets a line in --output-md. abt only treats a changed file as unrelated when it is an agent outside the workflow (its nodes and the agents they activate) or another workflow. Any other change runs the benchmark: its own file, skills, context, prompts, tools, packages, abt.yaml and the lockfiles (uv.lock, abt_packages.lock.yml). A file with several agents (a Python module) counts as long as one of them is in the workflow. Files both sides share, such as a git-ignored profiles.yaml or .env that the baseline reuses from your checkout, are the same on both sides, so editing them is not a difference between the sides. --changed-only needs a baseline, so it can't be combined with --no-baseline. Without a usable baseline (not a git checkout, or nothing changed since the baseline) every benchmark runs. Changes abt can't see, such as a model update behind the same model id or an MCP server's behaviour, don't count either; run without the flag when those matter.

How the verdicts are decided

For readers who want the method. Every verdict uses a fixed 5% threshold (not a flag). Quality is a paired sign-flip test on each case's pass rate (with one run per case, McNemar's mid-p test on the cases that changed). Tokens use a paired ratio t-test on each case's token count. Can't tell yet means that test did not reach the threshold, which is not evidence of no change: about the same and same tokens need the 95% interval of the change to sit within ±10%. Quality is pass/fail, so each case moves by a fixed step and only the number of changed cases counts, however large the drop: with 3 cases even all three failing gives p=0.125, so a suite needs at least 5 changed cases to show a quality change. Tokens can show a big, consistent change with 3 cases. The hints about case counts and noticeable token changes use 80% power. --fail-on-quality-drop tests the lower end of a 95% interval on the pass-rate change, and --fail-on-regression applies a Holm correction across benchmarks. run.json records the tests used.

Install abt and set the model credentials in the job first, as in CI/CD. --output-md leaves out inputs, outputs and judge reasons, so it's safe to post as a PR comment.

Results files

Each benchmark leaves target/bench/<stamp>-<name>/ (target/bench/latest points at the last one):

File What it holds
results.jsonl One row per case, side and run, in the shape eval tools import: id, input, output (the text of the last agent node that ran), scores (one 0/1 per check plus case_pass; null when a provider error left the run ungraded), metrics (prompt_tokens, completion_tokens, tokens, start, end, duration_s), error and metadata (case, dataset_id, side, ref, run, passed, ok, infra_error, path, tools, checks). metadata.dataset_id is the id of the case's row in the --export file. Each row's input copies the case's prompt, sources and vars, so benchmark data leaves the repo when you import rows into an external eval tool.
run.json What it takes to reproduce the run: abt version, both git shas, a hash of the cases, --runs, threads, the judge, each agent's model id, temperature and reasoning effort (an agent without its own model shows the profile's), the stubbed tools and the tests applied, gates included.
outputs/ Every node's output, per case, side and run.
summary.md The Markdown summary, without inputs or outputs.

Use the cases in other eval tools

abt bench -s support_ticket --export cases.jsonl

This writes one JSON line per case and runs nothing. Each line has id, input (prompt, sources, vars), expected (the agents: checks) and metadata, the row shape eval dataset tools import, e.g. Braintrust's bt datasets create support_ticket --file cases.jsonl.

What actually runs

During abt bench
Sources Return the case's sources
Exposures Send nothing
Approval-gated tools Denied
on_success / on_failure handlers Don't fire
stub_tools Never executed
Other tools, retrievers, transformers Run as usual

The baseline is checked out in a temporary git worktree, with your local profiles.yaml, .env, vars.yaml and installed packages. Only project files (prompts, workflows, config) come from the baseline; your benchmark file, abt and Python tool code are your current ones.

Outside a git repository there is no baseline to check out: abt bench prints not a git repository, scoring this checkout only and scores only your current files.