A cloud bill is an architectural confession. I have built a good part of a career on reading them: every idle environment, every oversized instance, every decision nobody owned, itemised monthly and signed by the whole team. The deepest cut I was ever part of took seventy percent off one, and the work was never really about the bill. It was about the architecture behind it. So when the AI line started appearing in cost reviews, I did what the job has always demanded. I asked what machine, exactly, this money is renting. This piece is that answer.
Everyone prices the model. Almost nobody prices the serving. Inference is a cloud workload – capacity, latency, cost, failure – wearing new units, and the architect who can read tokens and GPU-hours the way they read a cloud bill holds the widest door in AI.
- Why the price list is the least interesting number in your AI budget, and what the machine behind it is actually doing.
- Two phases inside every model call, stressing opposite parts of the hardware, and the reason output tokens cost a multiple of input.
- Three doors to run a model through, six knobs you already own, and the one discipline that lets you turn them safely.
The public conversation about AI cost happens almost entirely at the price list: which model, which tier, cents per million tokens. That is the visible tenth of it. Underneath every price sheet is a serving layer – racks of accelerators, memory hierarchies, batching schedulers, capacity quotas – and that layer behaves like every large system you have ever run. It has bottlenecks, utilization curves, cold starts, and failure modes. It rewards the same instincts. It just prices them in unfamiliar units.
Chapter 4 of this series walks what the model does with your prompt. This piece walks what the metal does, because once you can see it, the bill stops being a mystery and starts being a design review.
The Path of a Token
Every model call, from a one-line question to an agent running for an hour, is the same two phases on the hardware. First the model reads everything you sent. Then it writes, one token at a time. The two phases could hardly be more different, and the difference explains most of the price sheet.
Three consequences fall straight out of this, and they are the three that matter in a cost review. Long context is rent: every token you send takes space in that working memory and time in that prefill, whether or not the answer ever uses it. Output costs more than input: the price sheets put a multiple on output tokens because decode is the slow, serial, memory-bound phase; the asymmetry in the price is the asymmetry in the machine. And an idle conversation is not free: an agent that holds a long transcript open is holding premium memory hostage while it thinks.
None of this requires you to know a single thing about transformer mathematics. It requires the thing you already do: asking what resource a workload actually consumes, and where it queues.
Why GPUs Refuse to Autoscale Like Web Servers
The instinct that fails first is elasticity. A web tier scales because its units are cheap, stateless, and boot in seconds. Model serving breaks every one of those assumptions. Before a GPU can serve its first token, the model's weights – tens of gigabytes, even compressed – have to be loaded into its memory, so a cold start is measured in minutes, not seconds. The accelerators themselves are quota'd, regional, and often simply unavailable; capacity is something you plan and reserve, not something you assume. And a GPU that is not busy is a burning meter, which is why serving stacks batch many requests through one copy of the weights, trading a little individual latency for multiples of throughput.
If that paragraph sounded discouraging, it should not. It describes a world that behaves less like serverless and more like the capacity-planned, utilization-obsessed systems that senior engineers already know how to run. The discipline transfers cleanly; only the units changed.
Three Doors, One Break-Even
Sooner or later every organisation asks where its inference should actually run. The honest answer is a build-versus-buy curve, and it has exactly three doors.
Rent the answer
Rent the room
Own the metal
Most teams should start at door one and earn their way inward: the per-token bill is the cheapest tuition you will ever pay for learning your own traffic shape. The move to door two is a spreadsheet decision – steady volume against committed capacity. The move to door three is an organisational one, and it deserves the same scepticism as any other build-versus-buy.
Except when the decision is not yours to optimise. In regulated industries – payments, health, anything a supervisor audits – where the data may travel decides where the model runs, and it decides it before cost enters the room. I have spent years in fintech watching residency and audit requirements shape architectures that a pure cost model would never draw. AI does not get an exemption from that; if anything, the scrutiny is sharper. The doors are still three, but in a regulated domain the first question at each one is not what it costs. It is what the auditor will say.
The Six Knobs You Already Own
Whichever door you stand behind, the levers that actually move an inference bill sit above the hardware, in decisions an architect controls. There are six that matter, and together they read like what they are: an architecture review.
-
Route the model
The single biggest lever. Most workloads are a mix of hard and easy calls, and sending everything to the flagship model is the AI equivalent of running your batch jobs on the largest instance in the catalogue. Classify the call, route the easy majority to a smaller, cheaper model, and escalate only what fails.
// ask: which of our calls actually need the strongest model? -
Discipline the context
Every token you send is rent: prefill time, cache memory, and money. Treat the context window like a payload contract – the right information, from a trusted source, in the smallest shape that works – not like an attic for the whole conversation's history.
// ask: what is in the prompt that the answer never uses? -
Cache what repeats
Shared prompt prefixes can be cached at the provider; repeated questions can be answered from a semantic cache without touching the model at all. Chapter 11 puts that lever at 40 to 70 percent of inference spend for the right workloads, which is not a rounding error. It is the difference between a pilot and a product.
// ask: how often do we pay full price for a question we have already answered? -
Batch and stream
Batching buys throughput at the cost of a little latency; streaming buys perceived speed without changing the total at all. Both are choices, not defaults. Make them deliberately, per endpoint, against a latency target someone actually wrote down.
// ask: are we paying for latency nobody asked for, or throughput nobody measured? -
Quantize at the edge
Behind door three, compressed weights cut memory and cost substantially, and for narrow tasks the quality loss can be negligible. The operative word is can. Whether it is negligible for your task is a measurement, not a vibe.
// ask: did we evaluate the compressed model, or just trust the benchmark? -
Eval before you downsize
Every knob above changes the system's behaviour, which is why the sixth knob is the one that makes the other five safe to turn. An eval set – the discipline of Chapter 12 – is what turns a cost optimisation from a gamble into a reversible change. Cut costs with evidence or do not cut them at all.
// ask: how would we know, within a day, if this got worse?
Capacity, contracts, caching, and proof. Strip the vocabulary away and this is the review you have run your whole career. That is the quiet good news of the whole piece.
Latency Got New Units Too
One response-time number no longer describes the experience. A model call has two that matter: time to first token – how long the user stares at nothing – and tokens per second – how fast the answer reads once it starts. Streaming exists precisely because the second can hide the first: a response that starts in half a second and reads at a natural pace feels fast even when the full answer takes twenty. Set service objectives on both numbers, per endpoint, the same way you have always set them – the discipline is the one from designing for load you have not met yet, with two new indicators on the dashboard.
The Wide Door
Stage 06 of the Route ends at a fork: go deep, toward the mathematics and the training runs, or go wide, taking trustworthy AI into a hard domain. This piece is the case for wide. The serving layer is where AI stops being a demo and starts being a line item, an SLO, and an audit finding – and reading that layer is not a new skill. It is your oldest skill, pointed at new metal. The engineers who can make AI trustworthy and affordable in a regulated domain will not need to introduce themselves. Their bills will do it.
This piece walked the machine. The natural companion is the bet behind it. Chapter 14 · AI Is Not Free follows the money the other direction – who is paying for all this capacity, and why the meter itself is the business model. Or step back onto the Route at Stage 06 and choose your door.