param087/agent-ml-skills/model-serving
Claude Code and agent skill by param087/agent-ml-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when deploying a trained model behind an API. Covers FastAPI inference services, loading artifacts safely, request validation, batching, ONNX/quantization for speed, health checks, and monitoring.
Install
npx vskill@latest install param087/agent-ml-skills/model-servingSKILL.md
The same SKILL.md was published earlier as param087/agent-ml-skills/model-serving.
Model Serving
Overview
Serving turns a saved model into a reliable, low-latency API. The concerns shift from accuracy to latency, throughput, robustness, and observability. The model artifact and its preprocessing must travel together (use the pipeline from sklearn-pipelines).
When to use
- A validated model needs to be callable by other systems.
- Moving from notebook to production.
Minimal FastAPI service
Run: uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4.
Production checklist
- Load the model once at startup, not per request.
- Validate inputs with Pydantic; return 422 on bad payloads.
- Health/readiness endpoints for orchestrators (k8s).
- Batch requests where possible to raise throughput.
- Timeouts + graceful degradation for downstream calls.
- Version the model in the response (
model_version) for traceability. - Pin the artifact's training env — preprocessing must match training exactly.
Speed: ONNX + quantization
ONNX runtime + dynamic quantization often gives 2-4x CPU speedups. For LLMs, use vLLM/TGI rather than rolling your own.
Monitoring (don't deploy blind)
- Operational: latency p50/p95/p99, error rate, throughput.
- ML-specific: input feature drift, prediction distribution shift, and (when labels arrive) live metric decay.
- Alert on drift — a silently degrading model is worse than a down one.
Pitfalls
- Training/serving skew — different preprocessing in prod than training. Ship the pipeline, not just the estimator.
- Loading the model per request — kills latency.
- No input validation — one bad payload takes down the worker.
- `pickle`/`joblib` from untrusted sources — only load artifacts you produced.
- No monitoring — you won't notice drift until users do.
Hand-off
A containerized, monitored endpoint serving the exact pipeline that model-evaluation validated and experiment-tracking registered.
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/model-serving/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/param087/agent-ml-skills/model-serving)