Unit 8 of 12 · about 4 hours · explain
Multi-tenant model and cache isolation, and prompt and trace privacy
Sharing one fleet across tenants without boundaries turns every burst into everyone's incident, and every shared cache into a privacy review.
You'll be able to
- Explain the three noisy-neighbor channels (KV memory, network, time-sharing) and which quota stops each.
- Choose quota, priority and bulkhead isolation per tier, and state what each costs.
- Define the prompt, output and trace retention policy: what is logged, salted, billed and deleted.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Multi-tenancy and isolationMachine Learning Systems, Volume 2 - Inference at Scale and Serving Fault Tolerance
Multi-Tenancy and Isolation: the noisy-neighbor Example 1.18 with Table 35 (all tenants violated at 22 to 45ms) versus quotas in Example 1.19 with Table 36 (only the burster throttled); Listing 1 quota admission (
max_concurrent_requests,max_kv_cache_mb,max_qps,max_batch_tokens; its own check readsquota.max_concurrent, a mismatch to fix in your port); max-min fairness in token rate; Table 37 priority tiers; the bulkhead Figure 20 with Example 1.20; Listing 2 model-load eviction guard (page read 2026-10-14) - Tenant-aware model selectionHands-On LLM Serving and Optimization - Chapters 3 and 4, serving system design
Chapter 4, Implementing Model Selection (printed pp. 129-130):
choose_endpointwith canary weight, tenant overrideroute["tenants"][tenant]["url"], and 404 on unknown model - vLLM prefix-cache saltvLLM Online Serving, Architecture and Production Metrics
Chat and Completions extra parameters:
cache_salt(up to 1024 characters) salting the prefix cache against prompt guessing in multi-user environments - Security, compliance and data handlingInference Engineering - Chapter 7, Production
Section 7.3.4 (printed p. 198): the three areas (user data, weights, infrastructure), the rule against storing inputs and outputs without a retention need, and data-residency routing; Section 7.4.3 (printed p. 203): server and audit logs as the observability record
Focus on
- Bursts propagate through three channels at once: long sequences swell KV and evict others, large responses saturate egress, and time-sharing adds variance. One quota on request count stops none of them; quota KV megabytes, token rate and concurrency together.
- Isolation is a ladder with explicit costs: quotas throttle the burster, priorities preempt for critical tiers, bulkheads dedicate replicas at idle cost. Soft quotas flex below 50% utilization and harden near 90%.
- Shared prefix state is a cross-tenant channel. Salt the cache per tenant and scope affinity keys by tenant and version, or a timing probe guesses another tenant's prompt.
- Retention is a design choice with a default of least data: log IDs, sizes, latencies and salted hashes for billing and debugging; keep raw prompts and outputs only with a declared need, owner and deletion path.
Common mistakes · 3
- Treating equal request counts as fair shares. A long summarization tenant consumes the KV pool of many short-chat tenants; fairness is denominated in token-generation rate, not request count.
- Sharing one prefix cache across tenants for hit rate. Hits across tenants leak prompt bytes through timing; salt per tenant and accept the lower shared hit rate.
- Logging prompts to make debugging easy. The debug value is real and so is the breach surface; hash or drop raw text and keep the request ID as the join key.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.One tenant bursts 5x with no quotas. What happens to the other nine?Answer
All violate: P99 climbs to 22 to 30ms against a 10ms contract while the burster itself hits 45ms. Shared pools propagate one burst to every tenant.
2.Same burst with quotas. Who sees what?Answer
Only the burster is throttled (admitted at 120 with 50ms latency); the other nine hold 10ms. Quotas convert a fleet incident into one tenant's throttle.
3.Why is token-generation rate the fairness unit instead of request count?Answer
KV bytes and decode steps scale with tokens, so equal counts let long requests starve short ones. Rate in tokens per second bounds throughput and memory together.
4.What are the four per-tenant observability dimensions?Answer
Request volume with P50/P95/P99 latency, GPU and KV utilization, throttling and preemption counts, and errors by type. Without them a quota violation is invisible until it becomes an SLO breach.
You're done when
You can replay both burst tables from memory and defend your retention policy field by field: logged, salted, billed or deleted.
Only when you can do this without notes.
Leads to
Notes
Resources · 4 for this unit, 9 more in the section
- vLLM Online Serving, Architecture and Production MetricsvLLM Project · primary
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) · required
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.
- Machine Learning Systems, Volume 2 - Inference at Scale and Serving Fault ToleranceHarvard (Vijay Janapa Reddi) · required
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.
- Inference Engineering - Chapter 7, ProductionPhilip Kiely (Baseten Books) · support
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.
Also in this section
- vLLM Production MetricsvLLM Project · required
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.
- Gateway API Inference ExtensionKubernetes SIG Network · required
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.
- SGLang documentation - Production MetricsSGLang Project · support
Compare its metric names and phase boundaries with vLLM's, so your dashboards do not depend on one engine's vocabulary.
- AI Systems Performance Engineering - Production Inference LabsChris Fregly · required
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.
- 100 Days of LLM Inference - Days 22 to 26Elizabeth Thomas · support
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 · support
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 · support
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 · reference
Read the chat streaming event shape with the
[DONE]terminator, bearer auth, rate-limit headers, andx-request-idwith caller-suppliedX-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 · reference
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.