⌕ search /
Engineering notes

First token under load: why the idle number is the wrong one

Published 2026-11-24 · updated 2026-11-24 · engineering note

LLaMA 3.3 70B in FP8 on one replica of four H100 SXM cards (TP4) under vLLM takes 334 ms to return the first token of a 4 096-token prompt when it has nothing else to do. With 32 conversations running on that replica, the planner on this site puts the first token at 798 ms — 2.4× the idle value. For a 512-token prompt at 64 running streams the gap is wider: 40 ms idle, 272 ms loaded, 6.7×. The idle number is the one most estimates quote. A server that is doing its job is not idle. This note gives the three terms that load adds, the formula the planner uses, how it was fitted on public measurements and how far off it still is.

Idle: prompt over prefill rate

Before the first token, the engine runs the whole prompt through the model once (prefill). Prefill is compute-bound, so on an idle replica the time is the prompt's floating-point work divided by the compute the cards achieve. The calculator's TTFT column is exactly this:

TTFT_idle = ( 2 · P · S  +  2 · L · h · S² )            # linear layers + causal attention
            / ( TP × TFLOPS_dtype × prefill efficiency × TP fabric factor )

P = parameters   S = prompt tokens   L = attention layers   h = hidden size

It is the best case by construction: one request, nothing ahead of it, no other stream sharing the step. The rooflines behind both phases are in the note on the calibrated roofline. Here each doubling of the cards halves it — TP2 gives 668 ms for the same 4 096-token prompt, TP8 gives 167 ms.

Three things a loaded server adds

  1. 01
    Waiting for prefill capacity. Every running stream sends its next prompt when its answer ends, so a replica spends a share ρ of its time prefilling other people's prompts. A new prompt competes for that capacity, and its prefill stretches by 1 ÷ (1 − ρ). ρ is the batch times one stream's prompt rate over the replica's batched-prefill rate; one stream's cycle is its idle first token plus 256 tokens at the 50 ms TPOT target. For the TP4 replica above the cycle is 13.1 s, the prefill rate 21 336 tokens/s, and each stream adds 0.0146 to ρ. The planner never loads a replica past ρ = 0.85; here that is about 58 streams.
  2. 02
    The engine's fixed cost. HTTP handling, tokenisation and scheduling cost time no matter how short the prompt. Fitted on measured runs at four or fewer concurrent requests: vLLM 75 ms, TensorRT-LLM 125 ms, SGLang 290 ms; Dynamo takes vLLM's value.
  3. 03
    The decode steps of the streams already running. The scheduler interleaves the new prompt with decode steps of the running batch, so the request waits a share of one loaded decode step for each other stream: share × (b − 1) × TPOT under load. The shares fitted per engine: vLLM 0.116, TensorRT-LLM 0.154, SGLang 0.34, Dynamo as vLLM. They describe how each scheduler interleaves prefill and decode on the measured runs, not a ranking of engines. llama.cpp and Ollama have no measurements: they get neither the fixed cost nor the batch term, only the 1 ÷ (1 − ρ) stretch.

TPOT under load is itself larger than the decode step: decode × (1 + f · ρ ÷ (1 − ρ)), with the share f of prefill time that lands between one user's tokens — 0.2 for vLLM and SGLang, 0.7 for TensorRT-LLM (calibration of 2026-11-09).

The formula, on one replica

TTFT(b) = TTFT_idle / (1 − ρ(b))                    # waiting for prefill capacity
        + engine_cost[engine]                       # 75 · 125 · 290 ms
        + batch_share[engine] · (b − 1) · TPOT_loaded(b)

ρ(b) = b · S / (TTFT_idle + OSL · TPOT_target) / prefill_rate      ρ ≤ 0.85
batch_share: vLLM 0.116 · TensorRT-LLM 0.154 · SGLang 0.34 · llama.cpp, Ollama 0

Computed with the planner's own code for LLaMA 3.3 70B, FP8, one TP4 replica on H100 SXM, vLLM, 256-token answers, TPOT target 50 ms. The three additions are split out of its result and add up to it:

PromptRunning streamsIdleρWaiting for prefill EngineBatch termLoaded TTFT× idle
4 0961334 ms0.015+5 ms+75 ms0414 ms1.2×
4 0968334 ms0.117+44 ms+75 ms+12 ms466 ms1.4×
4 09632334 ms0.468+294 ms+75 ms+95 ms798 ms2.4×
4 09664334 ms0.935past the 0.85 cap — the planner adds a replica instead
512140 ms0.002+0 ms+75 ms0115 ms2.9×
512840 ms0.014+1 ms+75 ms+11 ms127 ms3.1×
5123240 ms0.058+2 ms+75 ms+61 ms179 ms4.4×
5126440 ms0.116+5 ms+75 ms+151 ms272 ms6.7×

Which term dominates depends on the prompt. A long prompt fills the replica's prefill capacity: at 32 streams the wait for it (294 ms) is three times the batch term. A short prompt barely moves ρ, so the engine's fixed cost dominates at low batch and the wait behind running decode steps dominates at high batch — at 64 streams it is 151 ms against a 40 ms prompt.

How it was calibrated, how wrong it is

The shares were fitted on NVIDIA's public end-to-end measurements of serving runs (B200, B300, H100 and H200 under vLLM, SGLang and TensorRT-LLM; the same set the accuracy page scores). Half of the runs fitted one share per engine; the other half scored it. Runs that fell off a cliff — far slower than any model of a working server, from KV exhaustion or an admission queue — were left out of both and counted (143). The published aggregates:

SetPredictorRunsMAPEMedian errorWithin ±20 %
Full measured setCalculator, idle3 25382.7 %−90.4 %2.2 %
Full measured setPlanner, under load3 13349.4 %−2.2 %27.1 %
Points shared with NVIDIA's toolsCalculator, idle43186.4 %−92.0 %0.7 %
Points shared with NVIDIA's toolsPlanner, under load43153.5 %−2.4 %23.7 %

The planner row covers the runs where its prefill share stays below one. The idle value misses by a factor of ten at the median; the loaded value has no median bias, but its mean absolute error is still about half of the measured value. On the held-out half the misses are not uniform: prompts of 4K tokens and more come out 27 % low at the median, prompts of 1K and less 21 % high, and replicas running 129–256 requests 79 % high (51 runs). The value is a mean. It is not a 90th or 99th percentile.

What it changes in sizing

For 64 users on that model and card — 4 096-token prompts, 256-token answers, TPOT target 50 ms, H100 SXM as the anchor — the planner gives:

  • No TTFT target: 6 GPUs (three two-card replicas), first token 3.1 s.
  • 2 s target: still 6 GPUs, as three TP2 replicas, 1.96 s.
  • 1 s target: 8 GPUs, two TP4 replicas of 32 streams each — the 798 ms row above.
  • 0.5 s target: 16 GPUs, two TP8 replicas, 356 ms.

On long prompts a TTFT target binds well before the 50 ms TPOT target, which every one of these plans meets with room to spare. The planner meets it by spreading streams over more replicas or by wider tensor parallelism, which cuts the idle term and the prefill share at once. The other route is a separate prefill pool: in chat mode the planner also sizes split prefill and decode workers and shows them when they pay (rules). A prefill-only pool runs no decode batch, so its first token is the stretched prefill, the engine's cost and the KV transfer — no batch term.

The TCO planner (chat and agentic) and every LLM module in the Builder size against the loaded value. The calculator's TTFT column stays the idle value on purpose: it answers "how fast is one prompt on this layout", and a row note says a client sees more. For the 1 s plan above it reads 334 ms where the planner reads 798 ms. The two numbers answer different questions.

Where it is wrong or silent

  • A mean, not a tail. A target stated as p90 or p99 needs more GPUs than the planner shows. NVIDIA's RAG sizing guide, which targets a 90th-percentile first token under 3 s for a whole pipeline, asks for 2–2.6× the LLM GPUs the planner gives.
  • No data, no terms. llama.cpp and Ollama keep the stretched idle value only.
  • Queues past the cliff are not modelled. KV exhaustion and admission queues produce multi-second first tokens no smooth formula follows; those runs were excluded, not fitted.
  • Very large batches over-predict. Above 128 running requests the batch term grows faster than the measurements.
  • The 0.85 cap is an assumption. It bounds the reported first token on prefill-bound replicas; it was not fitted. A replica stopped by its TTFT target reports its limit as prefill.
  • Agentic sessions carry the same two terms on the mean and the 90th-percentile turn, but the target is checked against the mean, and loaded TPOT keeps the full prefill share.
  • The idle term itself is off for long prompts in different directions per engine; no single correction held on the held-out runs, so none is applied.

Try it

The 1 s plan of this note in the TCO planner — change the TTFT target and watch the GPU count, or open the planner with your own model. In the Builder each LLM module's first token is the loaded value, inside the pipeline's first-token budget.

Sources

  • Measured serving runs: NVIDIA's end-to-end accuracy set for AISimulate and the aiconfigurator sample (Apache-2.0); only our aggregates are shown, as on the accuracy page.
  • The fit, the held-out scores and the reference sizing sweeps: this site's calibration of 16 November 2026 (fit on half of the runs, scored on the other half).
  • The worked table and the sizing list: this site's capacity planner, run for this note; GPU counts only, no prices.
  • Prefill and decode rooflines: our note on the calibrated roofline.

Prices are collected daily from each provider's public price list or API. Estimates, not quotes — always confirm on the provider's own page before committing.

How this works · How accurate it is