Inference engineering, live
Inference Ladder
Five levels for squeezing more out of a language model at serving time — from the API call you already send, up to designing a model that serves cheaply on purpose. Every level has a running simulation, built on representative mock numbers, that you can push around like a real one.
Level 01 · Basics
Use the API you already have
For every engineer building on Claude, GPT, or Gemini.
You don't own the GPUs, but the request you send still decides most of the bill. The biggest lever is prompt caching: a provider can reuse a prefix of a prompt if it's identical to one it just processed. Put whatever never changes — system prompt, tool schemas, reference documents — first, and the part that changes every call, the user's message, last. Anthropic prices a cache hit at roughly 90% less than a fresh input token. Edit a single character inside that cached prefix and the whole thing misses on the very next call — ordering isn't a style choice, it's the mechanism.
Prompt cache simulator
One request, 2,600 stable tokens (system + tools + docs) and 300 fresh tokens (the user's message)
ON — cache-friendly order
Flip the switch. On, the blue blocks are what an identical second call gets for ~10% price. Off, the user's message sits before the stable content, so nothing downstream can match a previous prefix — the whole 2,900 tokens are billed fresh, every single call.
Same total time — the user just isn't staring at a blank screen for it.
A yes/no classification rarely needs the biggest model on the menu.
Level 02 · Practitioner
Serve a model yourself
For engineers who want to see what happens under the hood.
Rent a single GPU, put an 8B open model on it behind vLLM, and you get an endpoint shaped like the OpenAI API — your app code barely changes. What's new is watching batching happen: one cost analysis found continuous batching lifting GPU utilization from under 20% to over 70% on the same card, cutting the cost of each token three to four times. You also learn where memory goes — model weights take a fixed slice, and everything left over becomes KV cache, the running notes for every in-flight conversation. That pool is what decides how many people you can serve at once.
Load test simulator
Same three sample points a guidellm run would take
Throughput vs. concurrency
Time to first token vs. concurrency
Drag the slider across 1, 8, then 32 concurrent users. Throughput climbs and time-to-first-token gets worse at the same time — that tradeoff is the whole game in one chart.
Level 03 · Advanced
Tune for your traffic
For platform engineers and architects making real choices.
Past a certain scale, you stop using one engine one way and start picking tools for the shape of your traffic. Quantization stores weights in smaller numbers — FP8 instead of FP16 — and on an H100 that roughly doubles throughput at the same hourly price, with little quality loss for most tasks (check your eval anyway). Prefix caching reuses notes across turns of the same conversation, and engines differ sharply in how well they hold onto it under load: in one multi-turn benchmark, SGLang held around 30 tokens/sec while vLLM slid from 22 down to 16 as cache pressure built. For agent workloads with long, repeated context that gap is real; for a one-shot batch job on a fixed template, vLLM is fine.
Precision
Same model, same H100, different number format
Baseline — FP16 weights.
Engine under load
Tokens/sec across a 10-turn agent conversation, same shared context
ON
Run the same multi-turn trace through both engines with prefix caching on, then switch precision to FP8. Keep your eval running beside it and write down which change bought the most — and what it cost in quality.
Level 04 · Expert
Rebuild how serving works
For inference specialists running serious volume.
At real volume, you stop tuning an engine and start changing its architecture. Speculative decoding lets a small, fast draft model guess the next few tokens while the big model verifies them all in one pass — right guesses mean several tokens for the price of one. Split serving puts prefill and decode on separate GPU pools sized for their own job, so one long prompt stops stealing latency from everyone else's answer — the hard part is moving KV cache between pools fast enough. Cache-aware routing sends each request to whichever machine already holds its notes, which for a fleet of agents sharing context can save a large share of prefill work outright.
Draft-and-verify speedup
Effective throughput, same big model, same prompt
Gain depends on how predictable the output is:
Decode latency when a long prompt lands
One shared pool vs. two pools sized for their own job
Shared pool
Dashed line: a long prompt arrives. It steals the pool.
Split pools
Same long prompt — pool B never feels it.
Tools like llm-d and NVIDIA Dynamo package this on Kubernetes. The hard part is moving KV cache between pools fast enough.
Prefill work across six requests, same agent fleet
Random machine vs. routed to the machine already holding the context
Solid = cold, full prefill. Dashed = the machine already had these notes cached — 73% less prefill work for the same six requests.
Measure how much of your GPU time goes to prefill vs. decode. If prefill spikes are hurting decode speed for other users, that's your signal to try split serving. If they aren't, don't bother yet.
Level 05 · Frontier
Design the model for serving
For teams that train or fine-tune their own models.
At the top of the ladder, inference stops being something you optimize around and starts shaping the model itself. Character.AI picked attention designs that need fewer notes per token, shared those notes across layers, and trained in int8 so there was never a gap between how the model trained and how it serves. Other teams write their own GPU kernels, plan whole fleets with queueing theory, or mix hardware — compute-heavy cards for prefill, memory-heavy cards for decode, as described in the DeepSeek-V3 report's section on split serving.
Standard training vs. serving-aware design
| Decision | Standard approach | Serving-aware approach |
|---|---|---|
| Attention design | Full attention per layer | Fewer notes needed per token, shared across layers |
| Training precision | Train in FP32/BF16, quantize later | Train in int8 — no train/serve gap to correct for |
| GPU kernels | Vendor-default kernels | Hand-written kernels tuned to the model's own shape |
| Fleet planning | Provision by rule of thumb | Sized with queueing-theory models of real traffic |
| Hardware mix | One GPU type for everything | Compute-heavy cards for prefill, memory-heavy for decode |
Read the Character.AI inference write-up and the DeepSeek-V3 report's section on split serving. Then take one modeling decision in your own stack and answer the question below.
What does this decision cost at serving time, a year from now, at ten times the traffic?
Kept only in this browser — never sent anywhere.