AI systemsTTFTfirst-token latency

Time to first token

Definition

Time to first token (TTFT) is the latency from sending a model request to receiving the first generated token, dominated by queueing and prompt processing (prefill).

In practice

TTFT grows with prompt length, while total time grows mostly with the number of output tokens. Streaming shows tokens as they are generated, so a user sees progress after TTFT instead of waiting for the whole answer. Track TTFT and total time separately per model, and give streaming calls two limits: a TTFT timeout and a maximum gap between chunks.

Streaming improves perceived latency, not capacity: the request still holds a connection and model concurrency until the last token. A low TTFT with a long tail of output can still exhaust concurrency, so size the system from total duration, not first-token latency.

Example

A chat endpoint shows TTFT of 450 ms at P50 and 1.8 s at P95, while the full 600-token answer takes 9 s; the client times out if no token arrives within 5 s.