Production Serving and Reliability

A fast model runner is only one component of a service. The production gate covers API semantics, lifecycle, overload, isolation, observability, rollout and recovery while preserving model quality.

Section 8 of 9 · 12 units · about 49 hours

0/12

By the end you can Meet the request and isolation contract under saturation, cancellation, worker death and bad rollout, then diagnose one seeded performance incident and one lifecycle or security incident from stored evidence and execute a clean drain and rollback.

Units

Build it

Mini project · about 12 to 16 hours

Reliable gateway with quotas, shedding and recovery drills

Build the gateway/ around a fitting engine with auth, quotas, routing, shedding, telemetry, SLOs, canary and runbooks. Fault drills prove bounded detection and clean recovery before fleet scale.

  1. 1Serve typed chat completions with SSE down to [DONE], per-request queue backpressure and a small fixed-schema structured output, checked against the ch03 stream tests and a vLLM stream. Keep raw bytes and reassembly.
  2. 2Add API-key auth, a token-bucket limiter with Retry-After, deadline propagation with upstream close, idempotent retries by x-request-id, and allow-listed media fetch, passing the Project 103 suite. Keep limiter and dedupe tests.
  3. 3Implement token-aware and prefix-hash routing with adapter affinity and FailOpen fallback, plus work-based admission with priority shedding and a budgeted breaker, checked against the day24 routing and burst drills. Keep replay counts and tail evidence.
  4. 4Split cold start into provision, load and warmup with liveness, readiness and inference-health probes and drain, then run a canary with rollback on error and tail gates, sized by compatibility, replica and reserve math from the day26 drills. Keep timings and gate evaluations.
  5. 5Enforce per-tenant quotas with salted prefix isolation and a cross-key attack drill, emit per-request logs, metrics and traces joined by request_id, and compute tiered SLOs with budget burn and goodput from raw records using the ch16 and ch17 bundles. Keep isolation and dashboard evidence.
  6. 6Kill a fitting engine under load to show bounded detection, reroute and rejoin, climb the degradation ladder through dependency and cache drills, roll back a bad version on canary gates, and write runbooks with first-cause timelines proven by recovery load tests. Keep all drill evidence.
What you hand in
  • gateway/ with auth, quotas, routing, shedding, probes, canary and SLO dashboards plus tests.
  • Isolation, telemetry and fault evidence: salted-cache tests, attack drill, traces and budget burn.
  • Runbooks with first-cause timelines and recovery load-test evidence showing clean return to SLO.
How to check it
How it's graded

Gateway and routing

Pass: Stream suites pass with [DONE] reassembly, limiter and dedupe tests pass, and routing with shedding shows tiered burst protection.

Great: A slow-reader case grows queues without pausing generation, and breaker trips are measured.

Isolation and SLOs

Pass: Quota and salted-cache tests show no cross-tenant hit, telemetry joins by request_id, and SLOs with goodput come from raw records.

Great: The key attack drill names first cause, and tier burn is tracked through the burst.

Failure and recovery

Pass: Worker, dependency, cache and bad-version drills store detection and recovery evidence, and runbooks with timelines execute cleanly.

Great: Recovery load tests return queues, KV and tails inside SLO with every request accounted.

Resources

  • vLLM Online Serving, Architecture and Production MetricsvLLM Project

    Trace the API server, engine core, scheduler, KV manager and model runner, then map documented metrics to your SLIs. The link is pinned to v0.31.0; add the auth, tenant, quality and rollout controls the engine leaves to you.

  • Hands-On LLM Serving and Optimization - Chapters 3 and 4, serving system designChi Wang and Peiheng Hu (O'Reilly)

    Read Chapter 3 (an online service from scratch, batching with streaming, multi-model trade-offs) and the enterprise-architecture part of Chapter 4. Convert the designs into explicit request, model-lifecycle and failure state machines.

  • vLLM Production MetricsvLLM Project

    Define every selected queue, cache, phase and request metric, check histogram buckets and measure exporter overhead. Add model version, cancellation, rejection, quality sample and tenant-safe trace fields in the surrounding service.

  • Machine Learning Systems, Volume 2 - Inference at Scale and Serving Fault ToleranceHarvard (Vijay Janapa Reddi)

    Read "Load Balancing and Request Routing", "Multi-Tenancy and Isolation" and "Autoscaling and Global Infrastructure" in Inference at Scale, then "Serving Fault Tolerance" and "Graceful Degradation" in the Fault Tolerance chapter.

  • Gateway API Inference ExtensionKubernetes SIG Network

    Study model-aware routing, endpoint selection and operational integration. Use it for architecture and an optional local deployment only after the service passes lifecycle and failure tests without Kubernetes.

  • AI Systems Performance Engineering - Production Inference LabsChris Fregly

    Use Chapter 16 monitoring, cache health, capacity planning and load-test utilities, then Chapter 17 routing only if distributed. Add process death, overload and bad-version cases that the performance pairs do not cover.

  • Inference Engineering - Chapter 7, ProductionPhilip Kiely (Baseten Books)

    Read Chapter 7 for containers, autoscaling, cold starts, routing and queueing, zero-downtime deployment, cost estimation and client-side streaming. Skip the vendor section at its end.

  • SGLang documentation - Production MetricsSGLang Project

    Compare its metric names and phase boundaries with vLLM's, so your dashboards do not depend on one engine's vocabulary.

  • 100 Days of LLM Inference - Days 22 to 26Elizabeth Thomas

    Use the container, autoscaling, routing, capacity and zero-downtime notebooks as small operational simulations. Replace calendar order and fixed scale targets with the stage checkpoint and your hardware limits.

  • AI Infrastructure Engineer Learning - Project 103 LLM DeploymentAI Infra Curriculum

    Use its Docker, API, monitoring, Kubernetes and cost files as scaffolding only. Check its resource assumptions against your own model and GPU, and rerun any benchmark before reusing a result.

  • LLM Inference Systems Laboratory - Operations and FailureRoadmap-Final

    Complete production gateway, isolation, telemetry, canary, drain, rollback and fault campaigns. Store first-cause timelines and revise runbooks from observed blind spots.

  • OpenAI API Reference - streaming, auth, rate limits and request IDsOpenAI

    Read the chat streaming event shape with the [DONE] terminator, bearer auth, rate-limit headers, and x-request-id with caller-supplied X-Client-Request-Id. vLLM is the implementation under test; use this only for the contract it claims compatibility with.

  • vLLM Multimodal Inputs - media validation, fetch policy and cache identityvLLM Project

    Read Online Serving for image, video and audio inputs: --allowed-media-domains, fetch timeouts, --limit-mm-per-prompt, local-media path restriction, and media UUIDs for cache identity. The link is pinned to v0.31.0.