Using ML Production
Overview
This meta-skill routes you to the right production deployment skill based on your concern. Load this when you need to move ML models to production but aren't sure which specific aspect to address.
Core Principle: Production concerns fall into four categories. Identify the concern first, then route to the appropriate skill. Tools and infrastructure choices are implementation details, not routing criteria.
When to Use
Load this skill when:
- Deploying ML models to production
- Optimizing model inference (speed, size, cost)
- Setting up MLOps workflows (tracking, automation, CI/CD)
- Monitoring or debugging production models
- User mentions: "production", "deploy", "serve model", "MLOps", "monitoring", "optimize inference"
Don't use for: Training optimization (use training-optimization), model architecture selection (use neural-architectures), PyTorch infrastructure (use pytorch-engineering)
How to Access Reference Sheets
IMPORTANT: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
When this skill is loaded from:
skills/using-ml-production/SKILL.md
Reference sheets like quantization-for-inference.md are at:
skills/using-ml-production/quantization-for-inference.md
NOT at:
skills/quantization-for-inference.md ← WRONG PATH
When you see a link like [quantization-for-inference.md](quantization-for-inference.md), read the file from the same directory as this SKILL.md.
Routing by Concern
Category 1: Model Optimization
Symptoms: "Model too slow", "inference latency high", "model too large", "need to optimize for edge", "reduce model size", "speed up inference"
When to route here:
- Model itself is the bottleneck (not infrastructure)
- Need to reduce model size or increase inference speed
- Deploying to resource-constrained hardware (edge, mobile)
- Cost optimization through model efficiency
Routes to:
- quantization-for-inference.md - Reduce precision (INT8/INT4), speed up inference
- model-compression-techniques.md - Pruning, distillation, architecture optimization
- hardware-optimization-strategies.md - GPU/CPU/edge tuning, batch sizing
Key question to ask: "Is the MODEL the bottleneck, or is it infrastructure/serving?"
Category 2: Serving Infrastructure
Symptoms: "How to serve model", "need API endpoint", "deploy to production", "containerize model", "scale serving", "load balancing", "traffic management"
When to route here:
- Need to expose model as API or service
- Questions about serving patterns (REST, gRPC, batch)
- Deployment strategies (gradual rollout, A/B testing)
- Scaling concerns (traffic, replicas, autoscaling)
Routes to:
- model-serving-patterns.md - FastAPI, TorchServe, gRPC, ONNX, batching, containerization
- deployment-strategies.md - A/B testing, canary, shadow mode, rollback procedures
- scaling-and-load-balancing.md - Horizontal scaling, autoscaling, load balancing, cost optimization
Key distinction:
- Serving patterns = HOW to expose model (API, container, batching)
- Deployment strategies = HOW to roll out safely (gradual, testing, rollback)
- Scaling = HOW to handle traffic (replicas, autoscaling, balancing)
Category 3: MLOps Tooling
Symptoms: "Track experiments", "version models", "automate deployment", "reproducibility", "CI/CD for ML", "feature store", "model registry", "experiment management"
When to route here:
- Need workflow/process improvements
- Want to track experiments or version models
- Need to automate training-to-deployment pipeline
- Team collaboration and reproducibility concerns
Routes to:
- experiment-tracking-and-versioning.md - MLflow, Weights & Biases, model registries, reproducibility, lineage
- mlops-pipeline-automation.md - CI/CD for ML, feature stores, data validation, automated retraining, orchestration
Key distinction:
- Experiment tracking = Research/development phase (track runs, version models)
- Pipeline automation = Production phase (automate workflows, CI/CD)
Multi-concern: Queries like "track experiments AND automate deployment" → route to BOTH skills
Category 4: Observability
Symptoms: "Monitor production", "model degrading", "detect drift", "production debugging", "alert on failures", "model not working in prod", "performance issues in production"
When to route here:
- Model already deployed, need to monitor or debug
- Detecting production issues (drift, errors, degradation)
- Setting up alerts and dashboards
- Root cause analysis for production failures
Routes to:
- production-monitoring-and-alerting.md - Metrics, drift detection, dashboards, alerts, SLAs
- production-debugging-techniques.md - Error analysis, profiling, rollback procedures, post-mortems
Key distinction:
- Monitoring = Proactive (set up metrics, alerts, detect issues early)
- Debugging = Reactive (diagnose and fix existing issues)
"Performance" ambiguity:
- If "performance" = speed/latency → might be Category 1 (optimization) or Category 2 (serving/scaling)
- If "performance" = accuracy degradation → Category 4 (observability - drift detection)
- Ask clarifying question: "By performance, do you mean inference speed or model accuracy?"
Routing Decision Tree
User query → Identify primary concern
Is model THE problem (size/speed)?
YES → Category 1: Model Optimization
NO → Continue
Is it about HOW to expose/deploy model?
YES → Category 2: Serving Infrastructure
NO → Continue
Is it about workflow/process/automation?
YES → Category 3: MLOps Tooling
NO → Continue
Is it about monitoring/debugging in production?
YES → Category 4: Observability
NO → Ask clarifying question
Ambiguous? → Ask ONE question to clarify concern category
Clarification Questions for Ambiguous Queries
Query: "My model is too slow"
Ask: "Is this inference latency (how fast predictions are), or training time?"
- Training → Route to
training-optimization (wrong pack)
- Inference → Follow-up: "Have you profiled to find bottlenecks?"
- Model is bottleneck → Category 1 (optimization)
- Infrastructure/batching issue → Category 2 (serving)
Query: "I need to deploy my model"
Ask: "What's your deployment target - cloud server, edge device, or batch processing?"
- Cloud/server → Category 2 (serving-patterns, then maybe deployment-strategies if gradual rollout needed)
- Edge/mobile → Category 1 (optimization first for size/speed) + Category 2 (serving)
- Batch → Category 2 (serving-patterns - batch processing)
Query: "My model isn't performing well in production"
Ask: "By performance, do you mean inference speed or prediction accuracy?"
- Speed → Category 1 (optimization) or Category 2 (serving/scaling)
- Accuracy → Category 4 (observability - drift detection, monitoring)
Query: "Set up MLOps for my team"
Ask: "What's the current pain point - experiment tracking, automated deployment, or both?"
- Tracking/versioning → Category 3 (experiment-tracking-and-versioning)
- Automation/CI/CD → Category 3 (mlops-pipeline-automation)
- Both → Route to BOTH skills
Multi-Concern Scenarios
Some queries span multiple categories. Route to ALL relevant skills in logical order:
| Scenario |
Route Order |
Why |
| "Optimize and deploy model" |
1. Optimization → 2. Serving |
Optimize BEFORE deploying |
| "Deploy and monitor model" |
1. Serving → 2. Observability |
Deploy BEFORE monitoring |
| "Track experiments and automate deployment" |
1. Experiment tracking → 2. Pipeline automation |
Track BEFORE automating |
| "Quantize model and serve with TorchServe" |
1. Quantization → 2. Serving patterns |
Optimize BEFORE serving |
| "Deploy with A/B testing and monitor" |
1. Deployment strategies → 2. Monitoring |
Deploy strategy BEFORE monitoring |
Principle: Route in execution order (what needs to happen first).
Relationship with Other Packs
With llm-specialist
ml-production covers: General serving, quantization, deployment, monitoring (universal patterns)
llm-specialist covers: LLM-specific optimization (KV cache, prompt caching, speculative decoding, token streaming)
When to use both:
- "Deploy LLM to production" → llm-specialist (for inference-optimization) + ml-production (for serving, monitoring)
- "Quantize LLM" → llm-specialist (LLM-specific quantization patterns) OR ml-production (general quantization)
Rule of thumb: LLM-specific optimization stays in llm-specialist. General production patterns use ml-production.
With training-optimization
Clear boundary:
- training-optimization = Training phase (convergence, hyperparameters, training speed)
- ml-production = Inference phase (deployment, serving, monitoring)
"Too slow" disambiguation:
- Training slow → training-optimization
- Inference slow → ml-production
With pytorch-engineering
pytorch-engineering covers: Foundation (distributed training, profiling, memory management)
ml-production covers: Production-specific (serving APIs, deployment patterns, MLOps)
When to use both:
- "Profile production inference" → pytorch-engineering (profiling techniques) + ml-production (production context)
- "Optimize serving performance" → ml-production (serving patterns) + pytorch-engineering (if need low-level profiling)
Common Routing Mistakes
| Query |
Wrong Route |
Correct Route |
Why |
| "Model too slow in production" |
Immediately to quantization |
Ask: inference or training? Then model vs infrastructure? |
Could be serving/batching issue, not model |
| "Deploy with Kubernetes" |
Defer to Kubernetes docs |
Category 2: serving-patterns or deployment-strategies |
Kubernetes is tool choice, not routing concern |
| "Set up MLOps" |
Route to one skill |
Ask about specific pain point, might be both tracking AND automation |
MLOps spans multiple skills |
| "Performance issues" |
Assume accuracy |
Ask: speed or accuracy? |
Performance is ambiguous |
| "We use TorchServe" |
Skip routing |
Still route to serving-patterns |
Tool choice doesn't change routing |
Common Rationalizations (Don't Do These)
| Excuse |
Reality |
| "User mentioned Kubernetes, route to deployment" |
Tools are implementation details. Route by concern first. |
| "Slow = optimization, route to quantization" |
Slow could be infrastructure. Clarify model vs serving bottleneck. |
| "They said deploy, must be serving-patterns" |
Could need serving + deployment-strategies + monitoring. Don't assume single concern. |
| "MLOps = experiment tracking" |
MLOps spans tracking AND automation. Ask which pain point. |
| "Performance obviously means speed" |
Could mean accuracy. Clarify inference speed vs prediction quality. |
| "They're technical, skip clarification" |
Technical users still benefit from clarifying questions. |
Red Flags Checklist
If you catch yourself thinking ANY of these, STOP and clarify:
- "I'll guess optimization vs serving" → ASK which is the bottleneck
- "Performance probably means speed" → ASK speed or accuracy
- "Deploy = serving-patterns only" → Consider deployment-strategies and monitoring too
- "They mentioned [tool], route based on tool" → Route by CONCERN, not tool
- "MLOps = one skill" → Could span experiment tracking AND automation
- "Skip question to save time" → Clarifying prevents wrong routing
When in doubt: Ask ONE clarifying question. 10 seconds of clarification prevents minutes of wrong-skill loading.
Routing Summary Table
| User Concern |
Ask Clarifying |
Route To |
Also Consider |
| Model slow/large |
Inference or training? |
Optimization skills |
If inference, check serving too |
| Deploy model |
Target (cloud/edge/batch)? |
Serving patterns |
Deployment strategies for gradual rollout |
| Production monitoring |
Proactive or reactive? |
Monitoring OR debugging |
Both if setting up + fixing issues |
| MLOps setup |
Tracking or automation? |
Experiment tracking AND/OR automation |
Often both needed |
| Performance issues |
Speed or accuracy? |
Optimization OR observability |
Depends on clarification |
| Scale serving |
Traffic pattern? |
Scaling-and-load-balancing |
Serving patterns if not set up yet |
Integration Examples
Example 1: Full Production Pipeline
Query: "I trained a model, now I need to put it in production"
Routing:
- Ask: "What's your deployment target and are there performance concerns?"
- If "cloud deployment, model is fast enough":
- model-serving-patterns.md (expose as API)
- deployment-strategies.md (if gradual rollout needed)
- production-monitoring-and-alerting.md (set up observability)
- If "edge device, model too large":
- quantization-for-inference.md (reduce size first)
- model-serving-patterns.md (edge deployment pattern)
- production-monitoring-and-alerting.md (if possible on edge)
Example 2: Optimization Decision
Query: "My inference is slow"
Routing:
- Ask: "Have you profiled to find the bottleneck - is it the model or serving infrastructure?"
- If "not profiled yet":
- production-debugging-techniques.md (profile first to diagnose)
- Then route based on findings
- If "model is bottleneck":
- hardware-optimization-strategies.md (check if hardware tuning helps)
- If not enough → quantization-for-inference.md or model-compression-techniques.md
- If "infrastructure/batching is bottleneck":
- model-serving-patterns.md (batching strategies)
- scaling-and-load-balancing.md (if traffic-related)
Example 3: MLOps Maturity
Query: "We need better ML workflows"
Routing:
- Ask: "What's the current pain point - can't reproduce experiments, manual deployment, or both?"
- If "can't reproduce, need to track experiments":
- experiment-tracking-and-versioning.md
- If "manual deployment is slow":
- mlops-pipeline-automation.md
- If "both reproducibility and automation":
- experiment-tracking-and-versioning.md (establish tracking first)
- mlops-pipeline-automation.md (then automate workflow)
When NOT to Use ml-production Skills
Skip ml-production when:
- Still designing/training model → Use neural-architectures, training-optimization
- PyTorch infrastructure issues → Use pytorch-engineering
- LLM-specific optimization only → Use llm-specialist (unless also need serving)
- Classical ML deployment → ml-production still applies but consider if gradient boosting/sklearn instead
Red flag: If model isn't trained yet, probably don't need ml-production. Finish training first.
Success Criteria
You've routed correctly when:
- ✅ Identified concern category (optimization, serving, MLOps, observability)
- ✅ Asked clarifying question for ambiguous queries
- ✅ Routed to appropriate skill(s) in logical order
- ✅ Didn't let tool choices (Kubernetes, TorchServe) dictate routing
- ✅ Recognized multi-concern scenarios and routed to multiple skills
ML Production Specialist Skills Catalog
After routing, load the appropriate specialist skill for detailed guidance:
- quantization-for-inference.md - INT8/INT4 quantization, post-training quantization, quantization-aware training, precision reduction for inference speed
- model-compression-techniques.md - Pruning (structured/unstructured), knowledge distillation, architecture optimization, model size reduction
- hardware-optimization-strategies.md - GPU/CPU/edge tuning, batch sizing, memory optimization, hardware-specific acceleration (TensorRT, ONNX Runtime)
- model-serving-patterns.md - FastAPI, TorchServe, gRPC, ONNX, batching strategies, containerization (Docker), REST/gRPC APIs
- deployment-strategies.md - A/B testing, canary deployment, shadow mode, gradual rollout, rollback procedures, blue-green deployment
- scaling-and-load-balancing.md - Horizontal scaling, autoscaling, load balancing, traffic management, cost optimization, replica management
- experiment-tracking-and-versioning.md - MLflow, Weights & Biases, model registries, experiment reproducibility, model lineage, versioning
- mlops-pipeline-automation.md - CI/CD for ML, feature stores, data validation, automated retraining, orchestration (Airflow, Kubeflow)
- production-monitoring-and-alerting.md - Metrics tracking, drift detection, dashboards, alerting, SLAs, proactive monitoring
- production-debugging-techniques.md - Error analysis, production profiling, rollback procedures, post-mortems, root cause analysis
References
- See design doc:
docs/plans/2025-10-30-ml-production-pack-design.md
- Primary router:
yzmir/ai-engineering-expert/using-ai-engineering
- Related packs:
llm-specialist/using-llm-specialist, training-optimization/using-training-optimization
1---2name: using-ml-production3description: Router skill directing to deployment, optimization, MLOps, and monitoring guides.4---5
6# Using ML Production
7
8## Overview
9
10This meta-skill routes you to the right production deployment skill based on your concern. Load this when you need to move ML models to production but aren't sure which specific aspect to address.
11
12**Core Principle**: Production concerns fall into four categories. Identify the concern first, then route to the appropriate skill. Tools and infrastructure choices are implementation details, not routing criteria.
13
14## When to Use
15
16Load this skill when:
17- Deploying ML models to production
18- Optimizing model inference (speed, size, cost)
19- Setting up MLOps workflows (tracking, automation, CI/CD)
20- Monitoring or debugging production models
21- User mentions: "production", "deploy", "serve model", "MLOps", "monitoring", "optimize inference"
22
23**Don't use for**: Training optimization (use `training-optimization`), model architecture selection (use `neural-architectures`), PyTorch infrastructure (use `pytorch-engineering`)
24
25---
26
27## How to Access Reference Sheets
28
29**IMPORTANT**: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
30
31When this skill is loaded from:
32 `skills/using-ml-production/SKILL.md`
33
34Reference sheets like `quantization-for-inference.md` are at:
35 `skills/using-ml-production/quantization-for-inference.md`
36
37NOT at:
38 `skills/quantization-for-inference.md` ← WRONG PATH
39
40When you see a link like `[quantization-for-inference.md](quantization-for-inference.md)`, read the file from the same directory as this SKILL.md.
41
42---
43
44## Routing by Concern
45
46### Category 1: Model Optimization
47
48**Symptoms**: "Model too slow", "inference latency high", "model too large", "need to optimize for edge", "reduce model size", "speed up inference"
49
50**When to route here**:
51- Model itself is the bottleneck (not infrastructure)
52- Need to reduce model size or increase inference speed
53- Deploying to resource-constrained hardware (edge, mobile)
54- Cost optimization through model efficiency
55
56**Routes to**:
57- [quantization-for-inference.md](quantization-for-inference.md) - Reduce precision (INT8/INT4), speed up inference
58- [model-compression-techniques.md](model-compression-techniques.md) - Pruning, distillation, architecture optimization
59- [hardware-optimization-strategies.md](hardware-optimization-strategies.md) - GPU/CPU/edge tuning, batch sizing
60
61**Key question to ask**: "Is the MODEL the bottleneck, or is it infrastructure/serving?"
62
63---
64
65### Category 2: Serving Infrastructure
66
67**Symptoms**: "How to serve model", "need API endpoint", "deploy to production", "containerize model", "scale serving", "load balancing", "traffic management"
68
69**When to route here**:
70- Need to expose model as API or service
71- Questions about serving patterns (REST, gRPC, batch)
72- Deployment strategies (gradual rollout, A/B testing)
73- Scaling concerns (traffic, replicas, autoscaling)
74
75**Routes to**:
76- [model-serving-patterns.md](model-serving-patterns.md) - FastAPI, TorchServe, gRPC, ONNX, batching, containerization
77- [deployment-strategies.md](deployment-strategies.md) - A/B testing, canary, shadow mode, rollback procedures
78- [scaling-and-load-balancing.md](scaling-and-load-balancing.md) - Horizontal scaling, autoscaling, load balancing, cost optimization
79
80**Key distinction**:
81- Serving patterns = HOW to expose model (API, container, batching)
82- Deployment strategies = HOW to roll out safely (gradual, testing, rollback)
83- Scaling = HOW to handle traffic (replicas, autoscaling, balancing)
84
85---
86
87### Category 3: MLOps Tooling
88
89**Symptoms**: "Track experiments", "version models", "automate deployment", "reproducibility", "CI/CD for ML", "feature store", "model registry", "experiment management"
90
91**When to route here**:
92- Need workflow/process improvements
93- Want to track experiments or version models
94- Need to automate training-to-deployment pipeline
95- Team collaboration and reproducibility concerns
96
97**Routes to**:
98- [experiment-tracking-and-versioning.md](experiment-tracking-and-versioning.md) - MLflow, Weights & Biases, model registries, reproducibility, lineage
99- [mlops-pipeline-automation.md](mlops-pipeline-automation.md) - CI/CD for ML, feature stores, data validation, automated retraining, orchestration
100
101**Key distinction**:
102- Experiment tracking = Research/development phase (track runs, version models)
103- Pipeline automation = Production phase (automate workflows, CI/CD)
104
105**Multi-concern**: Queries like "track experiments AND automate deployment" → route to BOTH skills
106
107---
108
109### Category 4: Observability
110
111**Symptoms**: "Monitor production", "model degrading", "detect drift", "production debugging", "alert on failures", "model not working in prod", "performance issues in production"
112
113**When to route here**:
114- Model already deployed, need to monitor or debug
115- Detecting production issues (drift, errors, degradation)
116- Setting up alerts and dashboards
117- Root cause analysis for production failures
118
119**Routes to**:
120- [production-monitoring-and-alerting.md](production-monitoring-and-alerting.md) - Metrics, drift detection, dashboards, alerts, SLAs
121- [production-debugging-techniques.md](production-debugging-techniques.md) - Error analysis, profiling, rollback procedures, post-mortems
122
123**Key distinction**:
124- Monitoring = Proactive (set up metrics, alerts, detect issues early)
125- Debugging = Reactive (diagnose and fix existing issues)
126
127**"Performance" ambiguity**:
128- If "performance" = speed/latency → might be Category 1 (optimization) or Category 2 (serving/scaling)
129- If "performance" = accuracy degradation → Category 4 (observability - drift detection)
130- **Ask clarifying question**: "By performance, do you mean inference speed or model accuracy?"
131
132---
133
134## Routing Decision Tree
135
136```
137User query → Identify primary concern
138
139Is model THE problem (size/speed)?
140 YES → Category 1: Model Optimization
141 NO → Continue
142
143Is it about HOW to expose/deploy model?
144 YES → Category 2: Serving Infrastructure
145 NO → Continue
146
147Is it about workflow/process/automation?
148 YES → Category 3: MLOps Tooling
149 NO → Continue
150
151Is it about monitoring/debugging in production?
152 YES → Category 4: Observability
153 NO → Ask clarifying question
154
155Ambiguous? → Ask ONE question to clarify concern category
156```
157
158---
159
160## Clarification Questions for Ambiguous Queries
161
162### Query: "My model is too slow"
163
164**Ask**: "Is this inference latency (how fast predictions are), or training time?"
165- Training → Route to `training-optimization` (wrong pack)
166- Inference → Follow-up: "Have you profiled to find bottlenecks?"
167 - Model is bottleneck → Category 1 (optimization)
168 - Infrastructure/batching issue → Category 2 (serving)
169
170### Query: "I need to deploy my model"
171
172**Ask**: "What's your deployment target - cloud server, edge device, or batch processing?"
173- Cloud/server → Category 2 (serving-patterns, then maybe deployment-strategies if gradual rollout needed)
174- Edge/mobile → Category 1 (optimization first for size/speed) + Category 2 (serving)
175- Batch → Category 2 (serving-patterns - batch processing)
176
177### Query: "My model isn't performing well in production"
178
179**Ask**: "By performance, do you mean inference speed or prediction accuracy?"
180- Speed → Category 1 (optimization) or Category 2 (serving/scaling)
181- Accuracy → Category 4 (observability - drift detection, monitoring)
182
183### Query: "Set up MLOps for my team"
184
185**Ask**: "What's the current pain point - experiment tracking, automated deployment, or both?"
186- Tracking/versioning → Category 3 (experiment-tracking-and-versioning)
187- Automation/CI/CD → Category 3 (mlops-pipeline-automation)
188- Both → Route to BOTH skills
189
190---
191
192## Multi-Concern Scenarios
193
194Some queries span multiple categories. Route to ALL relevant skills in logical order:
195
196| Scenario | Route Order | Why |
197|----------|-------------|-----|
198| "Optimize and deploy model" | 1. Optimization → 2. Serving | Optimize BEFORE deploying |
199| "Deploy and monitor model" | 1. Serving → 2. Observability | Deploy BEFORE monitoring |
200| "Track experiments and automate deployment" | 1. Experiment tracking → 2. Pipeline automation | Track BEFORE automating |
201| "Quantize model and serve with TorchServe" | 1. Quantization → 2. Serving patterns | Optimize BEFORE serving |
202| "Deploy with A/B testing and monitor" | 1. Deployment strategies → 2. Monitoring | Deploy strategy BEFORE monitoring |
203
204**Principle**: Route in execution order (what needs to happen first).
205
206---
207
208## Relationship with Other Packs
209
210### With llm-specialist
211
212**ml-production covers**: General serving, quantization, deployment, monitoring (universal patterns)
213
214**llm-specialist covers**: LLM-specific optimization (KV cache, prompt caching, speculative decoding, token streaming)
215
216**When to use both**:
217- "Deploy LLM to production" → llm-specialist (for inference-optimization) + ml-production (for serving, monitoring)
218- "Quantize LLM" → llm-specialist (LLM-specific quantization patterns) OR ml-production (general quantization)
219
220**Rule of thumb**: LLM-specific optimization stays in llm-specialist. General production patterns use ml-production.
221
222### With training-optimization
223
224**Clear boundary**:
225- training-optimization = Training phase (convergence, hyperparameters, training speed)
226- ml-production = Inference phase (deployment, serving, monitoring)
227
228**"Too slow" disambiguation**:
229- Training slow → training-optimization
230- Inference slow → ml-production
231
232### With pytorch-engineering
233
234**pytorch-engineering covers**: Foundation (distributed training, profiling, memory management)
235
236**ml-production covers**: Production-specific (serving APIs, deployment patterns, MLOps)
237
238**When to use both**:
239- "Profile production inference" → pytorch-engineering (profiling techniques) + ml-production (production context)
240- "Optimize serving performance" → ml-production (serving patterns) + pytorch-engineering (if need low-level profiling)
241
242---
243
244## Common Routing Mistakes
245
246| Query | Wrong Route | Correct Route | Why |
247|-------|-------------|---------------|-----|
248| "Model too slow in production" | Immediately to quantization | Ask: inference or training? Then model vs infrastructure? | Could be serving/batching issue, not model |
249| "Deploy with Kubernetes" | Defer to Kubernetes docs | Category 2: serving-patterns or deployment-strategies | Kubernetes is tool choice, not routing concern |
250| "Set up MLOps" | Route to one skill | Ask about specific pain point, might be both tracking AND automation | MLOps spans multiple skills |
251| "Performance issues" | Assume accuracy | Ask: speed or accuracy? | Performance is ambiguous |
252| "We use TorchServe" | Skip routing | Still route to serving-patterns | Tool choice doesn't change routing |
253
254---
255
256## Common Rationalizations (Don't Do These)
257
258| Excuse | Reality |
259|--------|---------|
260| "User mentioned Kubernetes, route to deployment" | Tools are implementation details. Route by concern first. |
261| "Slow = optimization, route to quantization" | Slow could be infrastructure. Clarify model vs serving bottleneck. |
262| "They said deploy, must be serving-patterns" | Could need serving + deployment-strategies + monitoring. Don't assume single concern. |
263| "MLOps = experiment tracking" | MLOps spans tracking AND automation. Ask which pain point. |
264| "Performance obviously means speed" | Could mean accuracy. Clarify inference speed vs prediction quality. |
265| "They're technical, skip clarification" | Technical users still benefit from clarifying questions. |
266
267---
268
269## Red Flags Checklist
270
271If you catch yourself thinking ANY of these, STOP and clarify:
272
273- "I'll guess optimization vs serving" → ASK which is the bottleneck
274- "Performance probably means speed" → ASK speed or accuracy
275- "Deploy = serving-patterns only" → Consider deployment-strategies and monitoring too
276- "They mentioned [tool], route based on tool" → Route by CONCERN, not tool
277- "MLOps = one skill" → Could span experiment tracking AND automation
278- "Skip question to save time" → Clarifying prevents wrong routing
279
280**When in doubt**: Ask ONE clarifying question. 10 seconds of clarification prevents minutes of wrong-skill loading.
281
282---
283
284## Routing Summary Table
285
286| User Concern | Ask Clarifying | Route To | Also Consider |
287|--------------|----------------|----------|---------------|
288| Model slow/large | Inference or training? | Optimization skills | If inference, check serving too |
289| Deploy model | Target (cloud/edge/batch)? | Serving patterns | Deployment strategies for gradual rollout |
290| Production monitoring | Proactive or reactive? | Monitoring OR debugging | Both if setting up + fixing issues |
291| MLOps setup | Tracking or automation? | Experiment tracking AND/OR automation | Often both needed |
292| Performance issues | Speed or accuracy? | Optimization OR observability | Depends on clarification |
293| Scale serving | Traffic pattern? | Scaling-and-load-balancing | Serving patterns if not set up yet |
294
295---
296
297## Integration Examples
298
299### Example 1: Full Production Pipeline
300
301**Query**: "I trained a model, now I need to put it in production"
302
303**Routing**:
3041. Ask: "What's your deployment target and are there performance concerns?"
3052. If "cloud deployment, model is fast enough":
306 - [model-serving-patterns.md](model-serving-patterns.md) (expose as API)
307 - [deployment-strategies.md](deployment-strategies.md) (if gradual rollout needed)
308 - [production-monitoring-and-alerting.md](production-monitoring-and-alerting.md) (set up observability)
3093. If "edge device, model too large":
310 - [quantization-for-inference.md](quantization-for-inference.md) (reduce size first)
311 - [model-serving-patterns.md](model-serving-patterns.md) (edge deployment pattern)
312 - [production-monitoring-and-alerting.md](production-monitoring-and-alerting.md) (if possible on edge)
313
314### Example 2: Optimization Decision
315
316**Query**: "My inference is slow"
317
318**Routing**:
3191. Ask: "Have you profiled to find the bottleneck - is it the model or serving infrastructure?"
3202. If "not profiled yet":
321 - [production-debugging-techniques.md](production-debugging-techniques.md) (profile first to diagnose)
322 - Then route based on findings
3233. If "model is bottleneck":
324 - [hardware-optimization-strategies.md](hardware-optimization-strategies.md) (check if hardware tuning helps)
325 - If not enough → [quantization-for-inference.md](quantization-for-inference.md) or [model-compression-techniques.md](model-compression-techniques.md)
3264. If "infrastructure/batching is bottleneck":
327 - [model-serving-patterns.md](model-serving-patterns.md) (batching strategies)
328 - [scaling-and-load-balancing.md](scaling-and-load-balancing.md) (if traffic-related)
329
330### Example 3: MLOps Maturity
331
332**Query**: "We need better ML workflows"
333
334**Routing**:
3351. Ask: "What's the current pain point - can't reproduce experiments, manual deployment, or both?"
3362. If "can't reproduce, need to track experiments":
337 - [experiment-tracking-and-versioning.md](experiment-tracking-and-versioning.md)
3383. If "manual deployment is slow":
339 - [mlops-pipeline-automation.md](mlops-pipeline-automation.md)
3404. If "both reproducibility and automation":
341 - [experiment-tracking-and-versioning.md](experiment-tracking-and-versioning.md) (establish tracking first)
342 - [mlops-pipeline-automation.md](mlops-pipeline-automation.md) (then automate workflow)
343
344---
345
346## When NOT to Use ml-production Skills
347
348**Skip ml-production when:**
349- Still designing/training model → Use neural-architectures, training-optimization
350- PyTorch infrastructure issues → Use pytorch-engineering
351- LLM-specific optimization only → Use llm-specialist (unless also need serving)
352- Classical ML deployment → ml-production still applies but consider if gradient boosting/sklearn instead
353
354**Red flag**: If model isn't trained yet, probably don't need ml-production. Finish training first.
355
356---
357
358## Success Criteria
359
360You've routed correctly when:
361- ✅ Identified concern category (optimization, serving, MLOps, observability)
362- ✅ Asked clarifying question for ambiguous queries
363- ✅ Routed to appropriate skill(s) in logical order
364- ✅ Didn't let tool choices (Kubernetes, TorchServe) dictate routing
365- ✅ Recognized multi-concern scenarios and routed to multiple skills
366
367---
368
369## ML Production Specialist Skills Catalog
370
371After routing, load the appropriate specialist skill for detailed guidance:
372
3731. [quantization-for-inference.md](quantization-for-inference.md) - INT8/INT4 quantization, post-training quantization, quantization-aware training, precision reduction for inference speed
3742. [model-compression-techniques.md](model-compression-techniques.md) - Pruning (structured/unstructured), knowledge distillation, architecture optimization, model size reduction
3753. [hardware-optimization-strategies.md](hardware-optimization-strategies.md) - GPU/CPU/edge tuning, batch sizing, memory optimization, hardware-specific acceleration (TensorRT, ONNX Runtime)
3764. [model-serving-patterns.md](model-serving-patterns.md) - FastAPI, TorchServe, gRPC, ONNX, batching strategies, containerization (Docker), REST/gRPC APIs
3775. [deployment-strategies.md](deployment-strategies.md) - A/B testing, canary deployment, shadow mode, gradual rollout, rollback procedures, blue-green deployment
3786. [scaling-and-load-balancing.md](scaling-and-load-balancing.md) - Horizontal scaling, autoscaling, load balancing, traffic management, cost optimization, replica management
3797. [experiment-tracking-and-versioning.md](experiment-tracking-and-versioning.md) - MLflow, Weights & Biases, model registries, experiment reproducibility, model lineage, versioning
3808. [mlops-pipeline-automation.md](mlops-pipeline-automation.md) - CI/CD for ML, feature stores, data validation, automated retraining, orchestration (Airflow, Kubeflow)
3819. [production-monitoring-and-alerting.md](production-monitoring-and-alerting.md) - Metrics tracking, drift detection, dashboards, alerting, SLAs, proactive monitoring
38210. [production-debugging-techniques.md](production-debugging-techniques.md) - Error analysis, production profiling, rollback procedures, post-mortems, root cause analysis
383
384---
385
386## References
387
388- See design doc: `docs/plans/2025-10-30-ml-production-pack-design.md`
389- Primary router: `yzmir/ai-engineering-expert/using-ai-engineering`
390- Related packs: `llm-specialist/using-llm-specialist`, `training-optimization/using-training-optimization`