One streamed chat turn, followed from the browser to the GPU and back. Follow the work before the first token, then watch the answer stream back one token at a time.
GrowthVectorIllustrative simulation
On smaller screens, scroll the diagram horizontally. Pause or scrub to inspect any point in the journey.
Illustrative, not measured: a Sydney browser calling a US-hosted model, a warm connection, retrieval before generation, 6,000 input tokens with no cache hit, 400 output tokens at 60 tokens/s. Playback is slowed about 7× before the first token and sped up during decode; the clock shows simulated time. The final 80 ms represents stream finalisation after the last token arrives.
Three clocks
Each factor slows one of three things
Time to first token970 ms
How long the screen stays empty. Everything up to and including prefill, plus the trip back.
Time per output token16.7 ms
Streaming speed once text appears. Set by memory bandwidth and the bytes read per token.
End to end7.7 s
Total request time. In this example decode is about 86% of it, so output length is the biggest lever.
A new client per request pays DNS, TCP and TLS every time. Keep-alive pools and HTTP/2 remove that.
Streaming on or off TTFT
Without streaming, the first visible output may arrive only after the full response is ready. The model still has its own time to first token.
Render cost PER TOKEN
Re-parsing the whole markdown buffer on every chunk slows long answers.
2
Network
Distance TTFTE2E
Light in fibre covers about 200 km per ms. Each round trip from Sydney to a US region costs well over 100 ms before any compute.
Handshakes TTFT
A cold TCP + TLS 1.3 connection costs 2 round trips; resumption or QUIC brings that to 0–1.
Proxies and WAFs E2E
Each inspection hop adds time, and some buffer the stream.
3
Gateway
Auth and quotas TTFT
Small, unless the token or quota store sits in another region.
Input guardrails TTFT
A moderation or PII model runs in series, adding a second model call before the real one.
Rate-limit retries E2E
Backoff after a 429 response dominates tail latency.
4
App · RAG
Retrieval chain TTFT
Embed, search and rerank all finish before the prompt exists. Rerankers are often the slowest step.
Agent steps E2E
Every tool call is another full trip through hop 5. Run independent calls in parallel.
Prompt size TTFT
Retrieved chunks and history all become input tokens that prefill must read.
Format retries E2E
Re-asking after invalid JSON doubles the request. Constrained output avoids it.
5
Inference server
Queue TTFT
Wait for a batch slot. Varies with load, time of day and service tier.
Prefill TTFT
Compute-bound; grows with input length. A prefix-cache hit skips most of it.
Decode PER TOKEN
Each token reads the active weights from memory: speed ≈ bandwidth ÷ bytes per token. Model size, MoE active parameters and quantization set it.
Batching and KV cache PER TOKEN
Bigger batches raise server throughput and cut each user's speed. A growing KV cache adds reads every step.
Reasoning and output length E2E
Hidden thinking tokens and long answers are all decode time.
Local hardware example: Strix Halo with gpt-oss-120b, prefill 524 tokens/s and decode 33 tokens/s. Results depend on the model configuration and workload.
6
Return path
Proxy buffering TTFT
A proxy or serverless runtime that buffers the response turns the stream into one late block.
Output guardrails PER TOKEN
Holding back a window of tokens for checks adds a fixed delay and makes delivery bursty.
Chunk size PER TOKEN
Per-token events cost framing; large chunks look jerky.