Databricks' Playbook for Cutting AI Coding Costs: The Right Model Swap Alone Saves 50%+

Four tactics, validated against Stripe, Coinbase, Uber, and Ramp, each with a hard savings number.
By Databricks Blog08-08 · 12 min read⚑ Tutorial / how-to
🎧 Listen to the podcast0:00 / --:--
0:00 / --:--
Deep Dive · Xiaohu Notes
The 60-Second Read
  • AI coding clearly works — some teams at Databricks saw 10x throughput. But token bills are growing just as fast, and nearly every company scaling it has hit that wall.
  • The biggest lever is switching models. Stripe's tests showed the new Opus wasn't better, just pricier, so they refused to roll it out internally.
  • The most counterintuitive finding: no company uses hard caps as a daily tool. They keep the kill switch, but only as a last resort. Two very practical reasons why, below.
⚑ This comes from Databricks' official blog, by the five engineering and product leads behind the system. The savings figures, test data, and tool choices are all theirs; they call the summary table numbers "directional estimates based on informal surveys of dev teams." Infrastructure leads at Uber, Stripe, Coinbase, and Ramp are credited for reviewing.
The Problem

Efficiency Is Up, But the Bill Is Rising Faster

Databricks recently published a strikingly practical post-mortem on cost control: in AI-assisted coding, every internal speed metric has improved, with some teams seeing 10x output. But the bill has climbed exponentially alongside it.

That curve is unsustainable. Left unchecked, it eventually outpaces company revenue. It puts businesses in an awkward spot: they want to push AI adoption as far as possible and put the best tools in every employee's hands, but the total cost is eating into — and in some cases canceling out — the very efficiency gains AI was supposed to deliver.

The good news is that the companies who scaled AI first have figured out how to do both: give everyone frictionless access to AI tools while keeping per-seat costs locked in a roughly fixed range. The material here comes from Databricks' own experience, plus conversations with Stripe, Coinbase, Uber, and Ramp.

Four tactics, and what each one saves:

Databricks chart: four key techniques for AI cost management and their respective savings
The original article's summary chart, "Key Techniques in AI Cost Management." Left to right, the four tactics show roughly 50%+, ~30%, ~10%, and ~10% savings. Source: Databricks.
TacticWhat it doesSavings
Switch to cheaper modelsOpen-source models + newer, more efficient ones50%+
Smart routingDynamically dispatch between models and tools~30%
Spend governanceCost visibility, overage alerts, budget tripwires~10%
Context optimizationCompression, trimming tool bloat, tuning caches~10%

Some of this is off-the-shelf; the rest takes infrastructure work, especially on developer-local tools and multi-model traffic routing. Databricks has open-sourced or made freely available both key pieces of their own stack: Omnigent, the unified front-end for developers, and Unity AI Gateway, which manages the traffic.

The Foundation

Day-to-Day Coding Doesn't Need the Smartest Model

When people talk about "frontier models," they mean the smartest ones. Labs are racing to push the ceiling of intelligence; today's top models can crack math problems and surface novel security vulnerabilities.

But once AI is in the hands of thousands of developers across a company, a different frontier matters more: the efficiency frontier. It's the set of models that deliver a given level of intelligence at the lowest price.

Analogy

You'd call Einstein for a genuinely hard physics problem. Renaming a component or filling in boilerplate doesn't need that brain — using Einstein there is just burning money. Most everyday coding falls in that second bucket: it needs a model that clears the engineering-quality bar, and a higher ceiling won't help.

So the real driver of your company's bill is what those "good enough" models cost. And this efficiency frontier is advancing much faster than the intelligence frontier: new models land almost weekly, and each dollar buys more usable intelligence than the batch before it.

Intelligence frontier How smart the best model gets Creeps up one step a year Efficiency frontier What "good enough" costs Refreshed almost every week Time →
Our diagram: the top line is the intelligence ceiling, inching up once a year. The bottom line is the price of "good enough" intelligence, with new points dragging it down every week. The biggest savings lever is continuously migrating to the newest point on the bottom line, not cutting usage.
Lever 1

Switching Models Saves the Most, but Public Benchmarks Can't Be Trusted

This is the biggest win of the four: rapidly moving to newer, more efficient models saves more than anything else. But to capture that, a company first has to know which new model is genuinely better than the one they're on.

That's harder than it sounds. Public benchmark scores don't track real-world coding performance; a high score doesn't mean a model will do well in your codebase. So several companies have built their own automated evals, using tasks that better reflect what their internal development actually looks like. Databricks built theirs on a multi-million-line codebase, and the results flagged the GLM series as a standout on cost-performance. They rolled GLM out to internal developers.

We covered this custom benchmark
Databricks tested: in a multi-million-line complex codebase, which model and Harness combo gives the best cost-performance and the smoothest experience
That piece covers how the eval is built, how the tasks are designed, and how each model performed.

Evals also turn up negative results, like this one:

Rejected

Stripe found that Opus 4.7 offered no real quality gain over 4.6 but cost more, so they decided not to offer it internally. Databricks saw a similar cost regression comparing Opus 5.0 with 4.8.

When a major company publicly says "we tried this new model and decided not to give it to our employees," — vendors rarely talk about the new versions they've rejected. A new version isn't automatically a better deal; you have to test it yourself to know.

Databricks plotted their findings as of August 6, 2026. The x-axis is average cost per task, the y-axis is average pass rate. The points connected by the red line form the efficiency frontier — at those pass rates, nothing is cheaper:

Databricks chart: coding model efficiency frontier scatter plot and recommended model list
Left: the efficiency frontier scatter plot (as of 2026-08-06). On the red line, in order: GPT-5.6 Luna, GPT-5.6 Terra, GLM 5.2, GPT-5.6 Sol, Opus 4.8. Sonnet 5, GPT-5.4, and Sonnet 4.6 fall outside the frontier. Right: the three models currently recommended to developers. The caption notes that for data and knowledge tasks, Databricks uses Genie One; this chart covers core software development only. Source: Databricks.

The recommendation list is down to three: GLM 5.2, Opus 4.8, and GPT-5.6 Sol. None of them is the smartest model available right now. The efficiency frontier was never about picking the smartest one.

Tool Lock-In

Before You Can Switch Models Freely, Don't Get Locked In by Your Tools

The logic is straightforward, but when you actually try to switch, it's the tools — not the models — that get in the way.

The things developers actually use every day, Claude Code, Codex, Cursor, and the like, are called harnesses in the industry. The model does the thinking; the harness lets it read your code, edit files, and run commands.

Analogy

The model is the engine; the harness is the whole car — steering wheel, transmission, dashboard. The catch: closed-source frontier models are increasingly built to pair with specific harnesses; certain cars just drive better with certain engines. Swapping engines without changing the car is getting harder.

Getting used to a particular tool quietly ties you to one vendor's models. Once the switching cost gets high enough, the tool becomes a de facto lock-in, and a company can't move its spend to cheaper models even when it wants to. There are two ways out:

Option one: let developers switch tools. Offer several harnesses side by side, and when costs need to shift, ask people to use a different one. The upside is that developers get to use what they prefer day-to-day. The downside is that for an individual, the switching cost is real, and the people who've built habits will be unhappy.

Option two: put a unified layer on top (a meta-harness, in industry jargon). Developers see the same interface; underneath, the meta-harness picks the harness and model to dispatch to, with both closed and open-source options plugging in. This preserves model and tool independence without forcing anyone to adapt to a new UI. Databricks went this route internally, with their open-source Omnigent as the default entry point. Some companies they've talked to built their own internal version, integrated into their dev toolchain.

Databricks chart: side-by-side comparison of developers switching between harnesses vs. using a unified meta-harness
Left: developers juggling Claude Code, Codex, and OpenCode on their own, each tool bound to its own set of models. Right: a unified Omnigent layer on top, dispatching to the underlying tools and models. Source: Databricks.
Lever 2

Hard Tasks Get Expensive Models; Routine Tasks Get Cheap Ones

Both of the previous sections rely on people taking the initiative to switch. Could the system itself assign work based on difficulty? That's lever two: routing.

Analogy

Think of parcel sorting: packages hit a sorting table, local small items go down a cheap line, international oversized ones take the expensive route. The only difference here is that what's being sorted is your AI work.

The original post breaks routing into three types, fine-grained to coarse:

Your task rename / bug / refactor Router Checks difficulty And the cache Cheap model rename, boilerplate Expensive model explore latency designs
Our diagram: routing, in essence, lets a task find the cheapest model that can do it, so people don't have to pick every time.

1. Per-request routing

Insert a stateful proxy between your tool and the underlying models. It judges each request individually: who's the cheapest model that can answer this one, and sends it there. There's a trap to watch for: you have to factor in server-side caching. With large contexts, a cache miss is extremely expensive, so you can't just switch to the cheapest per-token price. Ready-made products already exist: Cursor Router, OpenRouter's AutoRouter, Ramp's Router, and Smart Routing inside Databricks' own Unity AI Gateway.

2. Per-task routing

One level coarser: you dispatch a whole task as a unit on the machine. "Rename component X to Y" is a simple task; "explore what designs could bring latency down" is a complex one. After the judgment, the whole thing goes end-to-end to the model in the right tier. The unified cockpit from the last section does exactly this; Omnigent supports this mode.

3. The expensive-cheap duo

Run two models inside the same tool: one expensive and high-intelligence, one cheap and workhorse. Both directions are in use:

  • Cheap leads, expensive advises — like Claude's Advisor tool, where a cheap model handles the whole session and only escalates to a stronger model when it hits something beyond its reach.
  • Expensive leads, cheap handles the grunt work — like Cognition's Devin Fusion, where a high-cost model runs the main loop and delegates selected subtasks to a cheap model.
We covered the first setup
Anthropic's official advice: Claude Fable 5 as the "advisor" and Claude Sonnet 5 doing the work keeps the bill manageable
That piece walks through how to set up the cheap-leads/expensive-advises pairing, and when to escalate.

On results, Databricks' internal numbers: the Smart Router consistently cuts average task cost by more than 30%, with quality roughly matching the most expensive model in the working set. Other companies they've talked to have seen similar results.

Databricks chart: scatter plot of Smart Router cost and resolution rate on coding tasks
The Smart Router eval: 92.3% task resolution at $2.13 per task, shown at the star. That's 35% cheaper than Claude Opus 5, with a resolution rate 1.3 points higher. Note that this chart and the efficiency frontier chart above use two different task sets (the y-axes are "tasks solved" vs. "average pass rate"), so the numbers shouldn't be compared across charts. Source: Databricks.
Lever 3

Skip Hard Caps; Add Friction in Stages Instead

Once the model layer is squeezed, it's time for the human layer. This is where many assume the answer is a monthly per-person cap: hit it, and you're done.

The post explains specifically why that isn't the answer. Every company interviewed treats hard caps as a last resort, not a daily tool. Both reasons are pragmatic:

  • Cutting someone off mid-task is pausing their productivity. The developer is in the middle of work and AI suddenly stops responding — neither the company nor the employee wants that.
  • Some of the biggest spenders are the highest producers. They're the ones using AI to unlock exceptional output. Cutting them off is self-harm.

In its place, a graduated approach: show people what they're spending first, then add friction in steps as spend rises.

1. Visible See your spend live 2. Reminders Dismiss and continue Higher tier: approval 3. Auto-downgrade No cut-off; switch to a cheaper model 4. Disable Last resort, usually temporary, and the start of a conversation More spend → more friction, but never a hard cut-off
Our diagram: four rungs in ascending order of friction. The first three all let people keep working.

Rung one: put spend in the open. Every company interviewed built near-real-time spend feedback, and many pair it with a suggestion — switch to this cheaper model, here's what you'd save. The key is that this ledger needs to aggregate across tools, so developers can judge which of their tools is returning the most per dollar. Databricks' internal developer dashboard looks like this:

Databricks chart: developer personal AI tool spend dashboard
Databricks' developer spend panel. This week: $1,559, up 67% from the developer's recent average, with 14 PRs shipped (8 more than last week). Below, the breakdown by tool: Claude Code $918 (59%), Codex $346 (22%), OpenCode $187, Genie $108. By model: Opus 4.8 at 44%, GPT-5.6 Sol at 27%. In the daily bar chart, the small gray bars are the company-wide median for all engineers that day. Source: Databricks.

Rung two: add friction at the gate. When spend crosses a threshold, something pops up that requires action. The lightest version is a self-dismissing notice — a heads-up that you're spending faster than usual, which Databricks found surprisingly effective at stopping unconscious spend. The next tier up requires approval, typically routing a budget request up the management chain.

Rung three: downgrade, don't cut off. Someone who hits the gate doesn't lose tokens. They get moved to a cheaper model. Because the gap between the cheapest models and the top-tier ones is huge, people can keep working but the bill stops climbing.

Rung four, and only then: disable. Most systems do keep the ability to cut someone off entirely. But it's usually temporary, and more often than not it's the opening of a conversation about how to use AI more cost-effectively.

Lever 4

The Real Bill Driver Is the Context the AI Adds Itself

The first three levers are about "which model" and "who approves." This last one is about cutting the tokens themselves.

In a coding agent, you might type one line: "help me debug this and fix it." What happens next is that the agent goes out and gathers a large amount of relevant context, calls a bunch of tools, digs through the codebase, and stacks on the skills and system information the company configured. By the time the actual expensive inference happens, the sentence you typed is a tiny fraction of what got fed in. The bulk of the bill is stuff you never explicitly asked for.

One inference, what gets fed in Your line Relevant code Tool outputs Company skills System info Segment widths are illustrative; the original post only says the user's input is negligible, without giving exact numbers
Our diagram: you're billed on what goes in, and the only part you typed is that tiny piece on the far left.

How to shrink that long bar? The methods are still new, and the post lists what people are trying:

  • Compress the current context more frequently.
  • Switch to a more "frugal" harness, or tune the one you have to use fewer tokens.
  • Audit each commonly-used tool and strip the filler from its outputs.
  • Encourage developers to break tasks into smaller units, so the scope of what needs to be read shrinks naturally.

As contexts get larger, prompt caching starts to matter more. Both closed and open models offer cache controls and retention settings: writing to cache costs money, but reading from it is much cheaper. Whether the trade-off works out depends on each team's working patterns, so manually tuning the default cache settings and pushing the hit rate up can have a big impact on the total bill.

12M
Avg. tokens per coding session, May
8.5M
After the harness tune-up, early June
5.5M
After cache retention tuning, mid-July

Databricks says they made relatively simple adjustments to the harness and cache settings, and the generated token count — and associated cost — dropped by nearly half, with no quality regression observed by developers. They believe there's still plenty of headroom.

Databricks chart: weekly average token consumption per coding session trending down
Tokens per coding session (weekly average). Two actions are marked: "harness tuning for token efficiency" in early June, and "longer cache retention to reduce writes" in mid-July. Source: Databricks.
Bringing It Together

Every Savings Lever Hangs on One AI Gateway

Step back and all four levers share a technical precondition. To switch models freely, a company needs a single place managing the "model menu," and the developer tools need to support mixing. To make cross-tool spend visible, you need one unified ledger. To control context bloat, you need to see what the tools are emitting and force compression.

These needs are converging on a new class of infrastructure software with a name that's catching on: the AI Gateway. Think of it as the company's AI dispatch center — four things happen here:

What it managesWhat that means
Access & capacityUnified proxy to the underlying models, closed and open
Budget & enforcementKeeps the ledger and runs complex policies like graduated friction and auto-downgrade
Client-side configPushes local settings to dev tools: model allowlists, compression, etc.
Session tracesLogs coding session trails for later efficiency analysis and evals

Databricks runs all four on Unity AI Gateway, paired with Omnigent for developers. Both are either open-sourced or free.

The exponential growth of AI coding costs isn't a fate to accept — it's an engineering and governance problem that can be solved. , the original post's conclusion

Companies that have tamed the curve all use the same playbook: watch the efficiency frontier, pick tools that preserve model freedom, route work to the cheapest model that can do it, replace hard caps with visibility and graduated friction, and cut the hidden context overhead. None of these levers sacrifices productivity — and productivity was the entire reason for adopting AI in the first place.

✅ AI Coding Cost-Control Checklist
These four levers are a checklist you can work through directly: eval before switching models, keep your tools swappable, let the system dispatch tasks automatically, replace one-size-fits-all caps with graduated friction, then compress the context the agent stacks on itself.
Source
Managing AI Coding Costs at ScaleDatabricks (Patrick Wendell, Akshat Bhatia, Vinay Gaba, Erich Elsen, Ivan Zhou)·Original·2026-08-07
About this page
All six charts are from the original post, source Databricks. The four light-colored diagrams (efficiency frontier, routing, graduated friction, inference input composition) are ours; the segment widths in the input composition are illustrative, as the original only notes the user's input is negligible without giving numbers. The efficiency frontier and Smart Router eval charts use two different task sets and are not compared against each other.
↑ 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.