Kolkata ·  
AI engineering
evals
deep · 6 min

LLM latency

Where the time goes in a model call, and how to measure it.

updated 29 Sept 2026

Our support bot feels slow. We send a system prompt, a few retrieved documents and the user's question, and the reply takes a few seconds to land. The prompt is long, so the first idea most of us have is to trim it.

Let's hold off and work out where the seconds actually go. If we halve that prompt, we'll likely save something like 1 to 5% of the wait. Why so little?

Where one call spends its time

Follow the request from the moment it leaves our server.

It travels to the provider, and how long that takes depends on where our server is and where theirs is. Then it may wait in a queue, because a hosted model is shared and busy hours mean waiting for a slot. Then the model reads the whole prompt in one parallel pass and produces the first token. That's prefill. Then it writes the rest of the answer one token at a time, each one waiting for the one before. That's decode. (Both are explained in prefill and decode.) Then the tokens travel back.

If it's a reasoning model, there's one more step before the answer: thinking tokens. We may never see them, but they're decoded one at a time like any other output.

Now we can see why trimming the prompt does so little. Prefill handles the prompt in parallel, so it's fast per token. Decode is sequential and slow per token. For a normal call, decode is most of the time. The rules of thumb are lopsided: cut the output in half and you can cut about half the response time. Cut the prompt in half and you save 1 to 5%. One set of 2023 measurements put it starkly: adding 512 tokens to the prompt added less time than writing 8 more tokens of answer.

So the first question for a slow call is how many tokens it writes. A model asked for "a short answer" that writes 600 tokens will be slow on any provider.

There's one exception. With a very big context, like long documents or images, prefill grows enough to matter. Then trimming the prompt (or reusing a long shared start with prompt caching) does pay off.

The numbers we can actually see

From outside, we can't time each stage. We get a few numbers that each cover several stages.

Time to first token (TTFT) runs from sending to the first token arriving. It covers network, queue and prefill. So prompt length shows up here, and that's why you'll read that longer prompts make calls slower. They do make TTFT longer. They just don't move the total much, unless the context is huge or the answer is short.

Inter-token latency (ITL, also called time per output token) is the average gap between tokens after the first. Output speed is the same thing flipped: 100 ms per token is 10 tokens a second.

End-to-end time runs to the last token. Roughly, it's TTFT plus ITL times the number of tokens written.

Then there's throughput, which trips people up. It's tokens per second too, but across all users of a server at once. That's what a provider tunes for. Output speed is what our user feels. And the two pull against each other. A provider batches many people's requests through the GPU together, which raises the total but slows each request. In one 2023 measurement, a batch of 64 gave 14 times the throughput at 4 times the latency per request. So when a chart says "tokens per second", check which one it means.

Reasoning models muddy TTFT. The first token back might be the start of a long silent think. Public benchmarks like Artificial Analysis report a separate time to first answer token for them, which runs until the thinking is done. Comparing a reasoning model with a regular one on TTFT alone compares different things.

Load and extra calls

Two more things add time that the model itself doesn't explain.

Load. When the server is busy, requests wait in the queue, and that wait lands in TTFT. More requests in flight also means each gets a smaller share of the GPU, so everything slows. We can't control a provider's load, but we should expect the same request to be slower at a busy hour. That's why the spread of our latencies matters as much as the typical value, which is the subject of tail latency.

Extra calls. Lots of features make several model calls per user request: classify, then retrieve, then answer. Each call pays its own round trip, queue and prefill. Chained one after another, as in prompt chaining, the times add up. If two steps can share one prompt, merging them saves a whole round trip. If steps don't depend on each other, running them side by side makes the wait as long as the slowest call instead of the sum.

What to change, in order

Get the quality right first, with no speed limits. Otherwise you never see what the best answer looks like, so you can't tell what a faster setup costs you.

Then the biggest lever is usually a smaller model. Model size is the main thing that sets how fast tokens come out, and on a narrow task a smaller model with a good prompt can keep up with a bigger one. Model selection weighs that against quality and cost.

Next, write fewer tokens. Ask for a number of sentences or paragraphs (models follow those better than word counts), and drop anything from structured output that the code doesn't use. max_tokens is a blunt cap: it cuts the answer mid-sentence, so it suits short answers where the useful bit comes first, not prose.

Then stream. Streaming doesn't make the answer finish sooner, but it cuts the wait before something appears to about a second or less, and watching text arrive feels very different from staring at a spinner. And sometimes skip the model entirely: a lookup or a regex is faster than any call.

Measuring it ourselves

Time it from our own server, the way users feel it. For every call, log when it was sent, when the first token with content arrived, when the last one arrived, and how many tokens came out. Those four give us TTFT, ITL and end-to-end time, and logging them on every call is part of tracing. Then look at the median and the 95th and 99th percentiles, not the average. A few very slow calls hide easily behind a fine-looking mean.

Public speed charts are a starting point. As of 2026-09, Artificial Analysis tests each API from one machine in a central US cloud zone, about every three hours, and reports the median over the last 72 hours. Our region, prompt sizes and time of day will differ.

And the median is where public data stops. Half of all calls are slower than it, and the calls people complain about live far out past it. As of 2026-09 we found no trustworthy public source measuring p95 or p99 TTFT across LLM APIs. The mechanisms above (output length dominating, batching trading speed for throughput) come from 2023 hardware too; the shape holds, but the milliseconds won't. For the slow end of our own bot, we'll have to measure.

Further reading