On this page
"Our model does 5,000 tokens per second" sounds impressive and tells you almost nothing. Per user or in total? At what latency? With what prompts? LLM serving has a small vocabulary of metrics that answer those questions, and knowing them is the difference between a benchmark that predicts production and one that doesn't.
This guide defines each metric, shows how they relate with worked numbers, explains goodput and percentiles, and covers where to measure and how to set targets.
#The timeline of one request
A streaming request has three moments that matter: it's sent, the first token arrives, and the last token arrives.
Without streaming
With streaming
At 30 tok/s text arrives faster than most people read (about 6 tok/s), so after the first token the wait is barely noticed.
Streaming does not shorten generation. It moves the first visible words from the end of the wait to the start.
From those come the per-request metrics:
| Metric | What it measures | Dominated by |
|---|---|---|
| TTFT (time to first token) | Send to first token | Queueing plus prefill of the prompt |
| TPOT (time per output token) | Average gap between tokens after the first | Decode step time |
| ITL (inter-token latency) | Each individual gap between tokens | Decode step time, plus stalls |
| E2E latency (end-to-end) | Send to last token | TTFT plus output tokens times TPOT |
The relationship is simple and worth memorising:
#A worked example
A request with TTFT of 400 ms, 300 output tokens and TPOT of 25 ms:
The user sees the answer start after 0.4 s and finish after about 8 s. Halving TTFT saves 0.2 s; halving TPOT saves 3.7 s. For long answers, TPOT dominates the total; for short answers (classification, tool calls), TTFT does. That's why different products care about different metrics.
#TPOT versus ITL
TPOT is an average per request; ITL is the full distribution of gaps. A request with an average TPOT of 20 ms might have most gaps at 15 ms and a few at 400 ms, when another user's long prompt was prefilled in the same step. Users feel those stalls, so look at ITL percentiles, not only TPOT (disaggregation explained covers the cause and fixes).
#Breaking TTFT down
TTFT is the sum of several parts, and knowing which one dominates tells you what to fix:
| Part | Typical cause when it's large | Fix |
|---|---|---|
| Network and API gateway | Distance, TLS, slow proxies | Region placement, connection reuse |
| Tokenisation | Very long prompts on a busy CPU | More CPU, faster tokeniser |
| Queueing | Server near capacity | More replicas, admission control |
| Prefill | Long prompts (prefill vs decode) | Prefix caching, faster GPUs, tensor parallelism |
| KV transfer | Disaggregated serving | Layer-wise streaming, faster links |
For long-prompt workloads, it can help to also track TTFT per 1,000 input tokens, which separates "prompts got longer" from "the server got slower".
#Throughput, two ways
- Output tokens per second (total): all output tokens produced by the server per second, across all users. This is the cost metric: cost per million tokens is roughly GPU cost per second divided by it (cost per million tokens).
- Requests per second: completed requests per second. More meaningful when request sizes vary.
Both rise with batch size while per-user speed falls (continuous batching explained). That's why a throughput number without a latency number is meaningless: you can always get more throughput by letting users wait longer.
#Goodput: the metric that combines them
Goodput is the throughput of requests that met their latency targets. If your targets are P95 TTFT under 1 s and TPOT under 50 ms, goodput counts only the requests that achieved both.
Why it matters: push load higher and raw throughput keeps climbing, but more and more requests miss their targets. Goodput rises, peaks, then falls. The peak is the real capacity of your deployment at your service level.
#An illustrative sweep
Here's what a sweep of arrival rates typically looks like for one replica, with targets of TTFT under 1 s and TPOT under 50 ms. The numbers are illustrative, but the shape is what real sweeps show:
| Arrival rate (requests/s) | P95 TTFT | P95 TPOT | Requests completed/s | Met both targets | Goodput (requests/s) |
|---|---|---|---|---|---|
| 2 | 0.25 s | 22 ms | 2.0 | 100% | 2.0 |
| 4 | 0.35 s | 28 ms | 4.0 | 99% | 4.0 |
| 6 | 0.6 s | 38 ms | 6.0 | 97% | 5.8 |
| 8 | 1.8 s | 47 ms | 7.6 | 70% | 5.3 |
| 10 | 6 s | 52 ms | 7.9 | 20% | 1.6 |
Raw completions keep rising until about 8 per second, but goodput peaks near 6. Selling capacity at "8 requests per second" would mean 30% of users missing the target. The honest capacity is about 6.
#Percentiles, not averages
Latency distributions for LLM serving have long tails. Averages hide exactly the experiences that make users complain.
- P50 (median): the typical request.
- P95 / P99: the slow requests that still happen many times an hour at real traffic.
- Max: useful for spotting pathological cases, too noisy for targets.
At 10 requests per second, a P99 problem hits 360 users an hour. Set targets on P95 or P99, and report them with the load they were measured at.
Percentiles need enough samples. With 200 requests, the P99 is decided by just the 2 slowest, so it jumps around between runs. For stable P99s, collect at least a few thousand requests per measurement.
#How they react to load
As the arrival rate rises on fixed hardware:
- TPOT rises slowly as batches grow (more KV cache to read per step).
- TTFT rises suddenly near capacity, because requests start queueing before their prefill.
- Throughput rises, then flattens when the batch is limited by memory or compute.
- Goodput peaks, then falls as more requests miss targets.
Utilisation 80% · chance of waiting 46% · mean wait 1.14 s
M/M/c queue (Erlang C): random arrivals, c identical servers. Waiting time stays small until utilisation passes about 70 to 85%, then climbs steeply. Real LLM servers batch, but the shape holds.
That sudden TTFT rise is queueing theory in action: waiting time grows sharply as utilisation approaches 100%. It's why production deployments keep headroom (queueing theory for LLM capacity).
#Where to measure
The same request has different latencies depending on where you time it:
- Inside the engine: excludes network, gateway and tokenisation. Good for engine tuning.
- At the gateway: includes routing and queueing across replicas.
- In the client: what users actually experience, including network and any client-side processing.
Use engine metrics to diagnose and client-side metrics for targets. If they disagree a lot, the gap is your network and gateway.
#What engines export
Serving engines expose Prometheus metrics you can chart and alert on. vLLM, for example, exports histograms for time to first token, inter-token latency and end-to-end request latency, plus gauges for running and waiting requests and KV cache usage (exact names vary by version; check your engine's /metrics endpoint). A P95 TTFT over five minutes looks like:
histogram_quantile(0.95,
sum(rate(vllm:time_to_first_token_seconds_bucket[5m])) by (le))The waiting-requests gauge is an early warning: a growing queue means TTFT is about to climb (metrics and dashboards for GPU inference).
#Setting targets that make sense
Start from the product, not the hardware:
| Product | What users notice | Reasonable starting targets |
|---|---|---|
| Chat | Delay before the answer starts; reading-speed streaming | TTFT P95 around 1 s; TPOT under about 50 ms (faster than reading) |
| Code completion in an editor | Total time for a short completion | E2E P95 of a few hundred ms |
| Voice assistant | Time until speech starts | TTFT well under 500 ms, end to end with ASR and TTS |
| Agents and tools | Total task time across many calls | E2E per call; tokens per second matter a lot for long outputs |
| Offline batch | Cost | Throughput only; latency barely matters |
For context: people read roughly 4 to 6 words a second, which is about 5 to 8 tokens per second. A TPOT of 50 ms (20 tokens per second) streams comfortably faster than anyone reads. Tighter TPOT targets matter when output is consumed by code, read by skimming, or long (reasoning, code generation).
These are starting points to discuss with your product team, not standards. What matters is writing them down, measuring against them, and computing goodput.
#Reasoning models
Models that think before answering add a new gap: the time from the first thinking token to the first visible answer token. If users only see the answer, TTFT as the engine measures it is misleading; track time to first visible token as well, and set targets on it.
#Common mistakes
- "Tokens per second" without saying which. Per user, or total? Prefill, or output?
- Averages instead of percentiles.
- Measuring TTFT without queueing (one request at a time), then being surprised in production.
- Ignoring ITL stalls from long prefills mixed into decode batches. Chunked prefill or disaggregation fix them.
- Reporting throughput at a load where most requests miss their targets. Report goodput.
- Too few samples for P99, then chasing noise.
#FAQ
Is TPOT the same as ITL? TPOT is one number per request (its average gap); ITL is every gap. Their averages are similar; their tails are not.
Should targets be per request or per token? Both have uses: per-token targets (TPOT) describe streaming quality; per-request targets (E2E) describe task time. Many teams set TTFT and TPOT targets for chat, and E2E targets for API and agent calls.
What's a good TTFT? It depends on the product; under about 1 second feels responsive for chat. Measure from the client.
#Go deeper
SLOs, error budgets and alerting covers turning these metrics into targets and alerts, and benchmarking done properly shows how to measure them under realistic load. Next: how to benchmark an LLM server.
metricslatencybenchmarkingsloinference-engineering
Found this useful?
Send it to someone who is learning the same thing.
Preparing for an interview?
Next: learn it step by step, free
Capacity planning and cost
Turn traffic and latency targets into a GPU count and a monthly bill. A free lesson with step-through diagrams and a quiz.