Try it: Where does the time go?
Change the inputs and watch where the time goes. The default values are illustrative, not measurements of any particular model or provider.
Browser to your backend and back, plus backend to the model provider.
Authentication, rate limiting and validation.
Embedding the query and searching the index. Zero if the app has no retrieval.
System prompt, history, retrieved context and the question.
How fast the model reads the prompt. Illustrative; depends on model and hardware.
Tokens the model generates.
Tokens per second for this one request while it streams. Illustrative.
- Prefill
- 300 ms
- 3000 tokens ÷ 10000 tokens/s = 300 ms
- Time to first token
- 505 ms
- 80 + 5 + 120 + 300 = 505 ms
- Decode
- 5,980 ms
- (300 − 1) tokens × 20 ms = 5980 ms
- Full answer
- 6,485 ms
- 505 + 5980 = 6485 ms
- Share spent decoding
- 92.2 %
- 5980 ÷ 6485 × 100
Assumptions
- Stages run one after another; nothing overlaps.
- Prefill and decode speeds are constant for the whole request.
- No queueing at the provider and no retries.
- Speeds are illustrative inputs, not measurements of any particular model.