Charts · 31
Where an LLM call spends its time
A call to a language model is two waits with different shapes. First nothing: the request arrives, waits its turn, and the model reads the whole prompt before it can produce a word. Then the answer, one token at a time. Measured on my own machine, a short question had its first token in 165 ms and its last after 4.6 seconds. Behind a spinner the user waits the whole 4.6 seconds and it looks broken; streamed, they are reading within a fifth of a second.
First token after 165 ms, the whole answer after 4.6 s. Behind a spinner, that is 4.6 s of nothing.
A one-line question, about 50 prompt tokens. 11 calls; this is the median one by time to first token. 115 tokens out at 25.6 a second.
Hover a phase
Everything before the marker is waiting; everything after it is the answer arriving, one tick per streamed chunk at the moment it reached the client. Switch to the long document and the wait grows, because the model has to read it all first. Send it again and the wait nearly disappears.
Behind a spinner
Streamed
| Call | Calls | Prompt | Queue | Load | Prefill | First token | Streaming | Total | Tokens/s |
|---|---|---|---|---|---|---|---|---|---|
| A short question | 11 | 50 | 11 | 9 | 142 | 165 | 4,440 | 4,604 | 23.8 |
| A long document | 8 | 3,297 | 33 | 7 | 3,428 | 3,472 | 3,020 | 6,488 | 35.0 |
| The same document again | 5 | 3,298 | 28 | 15 | 50 | 107 | 3,413 | 3,506 | 32.8 |
| A cold start | 3 | 3,297 | 42 | 39,535 | 3,367 | 39,699 | 3,201 | 44,978 | 34.4 |