Skip to content

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.

80 ms

Browser to your backend and back, plus backend to the model provider.

5 ms

Authentication, rate limiting and validation.

120 ms

Embedding the query and searching the index. Zero if the app has no retrieval.

3,000 tokens

System prompt, history, retrieved context and the question.

10,000 tokens/s

How fast the model reads the prompt. Illustrative; depends on model and hardware.

300 tokens

Tokens the model generates.

50 tokens/s

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.

Learn the idea behind it