ml-model-serving
Use when the user asks to serve a PyTorch model with batching and autoscaling, BentoML, Ray Serve, KServe, Triton Inference Server, Seldon, canary or A/B…
от j4flmao★ 47 звёзд на GitHub
Установить ml-model-serving в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Model Serving Agent
Purpose
Design model serving architecture with framework selection, deployment strategy, autoscaling, and inference optimization for production workloads.
Architecture/Decision Trees
Framework Selection Decision Tree
Model framework and requirements
├── PyTorch model
│ ├── Need native PyTorch support → BentoML / Ray Serve / KServe (TorchServe is archived, no security fixes)
│ ├── Complex pipeline (multi-model) → Ray Serve (composition)
│ └── K8s native → KServe (K8s CRD, auto-scaling to zero)
├── TensorFlow model
│ └── TF Serving (native, best performance, SavedModel format)
├── Python ecosystem (sklearn, XGBoost, custom)
│ ├── Simple API → BentoML (OpenAPI, framework-agnostic)
│ └── Distributed, complex → Ray Serve (Python-native)
├── Multiple frameworks
│ ├── K8s → KServe or Seldon Core (multi-framework)
│ └── MLflow → MLflow Serving (experiment tracking integration)
└── Edge / Mobile
├── Mobile → TensorFlow Lite / Core ML
├── Edge → ONNX Runtime / OpenVINO
└── Web → TensorFlow.js / ONNX.js
Deployment Strategy Decision Tree
Risk tolerance and traffic pattern
├── Zero-risk tolerance, critical system
│ └── Blue-Green (full cutover, instant rollback, double resources)
├── Staged rollout, can monitor
│ ├── Services → Canary (5% → 25% → 50% → 100%, automated metrics)
│ └── Stateless → Rolling (update instances one-by-one)
└── Need to compare models
└── A/B Testing (traffic split by user/region, statistical comparison)
Autoscaling Strategy
Workload pattern
├── Predictable traffic → Scheduled scaling (cron-based min/max)
├── Spiky, bursty → RPS-based (scale on requests per second)
├── CPU-bound → CPU utilization (target 60-70%)
├── GPU-bound → GPU utilization (target 70-80%)
├── Latency-sensitive → Concurrency-based (target concurrent requests)
└── Variable → Hybrid: RPS + CPU + memory combination
Inference Optimization Decision Tree
Latency/throughput requirement
├── Real-time (<100ms)
│ ├── GPU → TensorRT (FP16/INT8, kernel fusion)
│ ├── CPU → ONNX Runtime (graph optimization, int8 quantization)
│ └── Small model → batching with max_latency_budget
├── Near real-time (<1s)
│ ├── Dynamic batching (max_batch_size=32, max_delay=100ms)
│ └── Response caching (TTL=60s for frequent queries)
└── Batch (minutes)
└── Large batch processing (maximize throughput, no latency concern)
Agent Protocol
Trigger
User request includes: model serving, TorchServe, BentoML, Ray Serve, Seldon Core, KServe, inference, model deployment, A/B testing, autoscaling, canary deploy, model versioning, prediction, inference API.
Protocol
- Identify model framework and inference requirements.
- Select serving framework based on model type, scale, and feature needs.
- Design deployment strategy: canary, blue-green, or A/B testing.
- Configure autoscaling with metrics and thresholds.
- Define model versioning scheme and rollback procedure.
- Optimize inference: batching, quantization, kernel fusion.
Output
Model serving architecture with framework selection, deployment strategy, scaling, optimization.
Response Format
## Model Serving Configuration
### Framework
Engine: {TorchServe / BentoML / Ray Serve / KServe}
Model Format: {Mar / Bento / ONNX / SavedModel}
### Deployment
Strategy: {canary / blue-green / rolling}
Replicas: {min} - {max}
Model Version: {current} | Previous: {previous}
### Autoscaling
Metric: {CPU / GPU / RPS / latency}
Threshold: {value}
### Inference Optimization
Batching: {max_batch_size} | {max_latency_ms}
Quantization: {FP16 / INT8 / none}
No preamble. No postamble. No explanations. No filler. Compress output.
Completion Criteria
- Serving framework selected with rationale based on model type.
- Deployment strategy defined with traffic split and monitoring.
- Autoscaling configured with metrics and thresholds.
- Model versioning scheme with rollback procedure.
- Inference optimization applied (batching, quantization).
- Health checks and readiness probes configured.
Workflow
Step 1: Select Serving Framework
- TorchServe: archived in August 2025 (limited maintenance, no security patches). Keep only for existing deployments; choose BentoML, Ray Serve, KServe or Triton for new work.
- BentoML: Framework-agnostic, Python-first, OpenAPI spec. Best for Python ML ecosystem.
- Ray Serve: Distributed, composition of models, Python-native. Best for complex pipelines.
- KServe: Kubernetes-native, serverless, auto-scaling to zero. Best for K8s infra.
- Seldon Core: Multi-framework, explainability, outlier detection. Best for advanced ML features.
# BentoML service definition
import bentoml
import numpy as np
@bentoml.service(
resources={"cpu": "2", "memory": "4Gi"},
traffic={"timeout": 10, "max_concurrency": 32},
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/k8s-serving.md
- references/model-serving-advanced.md
- references/model-serving-fundamentals.md
- references/model-versioning.md
- references/serverless-inference.md
- references/serving-frameworks.md
FAQ
Что делает скилл ml-model-serving?
Use when the user asks to serve a PyTorch model with batching and autoscaling, BentoML, Ray Serve, KServe, Triton Inference Server, Seldon, canary or A/B model rollout, model versioning and rollback. Produces serving framework choice, deployment config and rollback procedure. Not for LLM engine tuning (use ml-inference-optimization) or TensorRT engines (use tensorrt-optimization).
Как установить скилл ml-model-serving?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ml-model-serving запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…