fqih/.mycc-setup/ml-deployment
Claude Code and agent skill by fqih/.mycc-setup
- community
Checking that the SKILL.md file is still in the repository.
Use when deploying ML models to production — model serving frameworks (FastAPI, BentoML, vLLM, Ollama, KServe, Triton), monitoring, autoscaling, ONNX/TensorRT optimization, GPU serving. Trigger on "deploy model", "model serving", "inference", "vllm", "triton", "fastapi model".
Install
npx vskill@latest install fqih/.mycc-setup/ml-deploymentSKILL.md
The same SKILL.md was published earlier as fqih/.mycc-setup/ml-deployment.
ml-deployment
Production serving patterns untuk ML models — bukan prototype.
Serving framework selection
| Framework | Best for | Pros | Cons | |
|---|---|---|---|---|
| FastAPI + Uvicorn | Custom inference, small model | Simple, flexible | Manual scaling, no batching | |
| BentoML | Mid-size, full pipeline | Pipeline versioning, multi-model | Learning curve | |
| vLLM | LLM serving (HuggingFace) | PagedAttention, very fast | LLM-only | |
| Ollama | Local/edge LLM | Zero-config, single binary | Single-machine | |
| Text Generation Inference (HF) | LLM serving prod | Multi-GPU, quantization | LLM-only | |
| Triton Inference Server | Multi-model, GPU | Batching, concurrent | Heavy setup | |
| KServe | Kubernetes-native | Cloud-native | Needs K8s | |
| TorchServe | PyTorch models | AWS-supported | PyTorch-only | |
| TensorFlow Serving | TF models | Battle-tested | TF-only | |
| ONNX Runtime | Cross-framework ONNX | Portable, fast | Need ONFX conversion |
Pick by scenario:
- LLM, production, GPU available → vLLM
- LLM, local dev → Ollama (sudah ada di skill
local-ml-gpu) - Custom inference, sklearn/PyTorch → BentoML atau FastAPI
- K8s setup → KServe
- Multi-model GPU server → Triton
FastAPI pattern (most common)
BentoML pattern
vLLM pattern (LLM serving)
ONNX optimization
Convert PyTorch/sklearn ke ONNX untuk inference lebih cepat + portable:
Untuk AMD ROCm: providers=["ROCMExecutionProvider"].
Batching untuk throughput
Triton + BentoML punya dynamic batching built-in.
Quantization
| Method | Size reduction | Accuracy loss | Tool | |
|---|---|---|---|---|
| FP32 → FP16 | 2x | Minimal | Native | |
| FP32 → INT8 (PTQ) | 4x | ~1% | ONNX Runtime, TFLite | |
| FP16 → INT4 (GPTQ) | 4x | ~2-3% | AutoGPTQ | |
| FP16 → INT4 (AWQ) | 4x | ~1-2% | AutoAWQ | |
| FP16 → INT4 (bitsandbytes) | 4x | ~2% | bitsandbytes |
Untuk LLM: AWQ atau GPTQ untuk quality terbaik.
Monitoring
Track per-request:
- Latency (p50, p95, p99)
- Throughput (req/s)
- Error rate
- Input distribution drift
- Output confidence drift
- GPU util + VRAM
Plus: log input/output ke MLflow untuk tracking produksi + retraining data.
Autoscaling
| Trigger | When | |
|---|---|---|
| CPU/GPU util > 70% | Scale up | |
| Queue depth > N | Scale up | |
| Latency p95 > SLO | Scale up | |
| Request rate < baseline | Scale down |
Platform:
- Kubernetes + HPA (HorizontalPodAutoscaler)
- Cloud Run / App Runner: traffic-based auto
- Modal, Replicate, BentoCloud: managed
Health checks
Common pitfalls
| Pitfall | Solusi | |
|---|---|---|
| Model load blocking startup | Use lifespan async context manager | |
| Input validation skip | Pydantic strict types, return 422 for bad input | |
| GPU OOM saat concurrent | Dynamic batching + max concurrent = 1 per GPU | |
| Cold start slow | Warm-up inference di startup, cache weights in memory | |
| Numerical drift across versions | Pin numpy/torch versions di lock file | |
| PII leak di logs | Redact/hash sensitive fields sebelum log | |
| Model artifact di repo (besar) | Simpan di S3/GCS/HF Hub, download at startup | |
| No rollback plan | Versioning via BentoML/MLflow registry, stage transitions |
Checklist before prod
- [ ] Load test: target RPS tercapai
- [ ] Latency p95 < SLO
- [ ] Error rate < 0.1%
- [ ] GPU/CPU headroom untuk 2x peak
- [ ] Health + ready endpoints
- [ ] Metrics ke Prometheus
- [ ] Logs structured (JSON)
- [ ] Model version + git SHA di response
- [ ] Graceful shutdown (in-flight finish)
- [ ] Rollback tested
Invokation
Auto-trigger saat:
- Edit file yang import bentoml, vllm, fastapi + model
- User sebut "deploy", "serve", "inference", "endpoint"
- Code pattern: predict/score/forward + http endpoint
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ml-deployment/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fqih/.mycc-setup/ml-deployment)