AI spend now shows up on the bill, and open models are where many teams look first. One fintech says its invoice fell to a tenth after it moved coding work to an open model on its own GPUs. Getting there takes more than a new base URL. You have to know how hosted inference behaves: who serves the model, what the cache does, why the tail is slow, and when a GPU of your own starts to pay. Agents make every one of those levers bigger, because they send long contexts, repeat the same prefix and call the model dozens of times per task.
In 60 seconds
Open-weight models ran 71.5% of one AI gateway’s tokens in September 2026 and 23% of its spend, up from 7% of tokens in December 2025.
Claude’s API showed 99.76% uptime over 90 days on its own status page. A service that promises 99.99% and calls one such API in series tops out at 99.75%.
Four models with the same $4 per million token price cost $1.27 to $10.02 per task on one public index: a 7.9x spread.
On Opus 5.5 list prices, a cache hit rate falling from 99% to 90% raises input cost by 144%. Agents resend their history on every call, so this number runs the bill.
A drafter model can double per-user speed: EAGLE 3.1 reported 2.03x at one user, falling to 1.66x at 16 users on the same GPUs.
Open models now run most tokens on one big gateway
Vercel publishes a monthly index of the traffic on its AI Gateway. Its October 2026 edition said: “Open-weight models now process more than seven in ten gateway tokens and account for nearly one in four dollars.” In December 2025 the token share was 7%. By August 2026 it was 56%.
Money followed more slowly. In June, open-weight models ran 29% of tokens on just under 4% of spend. Since December, Vercel says, frontier spend grew tenfold and open-weight spend grew more than seventyfold. One caveat: the October report counts “open weight” more broadly than earlier ones did.
Single companies tell the same story. In an October 2026 talk, Revolut’s David Abitbol said his team self-hosts GLM at a blended “30 cents per million” tokens. “And so our invoice is one-tenth of what we were spending on Anthropic and OpenAI.” That figure is his own and leaves out what the GPUs and staff cost.
NVIDIA’s February 2026 blog collected vendor cases. Sully.ai cut inference cost by 90% after moving to open models on Baseten. Decagon’s cost per query fell 6x on Together against closed models. Both are self-reported and unaudited.
There are two ways in. Buy or lease GPUs and run the model yourself, or rent a provider that runs the GPUs for you.
This edition walks the second path in stages, then shows when the first starts to make sense:
What providers are and how they differ from the labs.
Why teams leave lab APIs: cost, control and custom models.
Picking a model, a provider and a deployment mode.
Stage one: a shared, per-token open-model API.
The signals that say you have outgrown it.
Stage two: dedicated GPUs, sized from your own targets.
Drafter models that make decoding faster.
Experiments you can run on a laptop.
If you run agents, the share matters more for you than for a chatbot. Agent loops burn tokens on long contexts and tool calls, and that volume is where a cheaper model pays first.
56 GPUs serve 2,000 engineers at one bank

The do-it-yourself path has a public example with numbers. Abitbol described how Revolut sized its fleet for coding agents. “So to serve 2,000 engineers, we roughly need 56 B200. And that’s to host GLM 5.3.”
The targets were modest. He aimed for “sub-3 second time to first token”. On output speed he said “200 tokens per second. People are fine.” After 5 p.m., he said, “you can get 800 TPS”.
Tuning moved the numbers a lot. In April the fleet handled about 3 requests per second, with time to first token over 10 seconds. By August it handled more than 7 requests per second at about 1.6 seconds. He called it an “88% improvement in performance for 76% increased demand.”
Two of his levers are worth copying. He capped context at 256K tokens on a model that can serve one million: “256 is really what you need.” He also watched cache hits closely: “coding test needs to be above 90% cache hit.”
That path needs GPUs, people and time. Most teams start with option B: an inference provider. Together, Fireworks and Baseten all sell the same three modes. You can share capacity and pay per token. You can reserve throughput. Or you can rent dedicated GPUs by the hour or minute.
Fireworks puts the ladder in one line: “Start on shared serverless capacity, guarantee it as traffic grows, or run Fireworks inside your cloud.”
Moving to a provider swaps lab problems for new ones. Together’s docs say it plainly: “When demand is high, Together may limit requests to maintain these performance goals. You may receive a 429 Too Many Requests or 503 Service Unavailable response. Serverless performance is best-effort.” Three pains show up early: tail latency, cache hit rate and rate limits. Later sections cover each.
If you run agents, note one detail from the talk. “We no longer look at the stream of thinking tokens,” Abitbol said. “People run tasks in parallel and check in when the task is done.” For agent work, total task time matters more than how fast tokens stream. That changes which latency number you tune.
Providers sell the labs’ API on open weights

An inference provider sells hosted model access in the same shape as a lab: an endpoint, streaming, and a price per million tokens. The difference is whose weights sit behind it. Labs train their own models. Providers host open-weight models trained by someone else.
There are plenty to host. Baseten’s 2026 book on inference counts more than two million open models on Hugging Face. Vercel’s index put the split in one line: “The Chinese lab builds the model; the American provider runs it and sells access.” More than two thirds of September’s gateway spend on Chinese-origin models went to US-based providers. In December it was under a tenth.
The API shape is copied on purpose. Together’s docs: “The Together API is compatible with the OpenAI REST API and SDKs across chat, completions, vision, image generation, text-to-speech, and speech-to-text.” It also supports “the OpenAI Responses API and the Anthropic Messages API”. Fireworks says compatibility “makes migration of existing applications already using OpenAI particularly easy.”
In practice, switching is mostly a base URL change. You set the API key and point base_url at the provider’s address, which Together and Fireworks each document in one line. Revolut’s speaker said the same of his own stack: “all of these endpoints are going to be OpenAI compatible API with response API”.
The edges still differ. Fireworks lists “minor differences” from OpenAI, such as how max_tokens behaves. Billing differs too. Fireworks says: “Every serverless request bills on input, cached input and output tokens.” Read the billing line before you compare prices, because cached input is where agents spend.
Providers compete on price, hardware, speed and customisation. The same model can cost very different amounts by host. As of 17 November 2026, OpenRouter listed 49 endpoints for GLM 5.3 from 37 providers. Input prices ran from $0.0699 to $2.10 per million tokens, a 30x spread. Output ran from $1.40 to $6.60. Artificial Analysis tracked 24 providers for the same model, with blended prices from $0.12 to $2.52 per million.
If you run agents, a cheap listing is only a start. One GLM 5.3 host on OpenRouter caps context at 262,144 tokens while the other 48 endpoints serve about one million. A long agent session can work on one host and fail on the next, under the same model name.
Three kinds of provider now sell the whole agent stack
Providers are not all alike. Their own pages show three pitches.
The first pitch is a programmable cloud built on open source. Together calls itself “The AI Native Cloud” and links its open source stack and systems research from the homepage. The open engines themselves now have companies behind them. In October 2026 Google announced native PyTorch backends on TPU for vLLM, “developed in partnership with Inferact”, and for SGLang, “developed in partnership with RadixArk”. Google describes Inferact as “founded by the creators of vLLM”.
The second pitch is research on customer models. Fireworks Research shipped Ember-1 in September 2026, built on Kimi K3. Fireworks says it “delivers Kimi K3’s quality with 40% fewer tokens.” That is the vendor’s own claim, tested on “external benchmarks, in live customer A/B tests, and on our own coding and agent workloads”. A month earlier, Fireworks and Harvey post-trained Kimi K3 into a legal model called Tenet.
The third pitch is an agent platform on top of inference. Baseten’s homepage offers “Sandboxes Give your agents a secure place to run” next to model APIs and training. Modal lists “Sandboxes Isolated environments for coding agents, RL rollouts, and untrusted code”. Together sells a sandbox and a post-training loop too.
The overlap is the news. Three vendors known for serving models now sell the places where agents run, and the training that shapes the model inside them.
Shorter reasoning is its own cost lever. Ember-1 costs the same per token as Kimi K3 on Fireworks: $3 in and $15 out per million on OpenRouter, as of 17 November 2026. If the 40% claim holds on your traffic, price per task falls while price per token stays put.
If you run agents, that matters more than for chat. Reasoning and output tokens pile up across a multi-call loop. A model that thinks less per step saves on every step. Test the claim on your own tasks before you count the saving, since the number comes from the seller.
Providers skip pre-training, where the money burns

Providers skip pre-training frontier models. This choice accounts for the biggest difference in their cost base.
Epoch AI measured frontier training costs in a 2024 paper, revised in February 2025, so treat the figures as older. It found “the amortized cost to train the most compute-intensive models has grown precipitously at a rate of 2.4x per year since 2016”. It also projected that “the largest training runs will cost more than a billion dollars by 2027”.
Even efficient labs spend a lot, though less than the frontier. DeepSeek’s V3 technical report from early 2025 says the model “requires only 2.788M H800 GPU hours for its full training”. Using the report’s assumed rate of $2 per GPU hour, the total comes to about $5.6 million. Very few application teams have that kind of budget for a single run.
Post-training an open base is a different order of cost. In August 2026, Fastino Labs said an agent finished a post-training job on an NVIDIA Nemotron base “in less than a day”. Harvey’s Tenet came from post-training Kimi K3 using async reinforcement learning. Fireworks says this process nearly doubled the main score “at near-flat cost per task”.
Because of this, providers start with someone else’s pre-trained weights. Their competition happens in the steps that follow: serving speed, hardware, price, and tuning. We saw the result of this earlier for a single model, with a 30x spread in input price for GLM 5.3 across different hosts as of 17 November 2026.
Precision drives part of that price spread. OpenRouter’s listing for GLM 5.3 showed 18 endpoints at fp4, 12 at fp8, 4 at nvfp4, and 15 that did not state a precision. Serving at lower precision costs less, though it can also alter the model’s answers, something a later section measures.
For teams running agents, this split shows where the budget makes sense. Pre-training is off the table, while post-training on existing agent traces is a real option. A provider’s whole business relies on that second step staying cheap, so check the actual price before assuming it is out of reach.
No lab API reaches four nines on its own status page
The labs publish their own uptime. On 17 November 2026, Claude’s status page showed 99.76% over 90 days for the Claude API. It showed 99.56% for claude.ai and 99.7% for Claude Code. OpenAI’s page showed 99.97% for its APIs, 99.26% for ChatGPT and 99.94% for Codex.
Turn those into minutes. A 99.99% target allows 13 minutes of downtime in 90 days. Claude’s API at 99.76% is 311 minutes. OpenAI’s APIs at 99.97% are 39 minutes. A service that calls a 99.76% API on every request, in series, can reach at most 99.75%.
The real number is likely worse. status.claude.com runs on Atlassian Statuspage. Its docs say: “The “degraded performance” and “under maintenance” states are not considered for this feature.” They add that “partial outages are discounted to only be 30% as bad as major outages.” On 17 November, claude.ai showed “Degraded Performance” and still read 99.56%.
Shared tenants also cannot see their own slice. OpenAI’s footnote says availability is “reported at an aggregate level across all tiers, models and error types. Individual customer availability may vary depending on their subscription tier as well as the specific model and API features in use.”
Providers fail too. The usual fix is a gateway that falls back to a second provider or a lab. With two providers and independent failures, the pair reaches 99.99993%. Independence is the weak assumption: two hosts can share a cloud region or a model bug.
Google’s SRE book, from 2016, makes a fair point about targets: “a user on a 99% reliable smartphone cannot tell the difference between 99.99% and 99.999% service reliability!”
If you run agents, every step of a loop is a call in series. A task with 30 model calls meets the API 30 times. One failed call can sink the task, so per-task success sits below the per-call uptime. Measure task success, then compare it with the status page.
A gateway fallback fixes outages and can break long agent runs
Gateways make fallback a setting. OpenRouter’s docs: “The models parameter lets you automatically try other models if the primary model’s providers are down, rate-limited, or refuse to reply due to content moderation.” Its allow_fallbacks flag defaults to true: “Whether to allow backup providers when the primary is unavailable.”
LiteLLM does the same on your own proxy. “If a call fails after num_retries, LiteLLM falls back to another model group, so a failing model or provider automatically fails over to a healthy backup.” Vercel’s AI Gateway docs list model fallbacks, provider timeouts and uptime pages in the same menu.
For a one-shot chat request, this is close to free reliability. For a long agent run it has a catch. LiteLLM warns that a fallback to another provider “cannot decrypt the encrypted reasoning the failed deployment produced on earlier turns”. The agent keeps going, but it has lost the thinking it did before the switch.
The cache is lost too. A later section shows that each model, and often each host, keeps its own prompt cache. A fallback in the middle of a session pays to read the whole history again on the backup.
Retries add their own cost. OpenAI’s error guide tells you to “disable SDK retries or account for them in those limits so nested retry loops don’t multiply requests.” Anthropic’s SDK already retries twice by default. An agent framework that retries on top of the SDK, inside a loop of 30 calls, can turn one overloaded minute into a flood of requests.
So set fallback deliberately. Decide which calls may switch provider and which must finish where they started. A classifier call can move freely. A planning turn with encrypted reasoning should retry on the same host first, then fail the step cleanly if the host stays down.
LangChain makes a related design argument: “An effective model router belongs in the harness, not a generic gateway”, because the harness already holds the task context. The same logic applies to fallback.
If you run agents, write the policy down per call type. Then test it by killing the primary in staging during a long task. Check what the agent remembers after the switch, and what the backup charged to catch up.
Most requests don’t need a frontier model
Cost is the first reason teams leave the labs. Frontier models are more than many requests need.
LangChain tested this inside its own coding agent and published the result in October 2026. “Many tasks don’t need frontier intelligence,” the authors wrote. Their router sent 56% of threads to a balanced tier, 34% to a fast tier and only 10% to the top tier. Median cost per thread was $0.097 on fast, $1.50 on balanced and $2.88 on performance.
Against always using a top-tier model, routing “cut median cost per thread by 64% with no measurable change in quality.” Its p90 cost per thread fell 37%.
Vercel sees the same pattern across its gateway: “high-volume work goes to low-cost models, high-risk work stays on the frontier.” Revolut does it by modality: “route any image recognition to Gemini ... and keep GLM for the main task.” GLM handles text, so images go elsewhere.
A router can also be the small model itself. Distil Labs described a fine-tuned small model that escalates hard turns on its own: “at runtime it emits a single defer_to_larger_model call like any other tool.” The cheap model does the easy work and hands off the rest.
Routing has a hidden cost. Each model keeps its own prompt cache, so every switch pays to reread the conversation. Cursor’s August 2026 guide on routing says it counts this: it includes “the cache-miss cost of the routing decisions it makes in its reported savings.” It adds: “When you evaluate a router, ask whether its numbers are cache-aware. If they are not, they are likely overstating savings.”
LangChain puts the router in the harness, which knows the task and the step. A gateway sees one request at a time.
If you run agents, route by step type first. Planning, tool selection, summarising and code edits have very different needs. Decide routes at session boundaries where you can, so that a mid-task switch does not throw away a warm cache.
Control means steady latency and a model nobody retires

The second reason to leave is control. On a shared API, someone else decides how fast your requests run and how long your model exists.
Shared per-token APIs come with no latency promise. Together’s docs say: “Serverless performance is best-effort. For committed throughput and reliability guarantees, see provisioned throughput.” Fireworks puts its SLA only on reserved capacity: “Guaranteed throughput on serverless and on-demand models, backed by an SLA”, with “Throughput SLA and 99.9% uptime terms”. The SLA is a paid tier, and plain per-token access is best effort.
Dedicated capacity removes the neighbours. Fireworks says on-demand deployments give “Lower latency, higher throughput, and predictable performance unaffected by other users” and “No hard rate limits”.
The other half of control is time. Lab models get retired. Anthropic’s deprecation page: “As safer and more capable models launch, Anthropic regularly retires older ones.” Then: “Requests to retired models fail.” It commits to “at least 60 days’ notice before model retirement for publicly released models.” OpenAI’s page defines the end state: “Shutdown. The model no longer accepts requests through the standard API.”
Open weights you host can stay as long as you want. That matters when a model passes your evals and you want to keep exactly that behaviour.
Together’s dedicated inference page lists the reasons to switch in one place. “Better performance”, “No hard rate limits”, “Fine-tuned models” and “Cost-efficient at scale: DMI bills per-GPU-minute, which is cheaper at high utilization than serverless models (which bill per-token).” That is cost, control and customisation in a single list.
Baseten’s book adds the brake: “Only switch once there is a clear and immediate business need.”
If you run agents, retirement is a quiet risk. An agent’s prompts, tool schemas and evals are tuned to one model’s habits. Sixty days is enough to rerun evals if you have them. Without evals, it is a scramble. Keep a pinned open-weight fallback that passes your suite, so a retirement notice becomes a scheduled change.
Small fine-tuned models beat big ones on narrow tasks

The third reason is customisation. Open weights can be post-trained on your own data. Two cases come up again and again.
The first case is making a small model match a big one on one task. Distil Labs, which sells this service, published two examples in September 2026. Knowunity runs a task “at hundreds of millions of requests a month”. Moving it off Gemini 2.5 Flash Lite to a fine-tuned small model “cut inference cost 68% while accuracy went from 81% to 93%.” Linkup “cut cost 40%.” Distil’s method: “Your current frontier model then becomes the teacher”.
Research backs the direction for some tasks. A June 2026 arXiv paper by Christou and Tsoumakas is titled “Sub-Billion, Super-Frontier: Small Language Models Rival Zero-Shot Frontier LLMs on General and Literary Relation Extraction”. The title is the finding, for that task family.
The second case is a niche domain with private data. Harvey and Fireworks post-trained Kimi K3 for legal work. Fireworks reports: “Harvey Tenet scores 19.7% all-pass on LAB against 10.8% for base Kimi K3, and 11.3% on Lab Contracts against 9.3% for base Kimi K3”. That is about 9 and 2 points.
Fastino Labs did the same for medicine and finance. It argues that “The data that would most improve a model, whether filings, clinical notes, or internal financial metrics” sits inside companies. On a medical error benchmark it reports flag accuracy rising from 53.66% to 64.98%, a gain of 11.32 points.
All of these numbers come from the sellers or their customers. None is audited. All of them are narrow, repeated tasks.
How much data do you need to start? Distil says to “hand over 20 to 100 examples, or just the request and response logs you already keep.”
If you run agents, you already keep those logs. Every agent run leaves a trace of prompts, tool calls and outputs. The steps that repeat most, such as classifying a ticket or extracting fields, are the first to move to a small tuned model. Keep the frontier model for planning until your evals say otherwise.
The same model behaves differently on each host

Picking a provider comes down to three choices, made in order. First, pick the model. Second, pick the host. Third, choose a deployment mode: shared per-token billing or dedicated GPUs.
Baseten’s book draws the deployment line clearly. With shared inference, you “Send your traffic to a public API endpoint for a given model and pay per million tokens”. With dedicated, you “Rent GPUs and set up an inference service exclusively for your application, paying per hour of GPU time”. It also notes that shared versus dedicated “is not exactly the same conversation as closed versus open models”.
Your choice of host matters because identical weights do not yield the same outputs everywhere. Artificial Analysis states this in its Endpoint Accuracy Index method: “The same model served by different providers can behave differently depending on quantization, sampling defaults, context handling, token limits, prompt parsers and other endpoint-side configuration.”
OpenRouter’s docs agree on this point. “Providers can support various quantization levels for open-weight models.” They add: “Quantized models may exhibit degraded performance for certain prompts, depending on the method used.” Because of this, OpenRouter lets you filter providers by quantisation.
Moonshot, the team that trains the Kimi models, wrote about the issue when launching a vendor checking tool. “The more open the weights are, and the more diverse the deployment channels become, the less controllable the quality becomes.”
Context caps vary as well. For gpt-oss-120b, Artificial Analysis lists 131k tokens on most hosts, while Baseten, Nebius, and Scaleway sit at 128k. For GLM 5.3, one host caps the context at 262,144 tokens, whereas the others serve roughly one million.
Follow this order: shortlist models using your evals, test every candidate on each potential host, and then choose shared or dedicated based on volume. The next three sections walk through these steps.
If you run agents, pay close attention to the parser item in that list. Tool calls rely on the host accurately parsing the model’s tool format. A host with a slightly broken parser will look fine in chat, yet fail inside a loop. Always test tool calling on every host using your actual schemas before routing agent traffic to them.
Your own eval set picks the model
Public benchmarks test someone else’s workload, and your traffic will look different. Anthropic’s docs say: “Be task-specific: Design evals that mirror your real-world task distribution. Don’t forget to factor in edge cases!”
OpenAI’s guide makes the same point and names the common trap: “Vibe-based evals: Using “it seems like it’s working” as an evaluation strategy”. Its fix is to “Log everything: Log as you develop so you can mine your logs for good eval cases.” Your production traces then become the test set.
Scale matters more than perfection. Anthropic advises: “Prioritize volume over quality: More questions with slightly lower signal automated grading is better than fewer questions with high-quality human hand-graded evals.” A large batch of auto-graded examples from real traffic works better than a small pile of hand-checked ones.
Run that exact set across every candidate model. Next, run it across every host for your chosen model, since the previous section showed that hosts differ. Record the score, cost, and latency for each run.
If you lack an eval set, test on live users. Cursor’s August 2026 routing guide shares what it found: “In Cursor’s A/B tests across millions of requests, the Intelligence mode landed near a frontier model on user satisfaction at about 60% lower cost”. Anthropic’s eval docs also point to “A/B testing: Compare performance against a baseline model or earlier version” alongside implicit signals like “task completion rates.”
Running an A/B test takes longer and carries more risk than an offline eval, because real users hit the weaker option. Even so, it beats switching models on a hunch.
A good eval suite also protects you during upgrades. Providers might alter quantisation, labs might retire a model, or a new open model might show up next month. Any of these events is a good reason to rerun the suite.
For agent workloads, grade the entire task. An agent might recover from a bad tool call, which makes turn-level scores misleading. Measure whether the task completed, the total cost, and the number of calls required, as those three numbers show if a cheaper model actually saves money.
Cost per task can flip the price per token ranking
Price per token is the number on the pricing page. Cost per task is the number on your bill. They can disagree badly.
Artificial Analysis publishes both. It defines cost per task as “calculated using the model’s input, cache hit, cache write, reasoning, and answer token prices and the number of tokens used across evaluations”. As of 17 November 2026, four models shared a blended price of $4 per million tokens. Their cost per task ran from $1.27 to $10.02, a 7.9x spread. The difference is how many tokens each one spends to finish.
The ranking can flip. On the same page, GLM 5.3 is 46% cheaper per token than Kimi K3.1 Pro but 36% more expensive per task.
Open versus frontier looks like this on the index. Claude Opus 5.5 at max effort costs $10.04 per task and scores 59.1. Kimi K3.1 Pro at max effort, an open-weight model released on 23 October 2026, costs $3.68 per task and scores 46.5. That is 63% cheaper per task, at a lower score. Whether the lower score matters depends on your evals.
Cursor reports the same kind of number from production. Its routing modes cost “$4.63 per commit in Balance and $6.76 in Intelligence, versus $7.34 for an all-Opus 4.8 baseline.” Its advice: “Watch cost per unit of real work, not just cost per request.”
Where do teams start? OpenRouter’s rankings for the week to 16 November 2026 put DeepSeek V4.1 Flash first at 61.2 trillion tokens. Claude Opus 5.5 was sixth at 7.37 trillion. In the “Implementation” category, Opus 5.5 still took 25.6% of spend against 7.9% for Kimi K3.1 Pro. A December 2025 study of OpenRouter data found that “proprietary models still handle the bulk of coding assistance overall”.
If you run agents, compute cost per finished task from your own logs. Count every call in the loop, including retries and the calls that went nowhere. A model that takes 12 steps where another takes 8 has to be much cheaper per token to win.
One open model scored 78% to 104% depending on the host
Artificial Analysis now measures how faithfully each host serves a model. It runs the same suite on every endpoint and scores it against a reference it hosts itself. The suite mixes tool calling, hard reasoning and long-context retrieval. “Each endpoint result carries a 95% confidence interval computed from per-repeat variation”.
The spread is large for some models. For gpt-oss-120b, runs from 8 to 22 October 2026 put 16 endpoints between 78.2% and 104% of the reference. That is a 25.8 point spread for the same open weights. Google Vertex scored lowest, flagged below the reference. Together scored 81.1% and Groq 90.3%. Baseten scored 99.9%.
Other models are tighter. Kimi K3.1 Pro’s 18 endpoints ran from 97.1% to 101.2%, a 4.1 point spread. Moonshot gives hosts “early access to test models” before release and publishes a vendor checking tool.
That tool grew out of a real problem. Its older results, from November 2025, measured tool call schema accuracy for one Kimi model. Moonshot’s own API and Fireworks scored 100%. Parasail scored 87.14%, DeepInfra 86.91%, and stock vLLM 87.22%. Those numbers are a year old, so treat them as history. They show where hosts break.
Tool calling is where agents feel it. Moonshot’s post says: “Tool errors compound in agents; we catch them early.” The Artificial Analysis suite gives tool calling a third of its weight. Its listed failure causes include “Tool limits, tool-schema parsing & return formatting, context limitations”.
A cheap host with a broken tool parser is the most expensive host you can pick. You pay for every retry, and some tasks never finish.
If you run agents, check the endpoint index before you route a model, then run your own tool-calling evals on the host. Recheck after any change the host announces, such as a new quantisation. A drop from 100% to 87% in schema accuracy turns into many failed steps across a long task.
Teams graduate from lab API to shared API to dedicated GPUs
Teams usually follow a standard path. They start on a lab API, then swap to a provider’s shared, per-token API to run open models. Once volume and control demand it, they move to dedicated GPUs.
Baseten’s book describes this progression: “Most AI products start with pay-per-token APIs because the tradeoffs make sense while looking for product-market fit or in the early stages of growth.” Later on, “shifting AI products to dedicated deployments is essential for three reasons: Scale ... Specialization ... Orchestration”. It also warns that going dedicated “increases the floor of your monthly spend on inference.”
Billing math explains why teams end up on dedicated hardware. Fireworks notes: “Cheaper under high utilization. Unlike serverless models (billed per token), on-demand deployments are billed by GPU-second.” Together bills its dedicated hardware “per-GPU-minute”.
Supply is the catch. GPUs are scarce, and the newest ones go to the biggest buyers first. Baseten’s book points out: “Many cloud providers allocate the majority of in-demand GPUs to their largest customers on long-term reservations. You may need to work across multiple cloud providers to get the GPUs you need in the right regions.”
This scarcity forces you into commitments. AWS Capacity Blocks let you reserve GPUs for a future date, bookable “up to eight weeks in the future”, capped at 64 instances per block. “Capacity Block cancellations aren’t allowed.” As of 17 November 2026, Lambda sells its 16 GPU H100 clusters at $6.16 per GPU hour on terms lasting from two weeks to one year. Baseten’s book says that reserved blocks of “hundreds or thousands of GPUs are reserved for months or years at discounted rates.”
You can still try dedicated hardware without signing a term contract. Fireworks bills its on-demand deployments by the GPU second and provides a preemptible tier at “50% off the on-demand GPU rate”.
The cheapest first move is the stage one swap: take a single workload and replace a lab model with an open model on a shared API. In the week to 16 November 2026, an open model, DeepSeek V4.1 Flash, led OpenRouter by token volume.
If you run agents, start this swap on your highest-volume, lowest-risk step. Background summarising or log triage makes a much better starting point than the main planner. That way, you learn a provider’s quirks on tasks where a bad answer costs very little.
Long prompts stretch time to first token by up to 24x

Stage one is using a shared, per-token API for an open model. The first metric you notice is time to first token, or TTFT.
NVIDIA’s docs define the components: “Time to first token generally includes request queuing time, prefill time, and network latency. Longer prompts increase TTFT”. Those same docs explain the reason: “the attention mechanism uses the full input sequence to create the KV cache before generation begins.”
TTFT is never a single number. As Baseten’s book notes: “LLM total response time is generally a right-skewed distribution, where most times concentrate around a mode, but outliers can take significantly longer.” Because of this, “good performance work also focuses on reducing P90/P99 latencies”. Looking only at the median hides the slow requests that leave users waiting.
Prompt length shifts these numbers quite a bit. Artificial Analysis measures TTFT for gpt-oss-120b across three prompt sizes. At 1k tokens, the six hosts we pulled sit between 0.19 and 0.65 seconds. At 100k tokens they range from 1.10 to 8.74 seconds. Baseten climbed from 0.25 to 1.10 seconds, a 4.4x jump. Groq went from 0.19 to 4.51 seconds, which is 23.7x slower. CoreWeave moved from 0.65 to 8.74 seconds. All of them ran the same model with the same prompt.
Agent prompts sit at the long end of this scale. An a16z and OpenRouter study of data through November 2025 found that average prompt length grew about fourfold, “from around 1.5K to over 6K” tokens, while completions “nearly tripled from about 150 to 400 tokens”. The study also added that “Programming prompts are systematically longer and growing faster.”
Multi-turn sessions show a similar gap. On Artificial Analysis, multi-turn TTFT for gpt-oss-120b went from 0.13 seconds on Baseten up to 2.77 seconds on Google Vertex. Across five days, error rates ranged from 0.0% to 9.8%.
You should pick hosts based on the prompt sizes you actually send. A host that wins at 1k tokens can easily lose at 100k.
If you run agents, track TTFT at your actual context length, looking at p95 and p99 throughout the day. An agent carrying a 60k-token history pays that long-prompt tax on every single step. Ten steps at 4 seconds of TTFT means 40 seconds of dead time before a useful token even shows up.
Measure latency at both ends, and keep connections warm

When a request is slow, find out where. Baseten’s book splits it in two. You can measure “solely inference time”, the time on the GPU. Or you can take “an end-to-end measurement that accounts for network latency and any queue time.” Its rule: “When inference time is fast but end-to-end time is slow, turn your attention to infrastructure rather than model performance optimization.”
Some of that infrastructure is your own client. Baseten’s client code chapter gives a worked number: “In a high-performance system with a 300-millisecond P95 end-to-end latency SLA, a TLS handshake costs at least ten percent of that latency budget before inference even starts.” Its advice is to reuse sessions.
Most HTTP libraries do this if you let them. The HTTPX docs: “a Client instance uses HTTP connection pooling. This means that when you make several requests to the same host, the Client will reuse the underlying TCP connection”. Create one client and keep it. A new client per request pays the handshake every time.
On the server side, three things make TTFT jump.
The first is noisy neighbours. Baseten’s book lists the cons of shared inference: “Provider uptime caps product uptime, noisy neighbors” and “No control over latency, model quality, or rate limits”.
The second is cold starts. When a provider adds a replica, it has to start. Baseten defines it: “A cold start is the time it takes to spin up a new replica of a model.” The parts are GPU procurement, image loading, model loading and engine startup. Some engine compilations “often take several minutes”. Modal’s docs note that during a cold start, “inputs may spend more time waiting in a queue for a container to become ready”.
The third is a cold KV cache, which the next two sections cover.
An older measurement shows how much routing can matter. In September 2025, llm-d reported P90 TTFT of 0.542 seconds with cache-aware scheduling, against “over 31 seconds” with approximate routing and “over 90 seconds” with cache-blind routing. It is a year old and from a project that builds this routing, but the gap is wide.
If you run agents, log TTFT on the client and ask the provider for server-side timing where it offers it. The difference tells you whether to fix your code or change your host.
Agents resend their history, so cache hit rate sets the bill
Chat APIs are stateless. OpenAI’s docs: “While each text generation request is independent and stateless, you can still implement multi-turn conversations by providing additional messages”. Every turn, the client sends the whole conversation again.
Agents pay for that more than anyone. Manus, writing in July 2025, said its “average input-to-output token ratio is around 100:1”. Its view: “the KV-cache hit rate is the single most important metric for a production-stage AI agent.” The post is older, but the ratio explains why.
Prompt caching makes the repeat cheap. If the start of a prompt matches a recent one, the provider reuses the stored attention state and skips that work. OpenAI’s agent example shows it: request one sends 12,000 input tokens with none cached. Request two sends 15,000 with “cached_tokens”: 12000. OpenAI adds that “An example deployment using these principles reported a token cache-hit rate >90%.”
The usage fields tell you what you got. Anthropic reports cache_creation_input_tokens, cache_read_input_tokens and input_tokens. OpenAI reports usage.input_tokens_details.cached_tokens, rounded down to a multiple of 128.
Small drops in hit rate cost a lot. As of 17 November 2026, Anthropic prices Opus 5.5 input at $4 per million and cache reads at 0.05x, or $0.20. At a 99% hit rate, input costs $0.238 per million. At 90% it costs $0.580, a 144% rise. At zero hits it costs 16.8x the 99% case. Anthropic’s own worked example for an Opus 5.5 session goes from $0.58 without caching to $0.428 with 40,000 of 50,000 input tokens read from cache.
Other models use a 0.1x multiplier. Five-minute cache writes cost 1.25x base input.
Baseten’s book gives the rule for prompt layout: “ensure that novel tokens are as late in your context as possible.” Put the system prompt and tools first and the new turn last.
If you run agents, track hit rate per session and per step type. Keep the system prompt and tool list byte-stable. A timestamp at the top of the prompt, or tools that reorder, will zero the cache on every call.
Switching models in a session throws the cache away

A cache belongs to one model. Claude Code’s docs say it directly: “Each model has its own cache. Switching with /model means the next request reads the entire conversation history with no cache hits, even though the content is identical.” Claude Code asks you to confirm a switch “only while the cache is still warm”.
Cursor gives the same warning: “Switching AI providers or models in the middle of a chat can increase token usage, since the new provider doesn’t have the previous chat steps in cache and must process them as new input.”
The reason is physical. The cached keys and values come from that model’s own weights and layers, so they cannot move to another model. OpenAI’s settings table notes “A different model can use different weights and caching behavior.” vLLM’s prefix cache hashes blocks with values such as “LoRA IDs”, so even a different adapter on the same base model gets its own cache.
Caches also live on machines. OpenAI’s docs: “Cached states live on individual machines, where traffic above 15 requests per minute can lead to overflow routing.” Its advice: “For busy groups, aim for about 15 requests per minute in total across all prefixes using each key.” Baseten’s book says a user in a long session “should have their request routed to the same replica whenever possible so that they get a cache hit”.
Hosts differ a lot. Artificial Analysis measures the share of cacheable input actually served from cache during multi-turn agent sessions. For gpt-oss-120b, as of 26 October 2026, it ranged from 0.5% at Novita and 13% at Google Vertex to 86% at Baseten and 99% at Crusoe.
Other settings break the cache too. Anthropic’s docs: “Changing thinking parameters (switching modes, or changing the budget in extended mode) invalidates cached message prefixes”. OpenAI routes on “A hash of the initial tokens after the hidden OpenAI content, including tool definitions when present”, so changing the tool list changes the route.
There is a signal hidden here. If your hit rate looks steady but p95 latency spikes, traffic may be landing on fresh replicas. That reading is ours, built from how the routing works. It is an early sign you need capacity you control.
If you run agents, pick hosts on measured hit rate as well as price. Use a stable cache key per session. Raise effort or switch models at session boundaries.
A 429 means slow down, and a 529 means everyone is waiting
Once traffic grows, errors tell you when a shared API is too small. Two kinds matter.
A 429 is your limit. OpenAI’s guide: “When a request exceeds a temporary rate limit, the API returns a 429 error.” Read the Retry-After header first. “If it’s missing or invalid, fall back to exponential backoff with jitter. Limit both the number of attempts and the total time spent retrying.” Together says to “Spread requests out over time and avoid sending large bursts.”
A 503 or 529 is the provider’s limit. Anthropic’s 529 is an “overloaded_error”: “The API is temporarily overloaded.” It “can occur when the API experiences high traffic across all users.” OpenAI’s 503 reads “Model temporarily overloaded”. Retrying an overload error hard only adds to the pile, so cap retries and fail over.
Limits are counted in different units. OpenAI uses requests and tokens per minute and per day. Anthropic counts requests per minute, input tokens per minute and output tokens per minute. Its “default ITPM rate limits count only uncached input tokens”, and cache reads “Do NOT count toward ITPM”. Groq says: “Cached tokens do not count towards your rate limits.” Fireworks tracks total prompt, uncached prompt and generated tokens separately.
The way limits grow differs too. OpenAI and Anthropic raise them with spend tiers. Fireworks adapts: “If your recent one-minute usage is above 50% of your current limit, the limit increases by 25%, and no more than once every 15 minutes, until it reaches your base ceiling.” It drops by 20% when usage falls. After four steps, about an hour, the limit is 2.44x where it started.
DeepInfra caps concurrency only: “every account has a default limit of 200 concurrent requests per model.” Its own table shows what that means. One second requests get 12,000 per minute. Sixty second requests get 200.
If you run agents, two of these rules work in your favour and one against. Cached input does not count against Anthropic or Groq limits, so a stable prefix buys headroom as well as savings. A concurrency cap punishes long agent turns, which hold a slot for the whole call. Count SDK retries inside your retry budget.
Dedicated wins once your hourly token bill passes the node price
Shared endpoints slow down when everyone else is busy. Together: “Response times can vary depending on the model and current demand.” Anthropic calls its standard tier “best-effort availability” and sells a Priority Tier that “helps minimize “server overloaded” errors , even during peak times.”
Demand moves through the day. DeepSeek described this in March 2025 for its own service, “due to high service load during the day and low load at night”. Its peak was 278 nodes against an average of 226.75. We found no first-party hourly latency series for shared APIs, so measure your own through a full day.
When the errors and the drift add up, do the break-even maths. Dedicated pays once your per-token bill per hour passes the node’s hourly price. In tokens per minute: break-even TPM equals node dollars per hour, divided by blended dollars per million tokens, times one million, divided by 60.
Two examples at current public prices, as of 17 November 2026, at three input tokens per output token:
gpt-oss-120B on Together’s shared API blends to $0.2625 per million. One dedicated H100 costs $5.49 per hour. Break-even is about 348,571 tokens per minute.
Kimi K3 on Together blends to $6.00 per million. A 16 GPU B200 replica costs $148.64 per hour. Break-even is about 412,889 tokens per minute.
Both assume the node can actually serve that rate. We did not measure that.
Caching moves the answer for agents. Take the same Kimi K3 node with an agent-like mix: 100 input tokens per output token, 90% of input cached at $0.30 per million, the rest at $3.00, output at $15. Our blended price falls to about $0.71 per million, and break-even rises to about 3.48 million tokens per minute, 8.4x higher. This is our hypothetical mix, and it ignores that dedicated nodes can cache prefixes too.
Baseten’s book names the trigger: “You are processing enough volume of traffic that it’s more economical to pay per GPU than per million tokens.”
If you run agents, cached pricing keeps you on shared APIs longer than the headline price suggests. You will often move to dedicated for steady tails and no rate limits before price alone tips it. Write down which of the two is driving the move.
A model’s weights decide how many GPUs one copy needs

Stage two starts with sizing. The model’s weights decide the smallest node that can hold one copy.
Small models fit on one GPU. OpenAI’s model card says gpt-oss-120b suits “use cases that fit into a single 80GB GPU (like NVIDIA H100 or AMD MI300X) (117B parameters with 5.1B active parameters)”. The card is from August 2025 and is still the current card.
Large models need several nodes. Moonshot’s card for Kimi K3 lists “Total Parameters 2.8T Activated Parameters 104B”. The weights on Hugging Face take 1,453.8 GiB. One 8x B200 node has 1,440 GiB of memory, so the weights alone do not fit. SGLang’s recipe says node count “follows the hardware recipe (B200 2×8, GB200 4×4, H100 4×8, B300 1×8, H200 2×8”. vLLM’s recipe asks for “At least 8x GB300. Multi-node for real production traffic.”
As of 17 November 2026, Together lists B200 at $9.29 per GPU hour and Baseten at about $9.98. One Kimi K3 replica on 16 B200s costs $148.64 per hour on Together and $159.68 on Baseten, before any spare replica.
Memory left after the weights is what serves users. That space holds the KV cache, the stored attention state for every token of every active request. A node that just fits the weights can hold almost no requests.
Revolut’s speaker hit this. “Even though GLM fits on TP4, you don’t have enough KV cache, and so maybe a TP8 works better.” TP4 and TP8 mean splitting the model across four or eight GPUs.
Precision is the other lever. Baseten’s book says one level of quantisation “generally offers 30 to 50 percent better performance for LLMs”, and sets the bar: “The standard for production-ready quantization is zero perceptible quality loss.” Run your evals before and after.
If you run agents, size for the KV cache first and the weights second. Agent contexts are long and sessions stay open. The next two sections show how fast that eats memory.
Every deployment trades per-user speed for total throughput

Every deployment sits on a curve. SemiAnalysis defines the two axes. “Interactivity (tok/s/user) describes how fast each user of a system receives tokens”. It is the inverse of time per output token. “Throughput (tok/s) describes how many total tokens a system can crank out across all users.”
The trade comes from how decoding works. The vLLM blog explains: decode “produces one token at a time and what holds it back is how fast the GPU can read the model weights from memory”. Each step reads the weights once. Batch more users into that step and one read serves them all, so total throughput rises. Each user waits a little longer. Baseten’s book: “Batch sizing trades off latency for throughput.”
Speed costs more than it looks. SemiAnalysis measured DeepSeek R1 on B200 in February 2026. “At an interactivity of 50 tok/sec/user, inference cost is approximately $0.56/M output tokens. At an interactivity of 125 tok/sec/user, this rises to around $4/M output tokens, a 2.5× speed increase for a ~7× price increase”.
The far end of the curve is extreme. In August 2026 SemiAnalysis compared TileRT, built for top per-user speed, with a standard GB300 setup. TileRT reached 340 tokens per second per user at 160.4 tokens per second per GPU. The standard setup gave 154 per user at about 240 per GPU. More speed for each user, less work per GPU.
Chips also differ most at some speeds and barely at others. SemiAnalysis found that “At a fixed interactivity level of 60 tok/s/user, each GB200 NVL GPU produces slightly less than triple the number of tokens/s than each B200 does.” Yet “At 130 tok/s/user, the GB200 NVL72 has nearly no advantage”. Between H100 and GB200 NVL72 it saw “up to 55x realized performance difference at 75 tok/s/user.”
So compare hardware at the speed your users need. A benchmark at a speed nobody uses tells you little.
If you run agents, pick your point on the curve per workload. A user watching a chat needs speed per user. An agent running in the background mostly needs throughput, since nobody reads its tokens as they stream. Revolut found 200 tokens per second “fine”. Do not pay 7x for speed nobody watches.
Long contexts fill GPU memory before the weights do
The KV cache is the memory a model keeps for every token of every active request. It grows with context length and with the number of users.
NVIDIA’s formula from 2023 still holds: “Size of KV cache per token in bytes = 2 * (num_layers) * (num_heads * dim_head) * precision_in_bytes”. Multiply by tokens per request and by concurrent requests to get the total.
The vLLM blog gives a worked number. For Qwen2.5-7B, each 8k prompt holds “~470 MB of KV cache (56 KiB per token for Qwen2.5-7B)”. We recomputed it from the model config and got the same.
How much memory is left for it? Baseten’s book gives an example: “If you’re working on a B200 GPU with 180 GB of VRAM and used 100 GB for model weights and buffers, this would allocate 80 percent of the remaining VRAM, or 64 GB, to KV cache.”
Now apply it to gpt-oss-120b. Its config has 18 full attention layers, 18 layers with a 128-token sliding window, 8 KV heads and a head size of 64. With a 16-bit cache, that is 36,864 bytes per token by our maths. In 64 GB that holds about 209 requests at 8k tokens, 53 at 32k and 13 at 128k.
The same GPU serves 16 times fewer users when contexts grow 16 times longer. That is why Revolut capped context at 256K on a model that can do one million. “Long context is a scam,” Abitbol said, meaning most work does not need it.
Prompt caching keeps this same memory. A warm prefix saves compute but holds memory while it waits, and engines evict old prefixes when space runs out.
PagedAttention, the 2023 design behind vLLM, pages this memory in blocks, because older systems suffered “fragmentation and redundant duplication, limiting the batch size.”
If you run agents, measure the context your agents actually use at p50 and p95. Cap it near p95, and compact or summarise history past that. Every extra 100k tokens you allow in one session is memory taken from other users.
Prefill sets first-token time and decode sets reading speed

Inference runs in two phases. The vLLM blog explains: “Prefill reads the whole prompt in one pass, is limited by compute and sets your time to first token (TTFT).” Next, decode generates tokens one by one. Memory bandwidth limits this step and sets your inter-token latency. Baseten’s book uses the same division, noting that TTFT is “Based on compute-bound prefill” while output speed is “Based on bandwidth-bound decode”.
NVIDIA’s 2023 guide points out that “Many of the inference challenges and corresponding solutions featured in this post concern the optimization of this decode phase”. The drafters covered in the upcoming sections also focus on decode.
When these two phases share a GPU, they compete for resources. One long prefill will stall decode for every other request in the batch. You can fix this through disaggregation, which means running the phases on separate GPU pools.
The vLLM blog benchmarked this setup in September 2026 using Qwen2.5-7B across two L40S GPUs. At 0.4 requests per second, p99 inter-token latency was 169 ms collocated against 29 ms with prefill and decode split. Once prefills stopped interrupting the decode phase, token generation ran smoothly.
That split comes at a cost. Without peer-to-peer transfer, copying the KV cache between pools added roughly 1.3 seconds for an 8k prompt, causing the disaggregated setup to miss a 2 second TTFT target. The post’s summary puts it plainly: “With no latency target, splitting the same GPUs into prefill and decode pools won’t necessarily move more tokens per second.” It also notes: “Collocated is still the right answer for plenty of deployments.”
A July 2026 paper on load-aware scheduling hit the exact same bottleneck. In its tests, “prefill execution accounts for only 2-23% of P95 Time-to-First-Token (TTFT). Queuing and inter-node GPU-GPU KV-cache transfer account for the rest.”
Baseten’s book gives a rough threshold for when disaggregation makes sense: “starting at one hundred million to one billion tokens per day depending on model size”. Most stage two teams have not hit that volume yet.
If you run agents, your long prompts create heavy prefills and large KV transfers. This makes splitting pools more attractive, though it also increases the transfer penalty. Before adding a second pool, measure TTFT and inter-token latency separately using your actual prompt sizes. If you do not have a strict latency target, disaggregation just buys you extra complexity.
Start from the latency target, then set the autoscaler

You have to size systems backward. Baseten’s book opens with a core rule: “Every inference engineering decision you make will be downstream of your use case.” Start with the use case and its latency target. Next, pick the smallest model that passes your evals. After that, find your spot on the speed and throughput curve. Scaling settings come last.
Everything hangs on the latency target. In 2025, SemiAnalysis pointed out that benchmark wins at very low speeds do not matter much: a win there “has little real-world significance”, and “a realistic interactivity level should be chosen for the given applications.” Similarly, the 2024 DistServe paper tuned GPU allocation directly from “the application’s TTFT and TPOT requirements”.
Next comes the autoscaler. Baseten’s docs show cautious default values: 0 minimum replicas, 1 maximum replica, a 60-second autoscaling window, a 900-second scale-down delay, a concurrency target of 1, and a 70% target utilisation. They describe that 70% mark as “Headroom before scaling triggers.”
The docs walk through the math with an example. Set the concurrency target to 10 and utilisation to 70%, and each replica handles 7 requests; at 25 concurrent requests, the autoscaler asks for 4 replicas. Modal offers the exact same controls under the names min_containers, max_containers, buffer_containers and scaledown_window.
Every setting trades money against latency. Setting minimum replicas above zero stops cold starts, though you pay for idle machines. A maximum replica limit caps your bill, yet it might throttle traffic during a spike. A long scale-down delay preserves warm caches while running up the meter.
Baseten’s book also cautions against a common shortcut. Maybe you have light, unscheduled, latency-sensitive traffic, and you need to scale to zero just to afford it. For them, this is “probably a sign that your AI application is not yet ready for dedicated infrastructure and should use pay-per-token APIs until greater scale is reached.”
The book also points out a specific trap for agents. “In LLM prefill, a few requests with hundreds of thousands of uncached input tokens could cause much higher utilization than many small requests with high cache hit rates.”
For agent workloads, you should scale on both utilisation and request count, since a single long cold prompt can max out a replica. Put cache-aware routing in place so follow-up calls from a session hit the replica still holding that prefix. Finally, keep at least one replica warm through working hours.
A small drafter guesses and the big model checks in one pass
Decode makes one token per pass over the weights. Speculative decoding makes several.
A small, fast drafter proposes a few tokens. The big target model checks all of them in one forward pass. CoreWeave’s docs describe it: “Accepted tokens are returned together. Rejected tokens are discarded and generation continues from the last accepted token, so the output distribution is unchanged.” vLLM calls the sampling “theoretically lossless up to the precision limits of hardware numerics.”
Baseten’s book: “If you imagine a sudoku puzzle, solving it is hard, but checking if the solution is correct is very easy.” One pass yields “N+1 tokens per forward pass”, where N is the number of accepted draft tokens. The idea goes back to a 2023 paper by Leviathan and colleagues, which showed “a 2X-3X acceleration compared to the standard T5X implementation, with identical outputs.”
It pays only when drafts get accepted. CoreWeave warns that “A low acceptance rate makes decoding slower than no speculation at all”. Its advice is to “measure acceptance on your own traffic before you keep a configuration.”
Acceptance falls along the draft: after one wrong token, “all subsequent tokens in the sequence are also rejected.” A vLLM post from August 2026 measured this on DeepSeek-V4-Pro: “the last drafted token of a 7-token block survives less than 10% of the time, against more than 70% for the first.”
The llama.cpp docs give the maths. Each later token is accepted with a constant probability p, so the expected gain flattens. At p of 0.7, drafting 3 tokens gives 2.53 tokens per pass by our calculation. Drafting 7 gives 3.14. Drafting 15 gives only 3.32. Longer drafts cost more to verify and add little.
If you run agents, start short. Log acceptance per step type. A planner writing free text accepts fewer drafts than an agent rewriting a file. Keep speculation where acceptance stays high.
Drafters now read the target model’s hidden states

Drafters come in three kinds.
The first is a small model from the same family. Baseten’s book: “Draft models are most often smaller members of the same family as the target model, as they share tokenizers and behaviors. As a rule of thumb, the draft model should be at least ten times smaller by parameter count than the target model.”
The second kind reads the target’s own hidden states. “EAGLE is a draft model trained to accept hidden states as input and generate speculative tokens as output.” Newer designs draft a whole block at once. llama.cpp describes DFlash: it “produces an entire block of draft tokens in a single forward pass (block diffusion) and injects the target model’s hidden states into the draft model’s attention”. The DFlash paper reports “over 6x lossless acceleration” and “up to 2.5x higher speedup” than EAGLE-3. Those are the authors’ own results.
The third kind needs no model. Baseten: “N-gram speculation uses a different mechanism than other types of speculation. There is no draft model.” It looks for repeats in the text so far. vLLM’s docs sum up the trade: model-based methods “provide the best latency reduction, while simpler methods such as n-gram and suffix decoding provide modest speedups without increasing workload during peak traffic.”
Providers expose all this differently. On dedicated deployments it is usually a setting. CoreWeave: “you configure speculative decoding through the engineConfig map of a deployment.” Friendli offers a draft model and an n-gram toggle on dedicated endpoints.
Some let the caller pass a guess per request. OpenAI’s Predicted Outputs takes a prediction parameter, and “any tokens provided that are not part of the final completion are still charged at completion token rates.” Fireworks offers the same idea and says “Predicted Outputs is configured per request and can work alongside the model-based speculative decoding configured on a dedicated deployment.”
Drafters now ship with models. CoreWeave’s Kimi K3 example “pairs Kimi K3 with a DSpark draft model on 16 GB300 GPUs.”
If you run agents, two things matter. Long contexts used to break drafters: the EAGLE 3.1 post says older drafters degrade “under different chat templates, long-context inputs, or out-of-distribution system prompts”, and reports “up to 2× longer acceptance length” in long contexts. And on hosted APIs, a wrong guess may still be billed, so price rejected tokens before you lean on predictions.
Speculation pays at low batch and fades as the batch fills
Drafting uses spare compute. When the GPU is busy with many users, there is less to spare.
Baseten’s book is blunt: “At higher batch sizes, speculative decoding must be dynamically disabled as compute is too saturated to afford verification.” Modal’s docs say that for high throughput jobs “speculative decoding is generally a bad choice, since it harms performance in the high throughput regime.” vLLM’s docs say it helps “under medium-to-low QPS (queries per second), memory-bound workloads.”
The numbers show the fade. The EAGLE 3.1 team tested Kimi-K2.6 on GB200 with a coding set in May 2026. It reported “2.03× higher per-user output throughput at concurrency 1”, with “1.71× at C=4, 1.66× at C=16”. The gain shrinks as users join, and stays real at 16.
The rule is weakening in 2026. The August DSpark post found that at batch 256, “Draft tokens now compete with real tokens for the same compute, and every rejected token wastes useful compute”. With adaptive verification, though, “speculative decoding is able to provide benefits all the way to concurrency 256”. DeepSeek’s production result: DSpark “accelerates per-user generation speeds by 60 to 85 percent at matched throughput levels” against its earlier baseline.
Results vary a lot by model. A vLLM post on AMD GPUs reported “2.87× for DFlash on gemma-4-26B-A4B-it” at the top of its range, and that “some settings produced smaller changes or throughput below the non-speculative baseline”. All of these are the authors’ own results.
One thing never improves. Baseten: “Speculative decoding only improves TPS/ITL, not TTFT.”
So speculation fits dedicated capacity at low to medium load best. On a busy shared batch the provider may turn it down. That is one more control you gain in stage two: you choose when the drafter runs.
If you run agents, the fit is mixed. Background agents usually run in big batches for throughput, where drafting helps least. Interactive coding agents with one user waiting sit at low concurrency, where it helps most. Turn it on per deployment, and measure at the concurrency you actually run.
Code edits are the best case for speculation

Code is where drafting works best. When a model edits a file, most of the output repeats the input.
Baseten’s book: “N-gram speculation is mostly used for code completion and code revision, where syntax is predictable and output closely matches input. However, within this specific domain, it easily outperforms EAGLE.” OpenAI says Predicted Outputs suits the same job: “This is most common when you are regenerating a text or code file with minor modifications.” llama.cpp names it as a use case: “the rewriting of source code by a LLM.”
A laptop test from February 2025 shows the gap. LM Studio ran the same model pairs on different prompts. A code prompt sped up 2.43x on Apple’s MLX; a trip plan sped up 1.71x on MLX and only 1.05x on CUDA. The numbers are from an older release, so read them as direction only.
Code is not always easy to guess. The vLLM AMD post warns: “Code contains predictable local structure, but formatting, identifiers, and implementation choices can cause an otherwise plausible continuation to diverge.” New code from scratch looks more like prose. Edits to existing code look like copying.
The llama.cpp docs publish sample acceptance stats that show the range. A draft model accepted 98 of 110 tokens, or 89%. One n-gram variant accepted 730 of 960, or 76%. The simplest n-gram mode accepted 73 of 187, or 39%. The method matters as much as the content.
Agent loops repeat themselves in another way too. The AMD post lists future work on “n-gram speculation and suffix decoding, particularly for workloads with repeated token patterns such as code editing and agentic loops.” vLLM’s docs describe suffix decoding as needing “No extra draft model” and matching “against prior responses too”.
That fits agents that call the same tools with similar arguments, or write similar summaries each step. The drafter learns the agent’s own habits from what it already said.
If you run agents that edit code, try a no-model drafter first. It costs no extra GPU memory. Measure acceptance on real edit tasks, then compare it with a model drafter. On file rewrites, the cheap method often wins.
Engineers will own the inference decisions
Every lever in this edition is a backend choice. The same engineers who run the rest of the service end up owning routing, caching, retries, autoscaling and sizing.
The field is young. Baseten’s book says: “There are relatively few people working on inference, and newcomers can become experts quickly.” Modal’s guide points out the knowledge gap: “LLM inference is in many ways quite different to the web serving and database workloads that engineers are used to deploying and optimizing.”
You can learn most of this from free material. Baseten’s book is free to read online, and Modal publishes a GPU Glossary. For a single overview of chunked prefill, prefix caching, speculative decoding and split prefill and decode, read the vLLM blog’s “Inside vLLM” post from September 2025.
Start by understanding the KV cache. It dictates TTFT, memory, concurrency and your final bill. As of 17 November 2026, Anthropic prices cache reads at 0.1x base input on most models, dropping to 0.05x on Opus 5.5 and Sonnet 5.5.
Treat evals as the unit tests of an LLM workload. Anthropic’s January 2026 post on agent evals explains the payoff: “When more powerful models come out, teams without evals face weeks of testing while competitors with evals can quickly determine the model’s strengths, tune their prompts, and upgrade in days.” Once those evals are in place, the post adds, “latency, token usage, cost per task, and error rates can be tracked on a static bank of tasks.” OpenAI recommends running continuous evaluation “on every change”.
Some workloads still need GPUs you control, real-time voice most clearly. Pipecat reports that its agents hit “voice-to-voice latency as low as 500 ms, by hosting all models within the same GPU-enabled cluster”. It considers 1,500 ms “an important target to aim for.” Using models served on vLLM, a March 2026 tutorial clocked time to first audio at 755 ms.
Track your tool calls alongside your tokens. Anthropic’s tool guide notes a basic constraint: “Each tool call requires a full model inference pass.” Batching 20 tool calls inside a single code block can “eliminate 19+ inference passes”. In its test, that change dropped average usage by 37%, from 43,588 tokens down to 27,297.
If you run agents, put three metrics on your dashboards this month: cache hit rate, tool calls per task and cost per finished task. Those three surface most of the waste in this edition.
Agent sessions are mostly cache reads, and cache prices keep falling

Look at where an agent’s tokens go and one category dominates. Claude Code’s cost docs show an example session: 1.2k input tokens, 5.3k output, 940.0k cache read and 50.0k cache write, for $0.55. Cache reads were 94.8% of the input.
Independent logs say the same. In a November 2026 post on tuning a fleet of coding agents, Alex Marquardt found that “Cache reads dominate the token count: 94 to 98% of all tokens in this fleet, because every call re-reads the conversation so far.” Weighted by price, cache reads were “about three quarters of the cost” before his changes. Another public write-up found a median Claude Code run used 79.8 million tokens, with 97% cache reads. These are individual measurements, not lab data.
So the cache read price runs agent economics. Labs keep cutting it. On Anthropic’s pricing page, cache reads for Opus 4.1 cost $1.50 per million. Opus 4.5 through 5 cost $0.50. Opus 5.5 costs $0.20, an 86.7% cut across those generations. Fable 5 cache hits cost $1, and Fable 5.1 cost $0.25. OpenAI’s cached input went from $1.00 on gpt-6-astra to $0.40 on gpt-6.2-astra. Prices as of 17 November 2026.
Why can vendors cut so far? A cache read skips the prefill compute. DeepSeek published its own numbers in March 2025, now older and self-reported. Of 608 billion input tokens in a day, “342B tokens (56.3%) hit the on-disk KV cache.” It computed a theoretical margin of 545%, and said actual revenue was lower than that.
Self-hosting keeps this saving in your own hands. vLLM’s automatic prefix caching “caches the KV cache of existing queries, so that a new query can directly reuse the KV cache if it shares the same prefix”. MLX LM does it on a laptop.
The monitoring is simple. OpenAI’s docs: “Track the token cache-hit rate by dividing total cached tokens by total input tokens”. Claude Code now prints it, for example “91% of input tokens from cache · 2 misses”, and names a likely cause for each miss.
If you run agents, your bill is mostly the cache read price times your history length. Shorten the history, keep the prefix stable and watch the hit rate daily.
Three experiments you can run on a laptop

You can see every effect above on a laptop with open-source tools. llama.cpp aims for inference “with minimal setup and state-of-the-art performance on a wide range of hardware”, locally and in the cloud. MLX LM runs and fine-tunes models “on Apple silicon with MLX”. LM Studio wraps both.
Experiment one is a cold versus warm cache. Load a small open model in MLX LM or llama.cpp. Send a prompt with a long fixed prefix, such as a 20k-token document plus a question. Time the first token. Send the same prefix with a new question and time it again. MLX LM’s docs note that “Prompt caching can also be used in the Python API in order to avoid recomputing the prompt.” The second request should skip most of the prefill. Then change one word near the top of the prefix and watch the saving vanish. That is what a timestamp in an agent’s system prompt does to you on every call.
Experiment two tracks hit rate as a metric. Run a short scripted agent loop for 20 turns against any API that reports cached tokens. Divide cached tokens by input tokens per turn, as OpenAI suggests. Then add a tool to the tool list halfway through and watch the ratio drop.
Experiment three adds a drafter. In LM Studio, load a target model and “simply provide a draftModel parameter when performing the prediction. You do not need to load the draft model separately.” Pick a draft from the same family, at least ten times smaller. Compare tokens per second on a code rewrite and on a travel plan. LM Studio’s own older test found 2.43x on code and as little as 1.05x on prose. Then estimate acceptance with the llama.cpp formula: at p of 0.7, 3 draft tokens give about 2.53 tokens per pass.
Label whatever you measure as your own run, with your hardware and model. Results move with chip, model size and prompt.
Measure the cache before you move a single workload
The order that falls out of all this is short. Measure cost per finished task and cache hit rate on today’s lab API. Build an eval set from your logs. Swap one high-volume, low-risk step to an open model on a shared API, on a host that passes your tool-calling evals. Move to dedicated GPUs when tails, rate limits or the break-even maths say so, with caching counted. Then tune the node: context cap, KV headroom, autoscaler, drafter.
If you run agents, each step above is cheaper to get right before the traffic moves than after.
What to ask your team
The risk: lab APIs showed 99.76% uptime or less on their own pages, and one open model scored from 78% to 104% depending on the host. A cheap endpoint with a broken tool parser fails agent tasks quietly.
The cost: on Opus 5.5 prices, a cache hit rate falling from 99% to 90% raises input cost 144%. Public agent logs show 94% to 98% cache reads.
What is our cache hit rate per agent, and who gets paged when it drops?
What does one finished task cost on our current model, and on the best open model that passes our evals?
At what tokens per minute does a dedicated node beat our per-token bill, with caching counted?
Reply to this email with one number from your team: your agents’ prompt cache hit rate last week, and the model it was measured on. We will publish what readers send, without names, in a future edition.
Sources
Vercel, “Open weight takes 71.5% of tokens and 23% of spend”, 15 Oct 2026 (vercel.com)
Vercel, “Open-weight models surge to 29% of volume, price per token flattens”, 13 Jul 2026 (vercel.com)
AI Engineer, David Abitbol (Revolut), “Shipping like a startup, regulated like a bank”, talk transcript, 13 Oct 2026 (ai.engineer)
NVIDIA, “Leading Inference Providers Achieve Lowest Token Cost With Open Source Models on NVIDIA Blackwell”, 12 Feb 2026 (blogs.nvidia.com)
Together AI, “The AI Native Cloud”, homepage (together.ai)
Together AI, “OpenAI API compatibility” (docs.together.ai)
Together AI, “Rate limits” (docs.together.ai)
Together AI, “Dedicated model inference” (docs.together.ai)
Together AI, “Pricing” (together.ai)
Fireworks AI, “Pricing” (fireworks.ai)
Fireworks AI, “OpenAI compatibility” (docs.fireworks.ai)
Fireworks AI, “On-demand deployments” (docs.fireworks.ai)
Fireworks AI, “Serverless rate limits” (docs.fireworks.ai)
Fireworks AI, “Using predicted outputs” (docs.fireworks.ai)
Fireworks AI, “Introducing Ember-1”, 23 Sep 2026 (fireworks.ai)
Fireworks AI, “Post-training Kimi K3 with Harvey for long-horizon legal work”, 26 Aug 2026 (fireworks.ai)
Baseten, homepage (baseten.co)
Baseten, “Pricing” (baseten.co)
Baseten, “Autoscaling” (docs.baseten.co)
Philip Kiely, “Inference Engineering”, Baseten Books, 2026 (baseten.co)
Modal, homepage (modal.com)
Modal, “High-performance LLM inference” (modal.com)
Modal, “Cold start performance” (modal.com)
Modal, “Scaling out” (modal.com)
Modal, “GPU Glossary”, 2025 (modal.com)
Google Developers Blog, “Announcing new vLLM and SGLang inference engines on TPU”, 20 Oct 2026 (developers.googleblog.com)
Epoch AI, Cottier et al., “The rising costs of training frontier AI models”, 7 Feb 2025 (arxiv.org)
DeepSeek-AI, “DeepSeek-V3 Technical Report”, 18 Feb 2025 (arxiv.org)
DeepSeek, “Day 6: One More Thing, DeepSeek-V3/R1 Inference System Overview”, 1 Mar 2025 (github.com)
Fastino Labs, “Fastino Labs releases two specialized open-weight models for finance and healthcare”, 11 Aug 2026 (prnewswire.com)
OpenRouter, “GLM 5.3 endpoints”, live data read 17 Nov 2026 (openrouter.ai)
OpenRouter, “LLM Rankings”, usage through 16 Nov 2026 (openrouter.ai)
OpenRouter, “Model Fallbacks” (openrouter.ai)
OpenRouter, “Provider Routing” (openrouter.ai)
a16z and OpenRouter, “State of AI: An Empirical 100 Trillion Token Study”, Dec 2025 (openrouter.ai)
Artificial Analysis, “GLM-5.3 providers”, live data read 17 Nov 2026 (artificialanalysis.ai)
Artificial Analysis, “Comparison of AI models”, live data read 17 Nov 2026 (artificialanalysis.ai)
Artificial Analysis, “Endpoint Accuracy Index v1.1 Methodology” (artificialanalysis.ai)
Artificial Analysis, “gpt-oss-120b: API provider benchmarking”, live data read 17 Nov 2026 (artificialanalysis.ai)
Artificial Analysis, “Kimi K3.1 Pro: API provider benchmarking”, live data read 17 Nov 2026 (artificialanalysis.ai)
Claude, “Claude Status”, read 17 Nov 2026 (status.claude.com)
OpenAI, “OpenAI Status”, read 17 Nov 2026 (status.openai.com)
Atlassian, “Display historical uptime of components” (support.atlassian.com)
Google, “Site Reliability Engineering: Embracing Risk”, 2016 (sre.google)
LiteLLM, “Fallbacks (Provider Failover)” (docs.litellm.ai)
Vercel, “AI Gateway” docs (vercel.com)
LangChain, “How to Build a Model Router in the Harness”, 1 Oct 2026 (langchain.com)
Distil Labs, “Three ways to put a small model into production”, 2 Sep 2026 (distillabs.ai)
Christou and Tsoumakas, “Sub-Billion, Super-Frontier: Small Language Models Rival Zero-Shot Frontier LLMs on General and Literary Relation Extraction”, 21 Jun 2026 (arxiv.org)
Anthropic, “Model deprecations” (docs.claude.com)
Anthropic, “Create strong empirical evaluations” (docs.claude.com)
Anthropic, “Prompt caching” (docs.claude.com)
Anthropic, “Pricing” (docs.claude.com)
Anthropic, “Rate limits” (docs.claude.com)
Anthropic, “Errors” (docs.claude.com)
Anthropic, “Service tiers” (docs.claude.com)
Anthropic, “How Claude Code uses prompt caching” (code.claude.com)
Anthropic, “Manage costs” (code.claude.com)
Anthropic, “Demystifying evals for AI agents”, 9 Jan 2026 (anthropic.com)
Anthropic, “Introducing advanced tool use on the Claude Developer Platform”, 24 Nov 2025 (anthropic.com)
OpenAI, “Deprecations” (platform.openai.com)
OpenAI, “Evaluation best practices” (platform.openai.com)
OpenAI, “Conversation state” (platform.openai.com)
OpenAI, “Prompt caching” (platform.openai.com)
OpenAI, “Rate limits” (platform.openai.com)
OpenAI, “Error codes” (platform.openai.com)
OpenAI, “Predicted Outputs” (platform.openai.com)
OpenAI, “Pricing” (platform.openai.com)
OpenAI, “gpt-oss-120b” model card, Aug 2025 (huggingface.co)
Moonshot AI, “Kimi K3” model card, 2 Sep 2026 (huggingface.co)
Moonshot AI, “Rebuilding the Chain of Trust: Kimi Vendor Verifier” (kimi.com)
MoonshotAI, “K2-Vendor-Verifier”, results 15 Nov 2025 (github.com)
Cursor, “Model routing: right model, right job, right price”, 12 Aug 2026 (cursor.com)
Cursor, “Understanding LLM Token Usage” (forum.cursor.com)
NVIDIA, “LLM benchmarking metrics” (docs.nvidia.com)
NVIDIA, “Mastering LLM Techniques: Inference Optimization”, 17 Nov 2023 (developer.nvidia.com)
HTTPX, “Clients” (python-httpx.org)
llm-d, “KV-Cache Wins You Can See”, 24 Sep 2025 (llm-d.ai)
Manus, Yichao Ji, “Context Engineering for AI Agents: Lessons from Building Manus”, 18 Jul 2025 (manus.im)
AWS, “Capacity Blocks for ML” (docs.aws.amazon.com)
Lambda, “AI cloud pricing”, read 17 Nov 2026 (lambda.ai)
Groq, “Rate limits” (console.groq.com)
DeepInfra, “Rate Limits” (deepinfra.com)
SGLang, “Kimi-K3” cookbook (docs.sglang.io)
vLLM, “Kimi-K3” recipe (recipes.vllm.ai)
SemiAnalysis, “InferenceX v2: NVIDIA Blackwell Vs AMD vs Hopper”, 16 Feb 2026 (newsletter.semianalysis.com)
SemiAnalysis, “Ultra-High Interactivity on NVIDIA GPUs? TileRT”, 10 Aug 2026 (newsletter.semianalysis.com)
SemiAnalysis, “InferenceMAX”, 9 Oct 2025 (newsletter.semianalysis.com)
vLLM Blog, Martin Hickey, “Taking vLLM Apart: A Practical Guide to Disaggregated Serving”, 29 Sep 2026 (vllm.ai)
vLLM Blog, “EAGLE 3.1”, 26 May 2026 (vllm.ai)
vLLM Blog, Wilkinson and Chislett, “Adaptive Verification in vLLM: DSpark confidence-scheduled verification”, 14 Aug 2026 (vllm.ai)
vLLM Blog, “Exploring Speculative Decoding in vLLM on AMD GPUs”, 23 Aug 2026 (vllm.ai)
vLLM Blog, Aleksa Gordic, “Inside vLLM: Anatomy of a High-Throughput LLM Inference System”, 5 Sep 2025 (vllm.ai)
vLLM, “Speculative Decoding” (docs.vllm.ai)
vLLM, “Automatic Prefix Caching” (docs.vllm.ai)
Kwon et al., “Efficient Memory Management for Large Language Model Serving with PagedAttention”, 12 Sep 2023 (arxiv.org)
Zhong et al., “DistServe”, 6 Jun 2024 (arxiv.org)
Arun et al., “Towards Load-Aware Prefill Deflection for Disaggregated LLM Serving”, 2 Jul 2026 (arxiv.org)
CoreWeave, “Speculative decoding” (docs.coreweave.com)
Friendli, “Speculative Decoding” (friendli.ai)
Leviathan, Kalman and Matias, “Fast Inference from Transformers via Speculative Decoding”, ICML 2023 (arxiv.org)
Chen, Liang and Liu, “DFlash: Block Diffusion for Flash Speculative Decoding”, 28 May 2026 (arxiv.org)
llama.cpp, “Speculative Decoding” docs (github.com)
llama.cpp, README (github.com)
MLX LM, README (github.com)
LM Studio, “LM Studio 0.3.10: Speculative Decoding”, 18 Feb 2025 (lmstudio.ai)
LM Studio, “Speculative Decoding” SDK docs (lmstudio.ai)
Pipecat and Daily, “Voice AI and Voice Agents: An Illustrated Primer” (voiceaiandvoiceagents.com)
arXiv, “Building Enterprise Realtime Voice Agents from Scratch: A Technical Tutorial”, 17 Mar 2026 (arxiv.org)
Alex Marquardt, “The same work on a third of the tokens: tuning a fleet of coding agents”, 8 Nov 2026 (alexmarquardt.com)
DEV Community, rulestack, “Our Claude Code agent’s median run used 79.8M tokens, 97% of them cache reads”, 2026 (dev.to)

















