Staffing the kitchen before exam season
Tanvi runs the platform team at VidyaAI, an AI tutor for school students. Board exams start in eight weeks, and traffic will jump tenfold. VidyaAI hosts its own 70-billion-parameter model, and Tanvi has to tell finance how many GPUs to rent. (Tanvi, VidyaAI and every number here are made up for teaching.)
LLM serving and inference cost explains the mechanics: prefill versus decode, the KV cache, continuous batching, quantisation and cost per token. That is how a cook prepares a dish. This guide is about running the kitchen: what waiting time to promise customers, how many cooks and stoves to staff, how to split a dish too big for one stove, and what to do at the dinner rush.
Tanvi's eight weeks, as questions:
| Question |
Idea it forces |
| "Students say 'is it even working?'" |
Latency targets: TTFT, TPOT, percentiles |
| "How many GPUs do we order?" |
Sizing: memory first, then throughput |
| "The model doesn't fit on one GPU" |
Tensor, pipeline and data parallelism |
| "Every request re-reads the 3,000-token syllabus prompt" |
Prefix caching and other speedups |
| "One teacher's 50-page upload froze everyone's answers" |
Admission control, chunked prefill, priorities |
| "The 7 am rush took 8 minutes to scale up" |
Autoscaling, cold starts, reliability |
1. "Is it even working?": latency targets that mean something
Answers stream out token by token, so one latency number isn't enough.
sequenceDiagram
participant S as Student
participant Q as Queue
participant G as GPU
S->>Q: question sent (t = 0)
Q->>G: admitted after waiting
G->>G: prefill: read the whole prompt
G-->>S: first token (TTFT)
G-->>S: token 2 (TPOT later)
G-->>S: token 3 (TPOT later)
G-->>S: ... last token (end-to-end latency)Reading the diagram. It's one request's timeline, top to bottom.
- Before the first token, everything is waiting: queue time plus prefill, which means reading the whole prompt. That total is the TTFT. A long prompt or a long queue makes it worse, and it's what students feel as "is it working?"
- After the first token, each new token arrives one TPOT later. That is what makes streaming feel smooth or jerky.
| Metric |
Meaning |
User feels it as |
| TTFT (time to first token) |
Request sent until the first token arrives; dominated by queueing plus prefill |
"Is it working?" |
| TPOT / ITL (time per output token, inter-token latency) |
Gap between tokens during decode |
Streaming smoothness |
| Tokens per second per user |
Reciprocal of TPOT |
Reading speed; about 10 to 30 tokens per second feels fluent, faster than reading is wasted for chat |
| End-to-end latency |
TTFT plus output length times TPOT |
Total wait; matters for non-streamed and agent steps |
| Throughput |
Total tokens per second across all users, per GPU |
Cost efficiency |
You've reached the free preview of this post.
Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.
See plans