Model Packaging & Serving
Package a trained model with its preprocessing and serve it for batch and online inference behind a validated, containerized API with measured latency and cost.
4 objectives 6 steps about 125 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Serialize a model together with its preprocessing and metadata in a portable, safe format (for example skops or joblib with pinned versions, safetensors, ONNX) and verify that predictions match the training environment.
- Choose batch, online or streaming inference and a rollout strategy (shadow, canary, A/B test, rollback) from latency, freshness, cost and risk requirements.
- Build an online inference API (for example with FastAPI) with input schema validation, health and version endpoints, plus a batch scoring job that reuses the same prediction code.
- Containerize the service, load-test it for p50/p95 latency and throughput, and apply one optimization (request batching, quantization, ONNX Runtime, or a dedicated LLM server such as vLLM) with measured impact on latency and cost.
Lesson plan
6 steps, about 125 min · 5 of 5 lessons available so far
- What Exactly Are You Shipping? Model Artifacts and Formats Concept · 20 min
- Batch, Online or Streaming: Picking the Inference Pattern Concept · 15 min
- Lab: A Validated Prediction API with Shared Batch Scoring Lab · 30 min
- Lab: Containerize, Load-Test and Optimize Lab · 30 min
- Safe Rollouts: Shadow, Canary, A/B Tests and Rollback Concept · 15 min
- Check: Serving Design Review Knowledge check · 8 questions
Practise it
Serve the model from an earlier project: export it with its preprocessing, expose an endpoint with schema validation and a batch scoring command that share the same code, containerize it, load-test for p95 latency, and apply one optimization with before/after latency and cost per 1,000 predictions.
References
Hard prerequisites
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.