Design an ML Model Serving Platform
A full Staff-level walkthrough of a Michelangelo-style model serving platform that runs 100+ heterogeneous models at 5M+ predictions per second while holding end-to-end p99 under 10ms — budgeting every millisecond across an online feature store, GPU inference, and dynamic batching, then layering canary deployment, drift detection, and multi-model GPU packing to keep cost in check. Follow it top to bottom, or jump to any step.
Scope & ambiguity
“Uber runs 100+ ML models in production covering ride matching, ETA prediction, surge pricing, fraud detection, Uber Eats ranking, and driver incentive optimization. These models span simple logistic regressions to deep neural networks, each with different latency, throughput, and freshness requirements. The core challenge is building a unified model serving platform (Michelangelo) that can serve all of these models with p99 < 10ms while managing the full model lifecycle — from feature computation through inference to monitoring. I’ll focus on the serving architecture, feature store design, inference optimization, and production monitoring.”
Phased delivery:
Team ownership:
Key ambiguity I’d challenge:
“When we say p99 < 10ms, does that include feature retrieval time or just raw model inference? Because the end-to-end budget changes the architecture significantly — if features must be fetched online, we need a precomputed feature store with sub-2ms reads. If we only mean inference, we have more headroom. I’ll design for the harder case: end-to-end p99 < 10ms including feature fetch.”
Requirements
Functional Requirements (Phase 1)
- FR1: Serve predictions for any registered model via a unified gRPC/REST API
- FR2: Fetch precomputed features from the online feature store at inference time
- FR3: Support model versioning with instant rollback to previous versions
- FR4: Route traffic between model versions for A/B testing and canary deployments
- FR5: Provide a model registry with metadata, lineage, and deployment status
- FR6: Support both CPU and GPU inference backends depending on model complexity
Non-Functional Requirements
Out of Scope (Explicitly)
- Model training infrastructure (separate Michelangelo training pipeline)
- Feature engineering tooling (data scientists write features separately)
- Offline batch prediction (different system, not latency-critical)
Back-of-envelope estimation
Scale Numbers
GPU/Compute Estimation
Cost Estimation
Architectural implication: GPU cost dominates at 62% of total spend. This makes GPU utilization optimization the single highest-leverage engineering investment. Multi-model GPU sharing, dynamic batching, and model quantization directly hit the bottom line. A 10% improvement in GPU utilization saves ~$29K/month.
Deep dives
WHERE STAFF IS WONCore Decision: Inference Runtime — TF Serving vs Triton vs ONNX Runtime vs Custom
This is the foundational technical decision. Uber’s models span multiple frameworks (TensorFlow, PyTorch, XGBoost, LightGBM), so the runtime must handle heterogeneous model formats.
My recommendation: Triton Inference Server as the primary GPU runtime, with ONNX Runtime for CPU models, wrapped by a thin Uber-specific orchestration layer.
Rationale:
1. Triton’s multi-model GPU serving directly addresses our cost problem (GPU utilization)
2. Native dynamic batching with per-model configuration handles our heterogeneous latency requirements
3. TensorRT integration gives us the best inference performance on NVIDIA hardware
4. The orchestration wrapper handles Uber-specific concerns: feature fetching, routing, A/B testing, monitoring — things no off-the-shelf runtime covers
5. ONNX Runtime for CPU models avoids GPU overhead for simple models (fraud scoring, basic classifiers)
Why not pure custom: Uber originally built much of Michelangelo custom. The operational cost of maintaining a custom inference runtime (GPU memory management, kernel optimization, batching logic) is enormous. Triton handles the hard GPU-level problems while our wrapper handles the Uber-specific orchestration.
End-to-End Latency Budget Breakdown
Every millisecond matters when the total budget is 10ms. Here is the detailed waterfall:
Feature Store Design
The feature store is the critical path component that most teams underestimate. Uber’s feature store must serve 15M+ reads/second with sub-2ms p99.
Feature freshness tiers:
Precomputed vs on-demand features — decision framework:
Feature consistency between training and serving (train-serve skew prevention):
Model Registry Internals
The model registry is the system of record for every model artifact, its metadata, and its deployment state.
Canary deployment protocol:
Inference Optimization Deep Dive
Meeting p99 < 10ms with complex neural networks requires multiple optimization layers.
Quantization tradeoffs with concrete numbers:
Dynamic batching strategy with latency math:
Model compilation pipeline:
GPU Cluster Management
With 200+ A100 GPUs at ~$290K/month, efficient resource management is critical.
Multi-model GPU serving:
Resource isolation and QoS:
Cost optimization strategies:
Request Routing & Load Balancing
A/B testing infrastructure:
Shadow traffic for pre-deployment validation:
Model Monitoring & Drift Detection
Statistical drift detection methods:
Drift detection implementation:
Automated retraining trigger:
Rollout & evolution
Rollout Strategy
Phase 1 rollout (months 1-3): Top 20 models
1. Deploy Triton cluster with 50 GPUs, onboard ETA model first (highest QPS, best-understood)
2. Feature store: migrate ETA’s features from legacy store to new Redis-backed store
3. Run shadow traffic for 2 weeks, validate latency and prediction parity
4. Canary 1% → 5% → 25% → 100% over 1 week
5. Onboard remaining 19 critical models one per week
6. Legacy Michelangelo serving runs in parallel (no decommission yet)
Phase 2 rollout (months 4-9): Remaining 100+ models
- Self-service onboarding: model teams register model, platform handles optimization + deployment
- Automated compilation pipeline (ONNX → TensorRT) for all GPU models
- GPU multi-model packing activated (target: 3-5 models per GPU)
Rollback Plan
Bottleneck Analysis
Observability
Key dashboards (per model):
Distributed tracing (end-to-end):
- Trace ID propagated from caller → gateway → feature store → Triton → response
- Each span includes: model_version, batch_size, gpu_id, feature_cache_hit_rate
- Sampled at 1% for normal traffic, 100% for errors and SLA violations
2-3 Year Evolution
Year 1: Foundation
- Unified serving platform operational for 100+ models
- Online feature store with sub-2ms reads
- GPU cluster with multi-model serving, 70%+ utilization
- Canary deployment and automated rollback
- Model monitoring with drift detection and alerting
- Operational maturity: on-call runbook, incident playbook, weekly reliability review
Year 2: Intelligence & Efficiency
- Automated retraining pipelines (zero-touch for standard models)
- Model compression toolkit (auto-quantization, distillation for new model versions)
- Advanced A/B testing with multi-armed bandit for model selection
- GPU cost optimization: 30% reduction through better packing + spot instances
- Feature store v2: support for embedding features, vector similarity lookups
- Real-time feature pipelines covering 80%+ of features (reduce batch staleness)
- Self-service model onboarding (< 1 hour from trained model to production)
Year 3: Next Generation
- LLM serving infrastructure (KV-cache management, speculative decoding, long-context)
- On-device/edge inference for latency-critical mobile predictions (e.g., driver app ETA)
- Online learning: models update weights incrementally from streaming data (no full retrain)
- Multi-modal models: single model consumes map, text, images (restaurant photos for Eats)
- Foundation model fine-tuning platform: teams fine-tune shared base models for their use case
- Cross-region model serving: serve predictions from nearest region with globally consistent feature store
- Carbon-aware scheduling: shift batch inference to regions with cleaner energy grid
Rubric — Senior vs Staff
Want more breakdowns like this?
Join free early access for upcoming RAG, LLM eval, agents, and AI infrastructure walkthroughs.