Log inStart free
LESSON 29.16 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Token budgets and admission control

Watch a token budget fill each step, and see which requests the server admits.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 29.16 · SCHEDULERSTEP 8 · 513 OF 768 TOKENS
01
Stage 1 of 5 · One step
A token budget caps the tokens in one step. In step 8, request 8 needs 256 tokens, but only 255 are free.
Explain it simply

The bar on the right stacks the tokens of one step: prefill chunks in teal, output tokens in cobalt. A request whose chunk does not fit in the space left waits for the next step. A real step takes longer with more tokens, so the budget keeps each step short.

Step 8: request 7 uses 1 token, request 2 uses 512 tokens. The budget is 768 tokens.

prefill, KV in useoutput tokenswait, lost work, rejectedbudget, pool, targets
step 804812162024step (50 ms)1 batch2 batch3 batch4 interactive5 interactive6 interactive7 interactive8 interactive9 interactive10 interactive11 interactive12 interactive13 interactivetokens per stepbudget 768step 8budget 7682: 5128: 256 waits7: 1513 / 768one step513 taken + 256 for request 8 = 769 > 768, so request 8 waitsstep 804812162024step (50 ms)1 batch2 batch3 batch4 interactive5 interactive6 interactive7 interactive8 interactive9 interactive10 interactive11 interactive12 interactive13 interactivetokens per stepbudget 768step 8budget 7682: 5128: 256 waits7: 1513 / 768one step513 taken + 256 for request 8 = 769 > 768, so request 8 waits
Toy: 13 requests, 3 slots, a 3,072-token KV pool, 1 step = 50 ms
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
∑i∈stepki≤B\sum_{i \in \text{step}} \sy{k}{data}{k_i} \le \sy{B}{param}{B}
513+256=769>768513 + 256 = 769 > 768

The tokens of every request in a step fit in the budget.

Common mix-ups

MYTHRejecting a request always makes the service worse.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With Admit all, do more or fewer requests miss their TTFT target at a budget of 512 tokens?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.