Marketplace
ml-system-design
End-to-end ML system design for production. Use when designing ML pipelines, feature stores, model training infrastructure, or serving systems. Covers the complete lifecycle from data ingestion to model deployment and monitoring.
allowed_tools: Read, Glob, Grep
$ Installieren
git clone https://github.com/melodic-software/claude-code-plugins /tmp/claude-code-plugins && cp -r /tmp/claude-code-plugins/plugins/systems-design/skills/ml-system-design ~/.claude/skills/claude-code-plugins// tip: Run this command in your terminal to install the skill
SKILL.md
name: ml-system-design description: End-to-end ML system design for production. Use when designing ML pipelines, feature stores, model training infrastructure, or serving systems. Covers the complete lifecycle from data ingestion to model deployment and monitoring. allowed-tools: Read, Glob, Grep
ML System Design
This skill provides frameworks for designing production machine learning systems, from data pipelines to model serving.
When to Use This Skill
Keywords: ML pipeline, machine learning system, feature store, model training, model serving, ML infrastructure, MLOps, A/B testing ML, feature engineering, model deployment
Use this skill when:
- Designing end-to-end ML systems for production
- Planning feature store architecture
- Designing model training pipelines
- Planning model serving infrastructure
- Preparing for ML system design interviews
- Evaluating ML platform tools and frameworks
ML System Architecture Overview
The ML System Lifecycle
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ML SYSTEM LIFECYCLE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ Data โโโโถโ Feature โโโโถโ Model โโโโถโ Model โโโโถโ Monitorโ โ
โ โ Ingestionโ โ Pipeline โ โ Training โ โ Serving โ โ & Eval โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ โ โ โ โ โ
โ โผ โผ โผ โผ โผ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ Data โ โ Feature โ โ Model โ โ Inferenceโ โ Metricsโ โ
โ โ Lake โ โ Store โ โ Registry โ โ Cache โ โ Store โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Components
| Component | Purpose | Examples |
|---|---|---|
| Data Ingestion | Collect raw data from sources | Kafka, Kinesis, Pub/Sub |
| Feature Pipeline | Transform raw data to features | Spark, Flink, dbt |
| Feature Store | Store and serve features | Feast, Tecton, Vertex AI |
| Model Training | Train and validate models | SageMaker, Vertex AI, Kubeflow |
| Model Registry | Version and track models | MLflow, Weights & Biases |
| Model Serving | Serve predictions | TensorFlow Serving, Triton, vLLM |
| Monitoring | Track model performance | Evidently, WhyLabs, Arize |
Feature Store Architecture
Why Feature Stores?
Problems without a feature store:
- Training-serving skew (features computed differently)
- Duplicate feature computation across teams
- No feature versioning or lineage
- Slow feature experimentation
Feature Store Components
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FEATURE STORE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ OFFLINE STORE โ โ ONLINE STORE โ โ
โ โ โ โ โ โ
โ โ - Historical data โ โ - Low-latency โ โ
โ โ - Training queries โ โโโโโถ โ - Point lookups โ โ
โ โ - Batch features โ sync โ - Real-time servingโ โ
โ โ โ โ โ โ
โ โ (Data Warehouse) โ โ (Redis, DynamoDB) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ FEATURE REGISTRY โโ
โ โ - Feature definitions - Version control โโ
โ โ - Data lineage - Access control โโ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Feature Types
| Type | Computation | Storage | Example |
|---|---|---|---|
| Batch | Scheduled (hourly/daily) | Offline โ Online | User purchase count (30 days) |
| Streaming | Real-time event processing | Direct to online | Items in cart (current) |
| On-demand | Request-time computation | Not stored | Distance to nearest store |
Training-Serving Consistency
TRAINING (Historical):
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Historical โโโโโถโ Point-in-Timeโโโโโถโ Training โ
โ Events โ โ Join โ โ Dataset โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
Uses feature
definitions
โ
SERVING (Real-time): โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Online โโโโโถโ Same Feature โโโโโถโ Prediction โ
โ Store โ โ Definitions โ โ Request โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
Model Training Infrastructure
Training Pipeline Components
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TRAINING PIPELINE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ Data โโโโถโ Feature โโโโถโ Model โโโโถโ Model โ โ
โ โ Loader โ โ Transformโ โ Train โ โ Validate โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ โ โ โ โ
โ โผ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ Experiment โ โ Hyperparameterโ โ Checkpoint โ โ Model โ โ
โ โ Tracking โ โ Tuning โ โ Storage โ โ Registry โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Training Infrastructure Patterns
| Pattern | Use Case | Tools |
|---|---|---|
| Single-node | Small datasets, quick experiments | Jupyter, local GPU |
| Distributed data-parallel | Large datasets, same model | Horovod, PyTorch DDP |
| Model-parallel | Large models that don't fit in memory | DeepSpeed, FSDP, Megatron |
| Hyperparameter tuning | Automated model optimization | Optuna, Ray Tune |
Experiment Tracking
Track for reproducibility:
| What to Track | Why |
|---|---|
| Hyperparameters | Reproduce training runs |
| Metrics | Compare model performance |
| Artifacts | Model files, datasets |
| Code version | Git commit hash |
| Environment | Docker image, dependencies |
| Data version | Dataset hash or snapshot |
Model Serving Architecture
Serving Patterns
| Pattern | Latency | Throughput | Use Case |
|---|---|---|---|
| Online (REST/gRPC) | Low (<100ms) | Medium | Real-time predictions |
| Batch | High (hours) | Very high | Bulk scoring |
| Streaming | Medium | High | Event-driven predictions |
| Embedded | Very low | Varies | Edge/mobile inference |
Online Serving Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MODEL SERVING SYSTEM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ Clients โ โ
โ โโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ Load Balancerโ โ
โ โโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ API Gateway โ โ
โ โ - Authentication - Rate limiting - Request validation โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ Model A โ โ Model B โ โ Model C โ โ
โ โ (v1.2) โ โ (v2.0) โ โ (v1.0) โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ Feature Store โ โ
โ โ (Online) โ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Latency Optimization
| Technique | Latency Impact | Trade-off |
|---|---|---|
| Batching | Reduces per-request | Increases latency for first request |
| Caching | 10-100x faster | May serve stale predictions |
| Quantization | 2-4x faster | Slight accuracy loss |
| Distillation | Variable | Training overhead |
| GPU inference | 10-100x faster | Cost increase |
A/B Testing ML Models
Experiment Design
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ A/B TESTING ARCHITECTURE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ Traffic โ โ
โ โโโโโโโโฌโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Experiment Assignment โ โโโโโโโโ Experiment Config โ
โ โ - User bucketing โ - Allocation % โ
โ โ - Feature flags โ - Target segments โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโ - Guardrails โ
โ โ โ
โ โโโโโโโโโโดโโโโโโโโโ โ
โ โผ โผ โ
โ โโโโโโโโโโ โโโโโโโโโโ โ
โ โControl โ โTreatmentโ โ
โ โModel A โ โModel B โ โ
โ โโโโโโฌโโโโ โโโโโโฌโโโโ โ
โ โ โ โ
โ โโโโโโโโโโฌโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ Metrics Logger โ โ
โ โโโโโโโโโโฌโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ Statistical โ โโโโโโถ Decision: Ship / Iterate / Kill โ
โ โ Analysis โ โ
โ โโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Metrics to Track
| Metric Type | Examples | Purpose |
|---|---|---|
| Model metrics | AUC, RMSE, precision/recall | Model quality |
| Business metrics | CTR, conversion, revenue | Business impact |
| Guardrail metrics | Latency, error rate, engagement | Prevent regressions |
| Segment metrics | Metrics by user segment | Detect heterogeneous effects |
Statistical Considerations
- Sample size: Calculate power before experiment
- Duration: Account for novelty effects and time patterns
- Multiple testing: Adjust for multiple metrics (Bonferroni, FDR)
- Early stopping: Use sequential testing methods
Model Monitoring
What to Monitor
| Category | Metrics | Alert Threshold |
|---|---|---|
| Data quality | Missing values, schema drift | >1% change |
| Feature drift | Distribution shift (PSI, KL) | PSI >0.2 |
| Prediction drift | Output distribution shift | Depends on use case |
| Model performance | Accuracy, AUC (when labels available) | >5% degradation |
| Operational | Latency, throughput, errors | SLO violations |
Drift Detection
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DRIFT DETECTION PIPELINE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Training Data Production Data โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Reference โ โ Current โ โ
โ โ Distribution โ โ Distribution โ โ
โ โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Statistical Test โ โ
โ โ - PSI (Population Stability Index) โ
โ โ - KS Test โ
โ โ - Chi-squared โ
โ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Drift Score โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโผโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ No Drift Warning Critical โ
โ (< 0.1) (0.1-0.2) (> 0.2) โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ Continue Investigate Retrain โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Common ML System Design Patterns
Pattern 1: Recommendation System
Components needed:
- Candidate Generation (retrieve 100s-1000s)
- Ranking Model (score and sort)
- Feature Store (user features, item features)
- Real-time personalization (recent behavior)
- A/B testing infrastructure
Pattern 2: Fraud Detection
Components needed:
- Real-time feature computation
- Low-latency model serving (<50ms)
- High recall focus (can't miss fraud)
- Explainability for compliance
- Human-in-the-loop review
- Feedback loop for labels
Pattern 3: Search Ranking
Components needed:
- Two-stage ranking (retrieval + ranking)
- Feature store for query/document features
- Low latency (<200ms end-to-end)
- Learning to rank models
- Click-through rate prediction
- A/B testing with interleaving
Estimation for ML Systems
Training Infrastructure
Training time estimation:
- Dataset size: 100M examples
- Model: Transformer (100M params)
- GPU: A100 (80GB, 312 TFLOPS)
- Batch size: 32
- Training steps: Dataset / batch = 3.1M steps
- Time per step: ~100ms
- Total time: ~86 hours single GPU
- With 8 GPUs (data parallel): ~11 hours
Serving Infrastructure
Inference estimation:
- QPS: 10,000
- Model latency: 20ms
- Batch size: 1 (real-time)
- GPU utilization: 50% (latency constraint)
- Requests per GPU/sec: 25
- GPUs needed: 10,000 / 25 = 400 GPUs
- With batching (batch 8): 100 GPUs (4x reduction)
Related Skills
llm-serving-patterns- LLM-specific serving and optimizationrag-architecture- Retrieval-Augmented Generation patternsvector-databases- Vector search and embeddingsml-inference-optimization- Latency and cost optimizationestimation-techniques- Back-of-envelope calculationsquality-attributes-taxonomy- NFR definitions
Related Commands
/sd:ml-pipeline <problem>- Design ML system interactively/sd:estimate <scenario>- Capacity calculations
Related Agents
ml-systems-designer- Design ML architecturesml-interviewer- Mock ML system design interviews
Version History
- v1.0.0 (2025-12-26): Initial release
Last Updated
Date: 2025-12-26 Model: claude-opus-4-5-20251101
Repository

melodic-software
Author
melodic-software/claude-code-plugins/plugins/systems-design/skills/ml-system-design
3
Stars
0
Forks
Updated2d ago
Added6d ago