November 24, 2026 · 10 min read · Production · Architecture · Cost
Inference Economics: Tokens, Cache and Model Choice Drive the Bill
An agent that answers well but loops through tools for minutes is not better, it is more expensive. Tokens, cache and model choice belong in the same scorecard as quality, with a budget you can explain.
Yassine Aqejjaj · HEAD OF AI · Updated on November 24, 2026
Inference economics is the cost of running a model in production: tokens in and out, cache hits and misses, and which model you choose for each step. A loop multiplies that cost on every turn. In production, cost and latency are quality criteria, not an afterthought for finance, and they need a budget and a trace.
What is inference economics?
Inference economics is a dull name for a practical question: what does it cost, in money and in time, to get an answer you can stand behind? The inputs are familiar — tokens in, tokens out, the price of the model, the number of turns in a loop, and whether you already had a result you could reuse.
A single completion has a price. An agentic loop has a price times the number of plans, acts and reflections it takes, plus every tool call that comes back as more tokens to read. I wrote about that loop in my article on agentic loops. Runaway cost is one of the failure modes I put on the first design, not a surprise for the finance team at the end of the month.

- Tokens in
- Cache
- Bill
Why score cost and latency like quality?
A fluent answer that arrived after twenty model calls is a different product from the same sentence after two. Users feel the wait. You feel the bill. If quality is the only score, teams will add a more expensive model, another retry, another specialist, and the demo will look better while the unit cost quietly doubles.
I treat cost and latency as criteria with weights I can explain, next to faithfulness, safety and usefulness. That is also how I would evaluate a change: a new prompt that is slightly better and twice as expensive is not an obvious win. I set out the wider method in my article on evaluations. The same rule holds here: no score without a formula, and no release without looking at the bill.
When is a cache a saving, and when is it a risk?
A cache hit should cost a fraction of a miss. Identical questions, stable reference text, embeddings you already computed: these are good candidates, if you know the result is still valid. A miss pays the full model price, and in a loop a miss on every turn is a design, not an accident.
Caching is unsafe when the answer depends on who is asking, on data that has changed, or on a permission that may have been withdrawn. A cached paragraph served to the wrong user is not a saving. It is a leak. The cache key must include the identity, the classification and the version of the source, or you should not cache at all.
How should you choose a model for a step?
Teams often choose one model for everything because it is the most capable, or the one already in the contract. That is rarely the cheapest design, and it is not always the best. A classification, a short extraction, a routing decision can often live on a smaller model. A hard reasoning step, or a final answer that will be read by a customer, may earn a stronger one.
The choice belongs to the step, not to the brand. Behind a gateway, as I argue in my article on AI gateways, “cheap”, “strong” and “sovereign” should be names you can reroute without rewriting the agent. Measure the swap on a fixed set of scenarios, including cost and latency, before you make it the default.
Which failure modes blow the bill?
Most cost incidents I review are not a surprise price rise at the vendor. They are a loop with no cap, a cache that never hits, or a large context sent because nobody trimmed it. The table is the review I would run before the first busy week.
| Failure mode | What it looks like | Control I look for |
|---|---|---|
| Unbounded loops | The agent retries, reflects and calls tools until a person notices the bill | A step limit and a cost cap per run, with an alert when either is hit |
| Context bloat | The full transcript is resent on every turn, including tool output nobody needs | Summarise and trim; log tokens per step and watch the trend |
| Cache that never hits | Every request is treated as new, including identical ones | A cache with a key that is safe, and a hit rate you actually measure |
| One model for every step | A strong, expensive model classifies a yes-or-no field | Routing by purpose, and an evaluation that includes cost |
| Invisible spend | Nobody can attribute the invoice to a team, a run or a feature | A gateway or an equivalent trail that ties each call to a caller and a purpose |
What have I measured on cost and tokens?
On the DILA platform — a sovereign generative AI platform for a public institution — pipeline optimisation and reuse contributed to a 30% lower cost per AI request. That figure is published on the case page. It is not a cache-hit rate, and it is not a result I will attribute to a single trick. It is what a designed pipeline, with evaluation and reuse, did to the unit cost.
On Nova Context, the published figure for context token reduction is 48%. That is a context-layer result, not a claim about a particular vendor cache. It matters here because every token you do not send is a token you do not pay for, and a slightly smaller, better-chosen context is often a better answer as well as a cheaper one.
How do the loop, the gateway and the bill fit together?
The loop decides how many times you pay. The gateway, if you have one, makes the payment visible and limited. The cache and the model choice change the price of each payment. None of the three is enough on its own. A perfect gateway will not save a loop that has no stop rule. A clever cache will not save a context window that is stuffed with noise.
This is why I would start with a stop rule and a trace, then a budget, then routing and cache. The order is the same as for any other production concern: first see the work, then cap it, then make each unit cheaper without silently changing the meaning of the answer.
What should you refuse to optimise first?
I would not start by changing the model, and I would not start by buying a more sophisticated cache. If the loop has no stop rule, those changes will only make an unbounded run cheaper per turn, and therefore easier to leave running. The first saving is a cap. The second is a trace that shows which steps are expensive.
I would also refuse a saving that changes the meaning of the answer without a test. A smaller context that drops the only supporting passage is not a win. A cheaper model that fails a safety case is not a win. Cost work has to go through the same evaluation gate as any other change: a baseline, a candidate, and a decision you can defend.
In what order should you work on inference cost?
Cost work is easy to postpone and expensive to unwind. This is the sequence I would follow today.
- Put a step limit and a cost cap on the loop before you optimise anything else.
- Log tokens and cost per step, so you can see where the money goes.
- Trim the context: send what the step needs, with provenance, not the whole history.
- Route cheap steps to a smaller model, and measure quality and cost on the same scenarios.
- Add a cache only where the answer is stable, permissioned and safe to reuse.
How should you talk about cost without inventing a figure?
I only use numbers I have already published, and I say what they measure. The DILA reduction of 30 percent in cost per request is a platform result. The Nova Context reduction of 48 percent in context tokens is a retrieval result. Neither is a gateway KPI, and neither is a proof that a particular cache product works. They are evidence that cost can be a first-class criterion when you actually measure it.
If I do not have a figure that isolates the change I care about, I omit it. A structural claim — a cap, a cache key, a model chosen by purpose — is more honest than a number that was measured on something else. That discipline is part of inference economics, not a footnote.
FREQUENTLY ASKED QUESTIONS
What is inference economics?
The cost, in money and in time, of running models in production: tokens, cache, model choice, and the number of turns a loop takes. It is a product question, not only a finance question.
Why do agent loops cost more than a single completion?
Because each plan, act and reflection can call a model and tools again, and the history of the run is often resent as context. Without a stop rule and a cap, the price grows with the loop, not with the value of the answer.
When should you cache a model result?
When the answer is stable, the requester is entitled to see it, and the source has not changed. The cache key should include identity, classification and version. If you cannot write that key, do not cache.
Should you always use the strongest model?
No. Choose a model per step, and measure quality, cost and latency on the same scenarios. A strong model earns its place on hard reasoning or high-stakes answers, not on every classification.
What figures can you actually cite on cost?
Two published ones I use here: a 30% lower cost per AI request on the DILA platform, from pipeline optimisation and reuse; and a 48% context token reduction on Nova Context. Neither is a vendor-cache benchmark.
RESULTS
−30%
cost per AI request (DILA platform)
−48%
context token reduction (Nova Context)
800
employees use NOVA at Devoteam
RELATED CASE STUDY
KEEP READING
Figures come from validated client results and from my role at Devoteam. The projects on GitHub are public betas.