Databricks tested every model and harness on its own multi-million-line codebase — here's what's actually worth the money

Swap the harness under the same model and the cost can double. The open-source GLM 5.2 ties Opus 4.8 on quality — for 30 percent less per task. The test questions were adapted from Databricks' own merged PRs, so nothing shows up in a search engine.
By Databricks07-22 · 9 min read⚑ Company PR · read with that in mind
Research Breakdown · XiaoHu Explains
The 60-second version
  • Databricks ran the leading AI coding assistants through a test built on its own multi-million-line codebase — the questions were adapted from PRs its engineers had already merged, so nothing is searchable online or sitting in a model's training data
  • The most counterintuitive finding: picking a model by its per-token price gets you the wrong answer. Sonnet 5 is 1.7x cheaper per token than Opus 4.8, yet costs more to actually finish a task — $2.09 versus $1.94 — while scoring 6 points lower
  • The harness matters more than the model for cost. Same model, same thinking-effort setting — swap the harness and per-task cost can more than double. The difference comes down to how much context gets stuffed back into the model each turn: Opus on claude code burns 742k tokens per task versus just 236k on pi
  • An open-source model made the top tier: GLM 5.2 matches Opus 4.8 on quality (87% each) at $1.28 per task versus $1.94
  • More thinking effort isn't always better: pushed to the max setting, Opus 4.8 costs $3.60 per task for just 82% — worse and pricier than the high setting's $0.93 for 85%
⚑This is an internal test report Databricks published on its own blog — all the data was collected and graded by Databricks itself. Omnigent and Unity AI Gateway, mentioned throughout, are its own products, and the close teases a follow-up on its own smart routing. Read the numbers with that in mind; we won't flag it again at every turn.

This is an internal benchmark Databricks published itself, built to answer one question: in a multi-million-line codebase, which AI coding agent — meaning which model-plus-harness combination — actually delivers the best value and the smoothest experience. It went up on July 8; the five authors include CTO and Spark creator Matei Zaharia.

Who is Databricks

A data-and-AI platform company founded in 2013 by the original team behind Apache Spark — one of the most widely used open-source engines for big-data processing, running data pipelines and machine-learning workloads at companies worldwide. Databricks now serves more than 12,000 enterprise customers, closed a Series L round in February 2026 at a $134 billion valuation, and runs at $5.4 billion in annualized revenue.

$134BValuation after the February 2026 Series L round
$5.4BAnnualized revenue, up more than 65% year over year
12,000+Enterprise customers
Millions of linesSize of its own codebase, spanning more than a dozen languages

The authors carry weight. Two of the five named authors are Databricks co-founders: Matei Zaharia, Spark's creator and the company's current CTO, and Patrick Wendell, also a co-founder.

The codebase is genuinely complex. Scala, Go, Rust, Java, Python, TypeScript, Bazel, and Protobuf are all in play, and engineers merge thousands of changes a day. That's a level of complexity no public benchmark can simulate.

The motive is saving its own money. Databricks built this to make AI more cost-effective for its own engineering org — an internal check-up that it happened to publish, methodology and all, not a product review aimed at outsiders.

The method itself is simple enough: take real code its engineers wrote, turn it into test questions, run it against the leading model-and-harness combinations, and see who gets it right and for how much. Several of the conclusions run directly against how most people currently pick their tools.

Scatter plot of per-task cost versus pass rate, red dashed line marks the Pareto frontier
All results: the x-axis is cost per completed task, the y-axis is pass rate. Upper-left is the sweet spot; lower-right means expensive and mediocre. The seven points connected by the red dashed line mark the current frontier — the best result you can buy at that price. Image: Databricks

Six findings follow, with a checklist you can copy at the end.

1Key finding

Models split into three tiers — you don't need the priciest one for everything

Databricks didn't fixate on rankings, since a few points of difference wash out in real-world tasks. What's actually useful is the grouping: every model-and-harness combination falls cleanly into one of three capability tiers.

TierPass rateWho's in it
Tier 182–90%Opus 4.8, GLM 5.2, high-end GPT 5.5 configurations
Tier 271–82%Sonnet 5, Sonnet 4.6, mid-tier GPT 5.5, GPT 5.4
Tier 351–60%GPT-5.4-mini, Haiku 4.5

Routine work doesn't need the flagship. Flipping a switch or updating a config is well within reach for mid- or lower-tier models, at a fraction of the cost — but Databricks' default had always been the most expensive option.

Division of labor beats blanket upgrades. After seeing the data, Databricks is routing more work to the Haiku and GPT 5.4 Mini tier, saving the smartest models for genuine architecture exploration and deep debugging.

Models clustering into three capability tiers by pass rate
Three capability tiers: 82–90%, 71–82%, 51–60%. The labels on the right show the price spread within each tier — as much as 2.2x within Tier 1 alone. Image: Databricks

Which tasks to downgrade? The usage logs did the math

Before making any changes, Databricks pulled every AI coding session log to see what engineers were actually asking the AI to do.

Distribution of AI coding sessions by task complexity
AI coding sessions by task complexity. The four tiers, top to bottom: trivial 7.6%, low difficulty 19.3%, medium difficulty 61.1%, high difficulty 12.1%. Image: Databricks

About a quarter of the work is low-complexity, six in ten sessions are medium difficulty, and only 12.1% genuinely call for deep design exploration. Yet the default had always been the most expensive model available — the waste was sitting right there in the data.

2Key finding

Open-source models have arrived — good enough to be your daily driver

One open-source model made it into Tier 1: Zhipu AI's GLM 5.2.

Quality ties Opus 4.8. Both land at an 87% pass rate — statistically indistinguishable.

About 30% cheaper per task. GLM 5.2 runs $1.28 a task versus $1.94 for Opus 4.8.

Already headed for daily-driver status. Internal developers had already been trial-running it for everyday work, and these scores line up with what they reported — enough for Databricks to start rolling it out more broadly.

87% / 87%GLM 5.2 vs. Opus 4.8 pass rate — a statistical tie
$1.28 / $1.94Per-task cost, same two models
2.2×Largest price spread within Tier 1
3Key finding

Cheap per token doesn't mean cheap overall

Almost everyone picks a model by looking at the same number: dollars per million tokens. That number can't predict what you'll actually pay.

What matters is cost per completed task. Between that and per-token price sits one variable: how much the model actually has to read and how long it has to think to get the job done.

Sonnet 5 is the counterintuitive case. Its per-token price runs about 1.7x cheaper than Opus 4.8's, yet it costs $2.09 per task versus Opus 4.8's $1.94. The cheaper sticker price ends up with the bigger bill.

The extra cost goes toward taking the scenic route. Sonnet 5 reads more files, thinks longer, and goes back and forth more, burning through 1.9x the tokens — while scoring 6 points lower (81% versus 87%).

1.7×How much cheaper Sonnet 5's per-token price is versus Opus 4.8
$2.09 / $1.94Yet Sonnet 5 costs more per completed task
1.9×Extra tokens Sonnet 5 burns to finish the same task
81% / 87%Task pass rate for each
4Key finding

The harness swings costs more than you'd think

Same model, same thinking-effort setting — swap only the harness, and per-task cost can more than double while quality barely moves. Most people never even treat the harness as something worth choosing.

What a harness is: the software layer that turns a model's output into actual actions — deciding how much code the model sees each turn, which tools it can call, and how it retries on failure. Claude Code, Codex, and pi are all harnesses; swap in a different model underneath and any of them still runs.

Same chef, same dish, different kitchens — the plating time and cost can differ by double. The kitchen is the harness.

Cost differs by double, quality barely moves. pi came out cheaper in every single comparison, by margins ranging from 1.20x to 2.08x; five of the six pairings differed by 3 points or less on pass rate.

The difference comes down entirely to context management. The cumulative content fed back into the model per completed task: 742k tokens for Opus 4.8 on claude code, versus just 236k on pi.

Total context re-fed to the model per task, by harness
Median cumulative context re-fed to the model per completed task. Top pairing is Opus 4.8: 742k on claude code versus 236k on pi, a 3.2x gap. Bottom pairing is GPT 5.5: 1,235k on codex versus 665k on pi, a 1.9x gap. Image: Databricks
Cost and quality comparison: pi versus each vendor's native harness
Red dots are pi, hollow circles are each vendor's native harness, x-axis is cost per task. Pass rates for both are labeled on the right of each row. Image: Databricks
Model · thinking effortpi cheaper byPass rate (pi / native)
Opus 4.8 · high2.08×85% / 87%(−2)
Opus 4.8 · xhigh1.46×90% / 88%(+2)
Opus 4.8 · max1.20×82% / 89%(−7)
GPT-5.5 · medium1.54×83% / 80%(+3)
GPT-5.5 · high1.22×81% / 83%(−2)
GPT-5.5 · xhigh1.44×78% / 80%(−1)
Five of the six pairings differ by 3 points or less, which is why Databricks calls quality "unchanged" — but the max setting comes in at 82% versus 89%, a 7-point gap. Also worth noting: the "feeds it 3x less context" claim in the original post is stated per turn, while the chart shows median cumulative totals per task, and the 3.2x figure only holds for Opus — the GPT 5.5 pairing is 1.9x.

pi: a coding assistant with only four tools in its toolbox

pi belongs to the same category as Claude Code and Codex: install it on your own machine, run it in a terminal, tell it what you want in one sentence, and it goes off reading code, editing files, and running tests before reporting back.

The entire toolbox has four tools. Read a file, write a file, edit a file, run a command. Anything else loads on demand only when actually needed.

Its permanent system prompt runs under 1,000 tokens. Roughly a few hundred words.

Who built it. Armin Ronacher and Mario Zechner. Ronacher is well known in Python circles as the creator of Flask and Jinja2, two frameworks that have been in daily use for over a decade. The project is free and open-source, sits around 54,000 stars on GitHub, and plugs into any vendor's model.

Being thin is the whole reason it saves money. Every single turn, a harness has to re-stuff a bundle of material back into the model: the permanent system prompt, instructions for every tool, everything said so far, and whatever code needs reviewing this round. More tools, a longer system prompt, more retained history — all of it inflates that bundle, and you pay for the whole thing again every single turn.

Full-featured harness pi Permanent system prompt (long) Usage docs for a dozen-plus tools (search, todos, subtasks…) Everything said so far Large code context blocks Prompt · under 1,000 tokens Four tools: read / write / edit / run Keeps only what's still useful 742k 236k Tokens fed in per task, cumulative Same model, same test set
Both running Opus 4.8: cumulative content fed into the model per task, by harness. The block breakdown on the left is illustrative; the two figures at bottom right come from Databricks' actual measurements.

The information that isn't force-fed doesn't disappear — the model just calls "read file" to fetch it when it actually needs it. The whole approach only works if the model is willing to go looking, and is good enough to find what it needs.

So "the simplest harness wins" isn't Databricks tooting its own horn — the winner here is a third-party open-source project. Databricks' own product is Omnigent, which is built to let you swap models and harnesses on the fly.
5Key finding

Maxing out the thinking-effort setting: pricier and worse

Cranking a model's thinking-effort setting to the max doesn't guarantee better accuracy. It does guarantee a bigger bill.

CombinationCost per taskPass rate
Opus 4.8 · pi · high~$0.9385%
Opus 4.8 · pi · xhigh~$2.2090%
Opus 4.8 · pi · max~$3.6082%
GPT 5.5 · codex · med~$1.3379.5%
GPT 5.5 · codex · xhigh~$2.4279.5%

Effort level and score aren't a straight line. Opus 4.8 on pi scores 85% for under a dollar at the high setting, then drops to 82% at max for $3.60. The sweet spot for this pairing sits in between, at xhigh — 90%.

Sometimes the extra spend buys you nothing. GPT 5.5 on codex scores an identical 79.5% at both the medium and xhigh settings — and xhigh costs almost twice as much.

Effort-level names don't translate across models. High, xhigh, and max are each vendor's own labels — don't assume the same name means the same thing across providers.

Figures marked "~" in the table above are read off the coordinates in the original scatter chart; the source text doesn't spell out these combinations line by line.
6Key finding

Why not just use an established benchmark like SWE-Bench

Whether any of this holds up depends on how the test questions were built. A public benchmark couldn't answer the question Databricks was actually asking.

The answers leak. Both the questions and solutions are public, and given enough time they end up in training data — at which point the test stops measuring ability.

It doesn't match the real environment. Databricks' codebase spans more than a dozen languages — Scala, Go, Rust, Java, Python, Bazel, Protobuf — plus a sprawl of microservices. A generic benchmark can't reflect that kind of complexity.

So Databricks turned the code its own engineers merge every day into test questions. A PR that's already cleared review is good raw material on its own: it comes with a developer's step-by-step commit history, a human review, and tests that verify whether the change actually works.

Filter first, then adapt

FilterWhy
RecentUsing recent history keeps the questions grounded in current frameworks, conventions, and style
Human-writtenBot commits, service accounts, and AI- or auto-generated changes are all excluded
Backed by solid testsNo tests means no way to grade the answer
Focused scopeTouches only a handful of modules, not a sprawling rewrite across half the codebase
Full-stack coverageScala backends, Rust systems code, React/TypeScript frontends, protobuf/gRPC interfaces, and Bazel configs all need representation
A merged PR Change + review + tests Understand what it fixes Rewritten as a task brief: states problem and constraints Strip out "why it was fixed" Non-test files What the model must reproduce Test files Hidden, used later to grade Test question
From a merged PR to a finished test question. This diagram was drawn by this site based on the original description.

The solution gets stripped out when the prompt is rewritten. A PR description usually explains why a bug should be fixed a certain way — leaving that in is basically writing the answer into the question. What's left is only the desired outcome and the constraints.

The tests get pulled out and hidden separately. Databricks' build system can already work out which tests depend on the changed files, so that whole set becomes the grading standard.

Every single question gets a human pass. Scripts and AI are only used to generate candidates. Some original tests need rewriting — ones that only allow a single implementation get loosened, ones that are too lax get tightened — and all of that rewriting is done by hand, not by AI.

Before-and-after comparison of a rewritten test
One test, before and after rewriting: the original required an exact string match, so the model failed just by phrasing things differently. That's not a sound way to verify a task where the output isn't meant to be fixed, so it was rewritten to check for correct behavior instead. Image: Databricks

No AI graders, because that rewards sounding right

Grading works like this: the moment the model declares itself done, the code gets snapshotted, the hidden tests get restored, and the suite runs — passing all of them means the task passes. No LLM ever acts as judge anywhere in this process. Databricks' reasoning:

We did not use an LLM judge to evaluate correctness, since we've found that this rewards sounding right over being right. Databricks

Whether tests pass is binary — there's no room for interpretation. That's exactly why the "must have solid tests" filter can't be skipped: the credibility of the grading standard rests entirely on that test suite.

7Key finding

How Databricks guarded against cheating

In early runs, a few models scored suspiciously well. Pulling the full traces and reading them by hand traced the problem to the environment: every question comes from an already-merged commit, and the complete git history was sitting right there in the working directory. Any agent that can run shell commands can simply scroll back through that history and dig up the original "reference answer."

Agent receives the task ↓ Instead of writing code, runs git log first ↓ Finds the original implementation in a later commit ↓ Copies it → all tests pass → marked "pass"

The fix is blunt: during every run, the working copy gets completely severed from the repository so the git history simply isn't reachable.

Additional anti-cheating measures
The additional safeguards Databricks put in place. Image: Databricks

Every coding agent's harness and model ran with its standard out-of-the-box configuration, paired with the everyday tools Databricks engineers normally have access to — nothing was specially tuned for the test.

8Takeaways

Takeaways

None of this requires Databricks' scale to pull off. Any team with a stack of merged PRs already has, sitting right there, a benchmark no model has ever trained on — and the grading standard is just the tests it already wrote.

Mix and match — don't bet on one model. The frontier right now spans OpenAI, Anthropic, and open-source models; no single vendor owns every tier.

Route tasks by difficulty. Six in ten jobs are medium difficulty — send the simple ones to cheap models and save the flagship for complex design work. Databricks' next step is automating that routing.

Measure the harness layer first. Picking the right harness can sometimes save more than switching models — and it's a layer most teams have never even benchmarked.

Cost by completed task, not by token. Per-token price can't predict the total bill, and more thinking effort isn't automatically better.

✅ Build your own coding-agent benchmark

Databricks plans to keep adding questions, especially harder ones, and will run every new agent or harness through this test going forward.

Source
Benchmarking Coding Agents on Databricks' Multi-Million Line CodebaseVinay Gaba, Ankit Mathur, Rishabh Singh, Patrick Wendell, Matei Zaharia / Databricks·databricks.com·2026-07-08
Editor's note
Six of the charts came with the original post. The "PR to test question" flowchart and the "context fed into the model, by harness" comparison chart were drawn by this site based on the original's description. Figures marked "~" in the Section 5 table are read from coordinates on the original scatter chart; the source text doesn't list them line by line. pi's developers, star count, and minimal design come from its project page; GLM 5.2's origin is from Zhipu AI — neither detail was covered in the source.
↑ End of article
✓ This article is free to read in full

Members can copy or download the full Markdown, and let their AI subscribe and ask.

Read the original ↗
📮 New explainers, straight to your inbox

Found this useful? Leave your email — every new explainer, the moment it's out. Unsubscribe anytime.