Estimation & cost

Back-of-envelope GPU/token/QPS math: what does serving 1M daily LLM requests cost, and when does a distilled small model win?

About 22 min read3-question knowledge check

The mental model

Capacity estimation is napkin math before architecture — the Fermi-estimation habit applied to GPUs, tokens, and QPS. The interviewer is not testing whether you can multiply; they are testing whether you can turn "serve 1M LLM requests a day" into "that's ~12 QPS average, ~35 at peak, ~2 tokens/ms per GPU, so ~6 GPUs with headroom, ~$4-5k/month" *out loud, with stated assumptions*. The value is not the exact number — it is knowing which quantity dominates and where the cliff is. A good estimate is right to within an order of magnitude and immediately tells you whether the answer is "one box" or "a cluster," "cents" or "millions."

The mental shift from application engineering is that ML capacity is dominated by a few brutal multipliers you can compute on paper: tokens per request × requests × cost per token; or QPS × per-request GPU-seconds ÷ GPU throughput. Everything else is rounding. So the skill is memorising a handful of anchor numbers (seconds in a day, tokens per GPU per second for a 7B model, GPU $/hour) and chaining them. The engineer who reaches for a load test to answer "roughly how many GPUs" has skipped the ten-second calculation that would have told them the shape of the answer.

The load-bearing insight interviewers reward: peak, not average, sizes your fleet, and the tail is where cost and failure live. 1M requests/day is 11.6 QPS averaged over 86,400 seconds — but traffic is not uniform. If peak is 3x average and you must serve p99 within an SLO, you size for ~35 QPS, not 12. Sizing for the average is the classic estimation error, and it is why "we provisioned for the mean and fell over at lunch" is a story every senior has lived.

The full lesson continues with 15 more sections
  • Deep dive — worked back-of-envelope math
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision