productinterview.tools
MenuClose

Inference and Serving: Running AI Models Fast, Cheaply and Reliably

Serving models fast, cheaply and reliably.

Advanced3 lessons5 questions

What this module covers

  • The techniques that make serving faster and cheaper, and what each trades away
  • Setting latency and availability targets customers can rely on
  • Planning GPUGraphics processing unit. The chips most AI models are trained and served on. Read the full explanation capacity and cost against uncertain demand
Inference and serving

Unlocks

None

Why it matters, by role

  • AI Infrastructure PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation: this is your specialism.
  • AI TPMTechnical Program Manager. Owns plans, dependencies, risks and delivery for large cross-team programmes. Read the full explanation: capacity and deployment programmes build on it.
  • AI Platform PM: your rate limits and pricing depend on it.

Lessons

  1. The serving stack
  2. Latency and availability targets
  3. Capacity and cost planning

The serving stack

Serving a model efficiently uses several techniques together:

Technique What it does Trade-off
Continuous batching Adds and removes requests from the running batch as they arrive and finish Higher throughput; some per-request latency
KV cacheKey-value cache. Stored attention keys and values that let a model generate each new token without recomputing the whole context. Read the full explanation management Stores attention data efficiently and reuses shared prompt prefixes Memory complexity
Quantisation Uses lower-precision numbers for weights Less memory and faster; possible quality loss
Speculative decoding A small model drafts tokens; the large model checks several at once Faster output when drafts are often right
Parallelism across GPUs Splits a large model over several GPUs Needed for big models; adds communication overhead

An infrastructure PM doesn't implement these, but must know what each buys and costs, because they decide which to prioritise.

Latency and availability targets

Customers need promises they can build on. Typical targets:

  • Time to first token: how quickly a response starts, for example under one second at the 95th percentile.
  • Output speed: tokens per second once generating.
  • Availability: share of requests that succeed, for example 99.9% per month.
  • Error budget: the failures allowed by the availability target, used to decide when to slow down releases.

Set targets per product tier: interactive chat needs fast first tokens; batch processing needs throughput and low cost, not speed. Measure at high percentiles, not averages; users remember the slow requests.

Capacity and cost planning

GPU capacity is expensive and slow to add, so planning matters:

  1. Forecast demand: tokens per second at peak, by model, with a range not a single number.
  2. Convert to GPUs: peak demand ÷ throughput per GPU at your latency target, plus headroom for failures and spikes.
  3. Choose how to buy: reserved capacity (cheaper, committed) for the base; on-demand or burst for peaks.
  4. Raise utilisation: share capacity across products, run batch work in quiet hours, scale down idle models.
  5. Track cost per million tokens by model, and feed it into pricing.

The core tension: too little capacity means outages and rate limits; too much means idle, very expensive hardware.

Questions

Rubric

Dimension Weak Passable Strong
Serving techniques "Add more GPUs" Names some techniques Knows what each technique buys and costs, and prioritises
Targets "Make it fast" Latency and uptime targets Percentile targets, error budgets, by product tier
Capacity Guesses Demand → GPUs Forecast ranges, headroom, reserved vs on-demand, utilisation
Cost Ignores it Tracks total spend Cost per million tokens by model, linked to pricing

Next modules

This is the end of its branch. Back to all modules.

Core for: AI Infrastructure PM