How do you build an AI coding benchmark for your company?
AutoRouter10 min read
Key facts
- Databricks built its internal coding benchmark from recent merged pull requests, graded agents on held-out tests without an LLM judge, and sealed git history after agents found fixes in it (Databricks, July 8, 2026).
- In that benchmark Sonnet 5 was about 1.7× cheaper per token than Opus 4.8 but cost $2.09 a task against $1.94, passing 81% of tasks against 87%.
- AutoRouter offers engineering teams a free benchmark built from real work they have shipped, which the team keeps and can rerun when a new model comes out.
To build an AI coding benchmark for your company, make tasks from recent merged pull requests: start each one from the code as it was before the change, rewrite the description so it states the goal without the solution, hold back the tests, and grade every model and agent on those tests and on what each task cost. AutoRouter, the Mac app for all your coding agents, builds this for engineering teams for free: a benchmark of your own work that you can rerun whenever a new model comes out. If you would rather build it yourself, the steps below follow what Databricks, Cursor and Uber published about their own. AutoRouter wrote this post.
Why not just use SWE-bench scores?
Public scores answer how a model does on someone else's code, while your choice depends on how it does on yours. Cursor's post on CursorBench (March 11, 2026) names three problems with public benchmarks: alignment (most still test bug fixes), grading (tasks assume one correct answer when real requests allow many) and contamination (tasks come from public repositories that end up in training data). It notes that OpenAI stopped reporting SWE-bench Verified after finding that frontier models could reproduce the fixes from memory and that nearly 60% of the unsolved problems had flawed tests. Databricks gave the same reasons for building its own (July 8, 2026): public tasks leak into training data, and the results didn't represent a codebase that spans more than ten languages.
Your merged pull requests avoid both problems. Databricks put it this way: "Any team with a backlog of merged PRs is sitting on a benchmark already that no model has trained on, graded by the tests your team wrote."
How do you make benchmark tasks from merged pull requests?
Make a task from a merged pull request by keeping its intent and its tests and throwing away its answer. Databricks filtered candidate pull requests before writing a single task:
| Filter | What it keeps out |
|---|---|
| Recent | Old frameworks and patterns your team no longer uses |
| Written by a person | Bot commits, service accounts and fully generated changes |
| Has good tests | Changes you can't grade automatically |
| Self-contained | Changes spread across too many modules to reproduce |
| Representative | A task mix that skips parts of your stack |
For each pull request that passed, Databricks rewrote the description to state the problem, the goal and any constraints, and removed the explanation of the fix, since it "makes the task too easy". The test files were set aside so the agent has to reproduce the rest of the change on its own. Scripts and AI drafted candidate tasks, but a person checked every one, and some tests were rewritten so a different correct implementation could pass. Keep a task only if its held-out tests fail on the code before the change and pass on the merged change; otherwise they don't measure the task. Most of the work is in that review.
How should each task be graded?
Grade each task with the tests that came with its pull request, run after the agent says it is done. Databricks checkpointed the agent's code at that point, applied the held-out tests and counted a pass only when they passed. It didn't use an LLM judge, because a judge "rewards sounding right over being right". Cursor grades differently, with agentic graders, because many of its requests admit more than one valid approach, and it pairs its offline suite with experiments on live traffic that catch output a grader likes and a developer doesn't.
Use tests where the change has them and a written rubric where it doesn't, such as a refactor or a migration whose result a reviewer judges. Write the rubric before you see any model's output, so it grades the task and not the answers you got.
How do you stop an agent from finding the answer?
Cut each task off from the repository's history, because the answer is already in it. Databricks found a few scores that "looked too good to be true": every task came from a merged commit, so an agent with a shell could walk forward through git history to find the fix. It sealed the history, cutting the working copy off from the repository for the length of each run. Copying the files with git archive, as in the steps below, does the same thing.
Keep the task set fresh as well. Cursor refreshes CursorBench every few months to follow how its developers work, and newer pull requests are less likely to be in any model's training data.
What should you measure besides the pass rate?
Measure what each task cost from start to finish, beside whether it passed, because the price per token doesn't predict it. In Databricks' benchmark (July 8, 2026), Sonnet 5 was about 1.7× cheaper per token than Opus 4.8, but it cost $2.09 a task against Opus 4.8's $1.94 and passed 81% of tasks against 87%, because it worked longer and used 1.9× the tokens. GLM 5.2, an open-weight model, tied Opus 4.8 on quality at $1.28 a task.
| Model (Databricks, July 2026) | Cost per task | Tasks passed | Note |
|---|---|---|---|
| Sonnet 5 | $2.09 | 81% | About 1.7× cheaper per token than Opus 4.8; used 1.9× the tokens |
| Opus 4.8 | $1.94 | 87% | Top capability tier |
| GLM 5.2 | $1.28 | Tied with Opus 4.8 | Open-weight; top capability tier |
Record the agent too, since it changes the cost as much as the model does. Running the same model at the same thinking effort through different agents changed Databricks' cost per task by more than 2× at the same quality, mostly because one sent about 3× less context with each request. Uber picks models the same way (August 27, 2026): it builds a benchmark from each agent's real work, runs every model behind one harness, and moves to whichever is best for cost per completed task, quality and reliability. Databricks' Pareto frontier, the best quality at each price, held models from OpenAI, Anthropic and open-weight makers, so only a mix of models reached it. Which model for which task covers how to split work between them.
What are the steps to build one?
These steps build a small benchmark on a Mac or a CI runner with the GitHub CLI, git and the coding agents you already use. Commands are examples; change the dates, paths and test commands to fit your repository.
1. List recent merged pull requests and the files each one changed:
gh pr list --state merged --search "merged:>=2026-09-01" --limit 200 \
--json number,title,mergeCommit,files > prs.json
2. Pick the tasks. Keep pull requests that change both source and test files, read each one, and drop any you couldn't grade. Write each kept task's goal into tasks/<number>/prompt.md, without the fix.
3. Export the code as it was before the change, with no git history, and save the test changes separately:
SHA=<merge commit>
mkdir -p tasks/123/repo
git archive "$SHA^" | tar -x -C tasks/123/repo
git diff "$SHA^" "$SHA" -- ':(glob)**/*test*' > tasks/123/tests.patch
4. Run each agent and model from inside a fresh copy of tasks/123/repo, recording its output:
claude -p "$(cat ../prompt.md)" --model opus --output-format json \
--permission-mode acceptEdits > ../claude-opus.json
codex exec --json -s workspace-write "$(cat ../prompt.md)" > ../codex.jsonl
5. Apply the held-out tests and run them, then log pass or fail with the tokens and cost from the agent's output:
patch -p1 < ../tests.patch
<your test command> && echo pass || echo fail
Claude Code's JSON output includes the run's cost and token counts; Codex's JSON events include token usage, which you can price with the provider's list prices. Run each pair more than once on a few tasks before you trust a small difference, since agents don't give the same result twice. How do you test a model router change before it ships? shows the same idea applied to routing.
How do Databricks, Cursor, Uber and Ramp build theirs?
Each of these teams builds tasks from its own shipped work, and they differ mostly in how they grade it.
| Team | Where tasks come from | How it grades | What it is used for |
|---|---|---|---|
| Databricks | Recent merged pull requests in a multi-million-line codebase | Held-out tests, no LLM judge | Choosing models and agents, cost per task |
| Cursor | Real agent requests traced to committed code with Cursor Blame | Agentic graders, plus online evals on live traffic | Comparing model quality in Cursor |
| Uber | Thousands of real pull requests (Uber SWE Benchmark); real pull requests with known bugs for code review | Precision, recall and F1 for reviews; cost per completed task | Picking the Pareto-best model per workload |
| Ramp | Financial software engineering work | Scores published as a leaderboard | Evaluating coding agents on its kind of work |
Uber reports that, holding one model fixed from February to July 2026, its cost per 1,000 model requests fell almost 34% from its peak. That came from several changes at once, benchmark-driven model selection among them, so no single step accounts for all of it.
What does AutoRouter's free benchmark include?
AutoRouter builds a free benchmark for engineering teams from real work they have shipped, then tunes a custom router, skills and team-wide system prompts against it to save them money. It follows the method above, with a diagnostic before it and tuning after it.
- A diagnostic first. It reads the team's agent traces to show where agents burn tokens repeating mistakes, what the best engineers do that others could learn, and where the team pays for more intelligence than it needs or would gain from a stronger model.
- Tasks from merged pull requests and agent traces. Each starts from the repository as it was before the change, down to a synthetic version of a database or service the task depends on, and is graded against the team's tests or a rubric written with the team.
- Rerun on demand. The team can rerun it every time a new model comes out or its AI setup changes, and it can run in the team's cloud.
- Targets agreed first. Savings, speed and performance targets are agreed before tuning. If they are met, AutoRouter proposes a paid pilot with a fee agreed up front; if a target is missed, the team owes nothing. It keeps the benchmark and the diagnostic either way.
Which repositories, pull requests and transcripts may be read, and where the benchmark runs, are agreed at kickoff. Questions go to benchmark@autorouter.com. For the router itself, what is an LLM router? explains how routing works, and how AutoRouter picks a model covers its rules.
Questions
How many tasks does a company coding benchmark need?
No public standard sets a number. Uber's internal benchmark uses thousands of pull requests, while Databricks started with tasks it could review by hand and keeps adding harder ones. A smaller set you trust beats a larger one with tasks that leak or can't be graded; run each model more than once before reading much into a small gap.
Can a startup build its own coding benchmark?
Yes, if it has merged pull requests with tests. The method doesn't depend on size: tasks from your own history, held-out tests and cost per task. A small team can also ask AutoRouter for its free benchmark and keep the benchmark whether or not a pilot follows.
Should an LLM grade the results?
Use tests where they exist. Databricks didn't use an LLM judge because it found one rewards sounding right over being right, while Cursor uses agentic graders for requests with many valid answers. If you use a model to grade, give it a rubric written in advance and check a sample of its grades by hand.
How often should you rerun a coding benchmark?
Rerun it whenever a new model comes out or you change agents, settings or prompts. Uber notes that the best choice shifts every few weeks, and Cursor refreshes its task set every few months so it keeps matching the work.
Does AutoRouter publish benchmarks of its own routing?
No. AutoRouter doesn't publish benchmarks of its own routing yet, and automatic evaluations on real coding tasks are coming soon. The benchmark it offers teams measures the team's own work, and the team keeps it.
Sources
- Benchmarking coding agents on Databricks' multi-million line codebase, Databricks, July 8, 2026
- How we compare model quality in Cursor, Cursor, March 11, 2026
- Running a Software Factory Efficiently at Uber Scale, Uber, August 27, 2026
- Ramp SWE-Bench v2, Ramp Labs, read November 23, 2026