by Vinay Gaba, Ankit Mathur, Rishabh Singh, Patrick Wendell and Matei Zaharia
At Databricks, the way we build software is changing quickly as we aggressively adopt AI for engineering. The landscape of models and harnesses for code authoring has rapidly expanded in the last year, giving developers more choices than ever. With more options, it has become increasingly important to understand which coding agents offer the best performance on real-world coding tasks as well as understanding how task-performance varies with price.在 Databricks,随着我们积极在工程实践中采用 AI,软件开发方式正在迅速改变。过去一年里,代码编写模型和工具框架的生态迅速扩张,开发者拥有了前所未有的选择。面对如此多的选项,了解哪些编码智能体(coding agents)在实际编码任务中表现最佳,以及任务表现如何随价格变化,变得愈发重要。
This article shares the results and methodology of the internal coding benchmark we built at Databricks, which evaluates tools on actual coding tasks our engineers performed on the Databricks codebase. Tasks featured edits against a multi-million line codebase covering many popular languages (Python, Go, Typescript, Scala, etc.) and both tasks and solutions were carefully reviewed to ensure accuracy. This isn't meant to be comprehensive, but the exercise surfaced insights that have already made our engineering team meaningfully more efficient with coding agents. Below, you can see how models and harnesses scored on the overall benchmark:本文分享了我们在 Databricks 内部构建的编码基准测试的方法论及结果。该测试基于我们的工程师在 Databricks 代码库上执行的实际编码任务来评估工具性能。任务涵盖了数百万行代码库的编辑工作,涉及多种主流语言(如 Python、Go、TypeScript、Scala 等),且所有任务和解决方案均经过仔细审核以确保准确性。此举并非为了追求全面,但通过这项工作,我们获得了宝贵的洞察,使我们的工程团队在使用编码智能体时效率显著提升。以下是各模型和工具框架在整体基准测试中的得分表现:

Figure 1: Cost vs. Performance on our benchmark图 1:基准测试中的成本与性能对比
The main conclusions from our analysis were:我们分析得出的主要结论如下:
Let’s dive a bit deeper on each one.让我们深入探讨每一个结论。
Specific results being a couple points off can often even out in real world tasks. We focused more on the thematic patterns that help us reason about which models to use for various tasks. In fact, the results showed clear clustering of the models and harnesses into 3 capability tiers.具体测试结果出现几个点的偏差在实际任务中往往可以忽略不计。我们更关注有助于我们判断不同任务适用哪些模型的模式。事实上,结果显示模型和工具框架可以清晰地划分为 3 个能力层级。

Figure 2: Three distinct capability tiers emerged in our overall results, with nuance in which models were effective in each group图 2:我们的整体结果中出现了三个截然不同的能力层级,且每个层级中有效模型的构成各有侧重
At the upper end of performance, we see that the most intelligent models are very effective at solving all kinds of problems, but they’re very expensive. Medium and lower intelligence models are still highly effective at the common tasks, and in many cases, they’re also significantly cheaper. 在性能顶端,最智能的模型在解决各类问题时非常有效,但成本极其昂贵。中低智能的模型在处理常见任务时依然高效,且在许多情况下性价比更高。
Day to day, engineers do a lot of different things that vary significantly in complexity: common operational tasks like flipping a flag or updating configs don’t require extremely intelligent models, but deeper design explorations do. However, in the past, our default models were always the most expensive ones. Based on this analysis we determined we should push more work to the Haiku and GPT 5.4 Mini class of models.工程师日常处理的任务复杂程度各异:诸如切换开关或更新配置等常见操作任务不需要极高智能的模型,但深入的设计探索则需要。然而,过去我们默认使用的总是最昂贵的模型。基于此分析,我们决定将更多工作负载转移到 Haiku 和 GPT 5.4 Mini 这一类别的模型上。
There’s been a lot of excitement about GLM 5.2, and our results showed evidence that GLM can be a daily driver model for a lot of our developers. It landed in the top capability tier, statistically tied with Opus 4.8 on quality, but costing $1.28/task against Opus’s $1.94.大家对 GLM 5.2 充满期待,我们的结果也证明了 GLM 可以成为我们许多开发者的日常主力模型。它处于最高能力层级,在质量上与 Opus 4.8 统计上持平,但每个任务的成本仅为 1.28 美元,而 Opus 为 1.94 美元。
The GLM quality scores are consistent with qualitative feedback we’ve gotten from internal developers who have been piloting GLM for daily development. Because of its great performance for everyday coding tasks, we’ve been focused on serving GLM with the best performance, and the evidence shows it’s time to start deploying these as daily drivers for coding. GLM 的质量评分与我们内部试用 GLM 进行日常开发的开发者反馈高度一致。鉴于其在日常编码任务中的出色表现,我们一直致力于优化 GLM 的服务性能。证据表明,现在是时候将其部署为日常编码的主力工具了。
Developers often eyeball token costs to determine how expensive a model will be when completing coding tasks. We found, however, that token costs are often a poor indicator of overall task costs, due to variance in reasoning efficiency amongst models. This underscores the need for task-level benchmarking, since task shape and complexity may be different in different contexts.开发者往往通过观察 Token 成本来判断模型完成编码任务的昂贵程度。然而我们发现,由于不同模型在推理效率上的差异,Token 成本往往无法准确反映整体任务成本。这凸显了进行任务级基准测试的必要性,因为任务的形式和复杂性在不同场景下可能大相径庭。
As an example, Sonnet 5 is ~1.7x cheaper per token than Opus 4.8, but, on our tasks, we found that Sonnet cost $2.09/task vs Opus’s $1.94, while scoring six points lower on task completion (81% vs 87%). This was mostly because Sonnet 5 worked longer and read more to get there, consuming 1.9x more tokens. 例如,Sonnet 5 的 Token 单价约为 Opus 4.8 的 1.7 倍,但在我们的任务中,Sonnet 的单任务成本为 2.09 美元,而 Opus 为 1.94 美元,且 Sonnet 在任务完成度上低了 6 个百分点(81% 对 87%)。这主要是因为 Sonnet 5 为了完成任务耗时更长、读取内容更多,消耗的 Token 多出 1.9 倍。
When we ran the same model with the same thinking effort through two different harnesses (Claude Code/Codex vs Pi), we observed that the cost per task differed significantly (more than 2x in some cases), while quality remained the same. The main difference came down to how much context each harness fed the model on each turn.当我们使用相同的模型和思考强度,通过两个不同的工具框架(Claude Code/Codex 与 Pi)运行时,观察到任务单价存在显著差异(某些情况下超过 2 倍),而质量却保持不变。主要区别在于每个工具框架在每轮交互中向模型提供的上下文数量不同。

Pi sent about 3x less context per turn. It managed context better, keeping a tighter working set and finishing the tasks in fewer runs.
Pi 每轮发送的上下文大约少 3 倍。它能更好地管理上下文,保持更紧凑的工作集,并以更少的运行次数完成任务。

The lesson here isn’t that one harness is always cheaper or that native harnesses are worse. Instead, model choice is only one piece of the puzzle. Establishing this flexibility is why we invested in Omnigent to make mode-and-harness swaps seamless. 由此得出的教训并非某个框架总是更便宜,或者原生框架更差。相反,模型选择只是拼图的一部分。正是为了建立这种灵活性,我们投资了 Omnigent,以实现模型与工具框架的无缝切换。
Public benchmarks like SWE-Bench and TerminalBench are useful, but they can’t answer the questions we had. There are a few reasons for this:像 SWE-Bench 和 TerminalBench 这样的公共基准测试很有用,但它们无法回答我们的问题。原因如下:
By building a benchmark on our own PRs, we can make these decisions with higher confidence that we won’t hamper our developers by rolling out optimizations.通过基于我们自己的 PR 构建基准测试,我们可以更有信心地做出决策,确保在推出优化措施时不会阻碍开发者的工作。
We used Unity AI Gateway to capture logs of all our coding interactions, which enabled us to analyze the complexity of the tasks engineers tackle using coding agents. There was a significant diversity in the task complexity, and about a quarter were tagged as low-complexity work and ~60% as medium complexity.我们利用 Unity AI Gateway 捕获了所有编码交互的日志,这使我们能够分析工程师使用编码智能体处理的任务复杂性。任务复杂性差异显著,约四分之一被标记为低复杂度工作,约 60% 为中等复杂度。

However, expensive models are the default models engineers use, so there was clearly a huge opportunity for improving efficiency.然而,昂贵的模型是工程师默认使用的工具,因此在提升效率方面显然存在巨大空间。
Our engineers merge thousands of code changes a day, so we already have a great dataset to build off. A good pull request is a rich artifact, with commits that show iteration from the developer, review by humans, and tests that help verify a code change is faithful to its intent. However, we needed several quality checks and filters to construct a high-quality benchmark out of them:我们的工程师每天合并数千次代码变更,因此我们已经拥有了一个极佳的数据集。一个优秀的 Pull Request 是丰富的产物,其中的提交记录展示了开发者的迭代过程、人工评审意见以及用于验证代码变更是否符合意图的测试。然而,我们需要通过多项质量检查和过滤,才能从中构建出一个高质量的基准测试:

Once we had candidate PRs, we focused on constructing well-specified tasks by:在获得候选 PR 后,我们通过以下方式构建规范的任务:
What came out of this exercise was a single task in the benchmark. Here’s a simplified example:这项工作最终产出了基准测试中的一个单一任务。以下是一个简化示例:
{
"id": "go_bugfix_01",
"category": "Go — bugfix",
"base_commit": "fga6rfb27…",
"prompt": "Workflow submissions in the deploy service are deduplicated with an
in-memory cache. Two distinct templates submitting at the same time
can collide on the same cache key, and one submission is silently
dropped. Make the dedup key distinguish submissions that should be
treated as different.",
"source_files": ["services/deploy/cache/recent_cache.go", "..."],
"test_targets": ["//services/deploy/integration/gateway:gateway_test"]
}While we used scripting and AI to generate candidate tasks, we evaluated each sample by hand. In some cases, we found that tests in the original PR needed to be rewritten to allow for an alternative implementation or to be more rigorous, which we did manually (without AI). Similarly, we also found cases that required improving the task description to make them well-specified.虽然我们使用脚本和 AI 生成了候选任务,但我们对每个样本都进行了人工评估。在某些情况下,我们发现原始 PR 中的测试需要重写,以允许替代实现或提高严谨性,这些工作我们均由人工完成(未使用 AI)。同样,我们也发现有些情况需要改进任务描述,使其定义更明确。

Figure 3: A before-and-after from our test suite: the previous test anchored on verifying exact string match which resulted in some failures when the model tried to solve the task. This wasn’t a great way to test non-deterministic output so it was rewritten to grade behavior instead.图 3:测试套件改进前后的对比:之前的测试基于精确的字符串匹配,当模型尝试解决任务时会导致部分失败。这对于测试非确定性输出而言并非良策,因此我们将其重写为基于行为的评估。
We instantiated the coding agent harnesses and models using their standard, out of the box setups, with all common tools that Databricks engineers would have available to them.我们使用标准、开箱即用的设置实例化了编码智能体框架和模型,并配置了 Databricks 工程师可用的所有通用工具。

When the agent explicitly said that it had completed the task, we checkpointed that code, patched the tests that were held out, and evaluated the tests to determine whether that task is a “pass” for that model + harness combination. We did not use an LLM judge to evaluate correctness, since we’ve found that this rewards sounding right over being right.当智能体明确表示已完成任务时,我们会对代码进行检查点保存,应用预留的测试,并评估测试结果以确定该任务对于“模型 + 框架”组合是否为“通过”。我们没有使用 LLM 评判员来评估正确性,因为我们发现这会导致模型倾向于“听起来正确”而非“事实正确”。

In our early experiments, a few model scores looked too good to be true, so we manually inspected the traces to understand what happened in these agent trajectories. What we saw was that due to our original setup, the “correct” implementation was still recoverable in the Git history of the worktree! Every task had originated from a merged commit, so nothing stopped an agent with a shell from walking forward through git history to find it. To fix this issue, we sealed git history: for the length of each run, we cut the working copy off from the repository entirely.在早期实验中,一些模型得分看起来好得令人难以置信,因此我们手动检查了轨迹以了解智能体在这些路径中发生了什么。我们发现,由于初始设置的原因,工作树的 Git 历史记录中仍然可以恢复“正确”的实现!每个任务都源自一个已合并的提交,因此没有任何东西能阻止带有 shell 的智能体通过 Git 历史记录向前查找。为了解决这个问题,我们封存了 Git 历史:在每次运行期间,我们将工作副本与存储库完全隔离开来。
We started with a simple question: can we use coding agents more efficiently? The answer is a definitive yes, and because we can be data driven, we can start building capabilities to select the right models automatically and track efficiency.我们从一个简单的问题开始:能否更高效地使用编码智能体?答案是肯定的。因为我们可以做到数据驱动,所以可以开始构建自动选择正确模型并跟踪效率的能力。
Any company can do the same. 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. We’re actively adding more tasks (especially harder ones), and we plan to run every new agent/harness through it and feel more confident about our choices.任何公司都可以这样做。任何拥有已合并 PR 积压工作的团队,都坐拥一个没有任何模型训练过的基准测试,且由团队编写的测试进行评分。我们正在积极添加更多任务(尤其是更难的任务),并计划让每一个新的智能体/框架通过测试,从而对我们的选择更有信心。
At Databricks, we’ve always been wary of lock-in, not just to vendors, but to assumptions that make teams less flexible over time. That same instinct shaped our early bets on open formats and standards, and it shapes how we’re approaching AI now: measure what actually works on the code we ship, give engineers room to move across models and harnesses with consistent guardrails, and do optimizations to use AI effectively.在 Databricks,我们一直警惕被锁定,不仅是针对供应商,更是针对那些随着时间推移让团队灵活性降低的假设。同样的直觉塑造了我们早期对开放格式和标准的投入,也塑造了我们现在处理 AI 的方式:衡量在我们发布的代码上什么真正有效,为工程师提供在模型和框架间切换的空间并辅以一致的护栏,以及通过优化来有效利用 AI。
In a follow-up blog, we’ll talk more about how we’re using intelligent routing features in Unity AI Gateway and in Omnigent to help our developers use the most intelligent agents while being efficient.在后续博客中,我们将详细讨论如何利用 Unity AI Gateway 和 Omnigent 中的智能路由功能,帮助开发者在保持高效的同时使用最智能的编码智能体。
Subscribe to our blog and get the latest posts delivered to your inbox.
