Serving, monitoring, and drift
A model in a notebook helps no one. Learn how models reach real users—and what can go wrong once they do.
Before We Begin
Training a model is the beginning, not the end. Deployment is where ML meets the real world: wrapping a model behind an API so applications can call it, monitoring its predictions to catch silent failures, and detecting data drift—the slow shift in real-world data that makes yesterday's great model today's unreliable one. We also touch on versioning models, rolling back bad deployments, and the concept of a feedback loop where user behavior changes the data the model sees next.
How this lesson fits
A model that works is not enough—it also has to be understandable, fair, and ready for the real world. This module covers the human side of AI: explaining predictions, confronting bias, and deploying models responsibly.
The big question
How do we make sure an AI system is not just accurate but also transparent, fair, and safe to deploy?
Why You Should Care
Most ML courses stop at training. But in industry, deployment, monitoring, and maintenance consume the majority of an ML engineer's time. Teaching these concepts early gives students a realistic picture of what ML work actually looks like—and prevents the common surprise that a "finished" model is really just the beginning.
Where this is used today
Think of it like this
Think of opening a restaurant. Perfecting a recipe at home (training) is step one. But running a real kitchen means handling a dinner rush (serving at scale), checking that dishes taste the same every night (monitoring), and updating the menu when ingredients change seasonally (handling drift). Deployment is everything after the recipe is written.
Easy mistake to make
Deploying a model is not a one-time event. Real-world data changes constantly, so a deployed model requires ongoing monitoring, retraining schedules, and sometimes a full rebuild.
Think about this first
You deploy a model that predicts ice-cream sales. It works great in summer. What happens in winter, and what should you do about it?
Words we will keep using
A model that works in a notebook is not the same as a model that works in production. Real-world data changes constantly. Users behave differently over time. Systems fail in unexpected ways. Deployment is an ongoing commitment to monitoring, maintenance, and adaptation.
A model is deployed at 92% accuracy. Over time, user behavior shifts and accuracy degrades. Adjust when drift begins and watch the model cross the alert threshold.
Without monitoring, drift goes unnoticed for weeks. With proper alerts, you catch it the moment accuracy crosses the threshold and trigger a retraining pipeline.
The input distribution changes. E.g., a new user demographic appears, or sensor calibration shifts. The model sees data it was never trained on.
Detect: Monitor feature distributions (KS test, PSI).
The relationship between inputs and outputs changes. E.g., a pandemic changes what "normal" spending looks like. The model's learned rules become outdated.
Detect: Monitor prediction accuracy and calibration over time.
In production, users care about tail latency, not average. The p99 (worst 1% of requests) reveals outliers that average hides. A model with 30ms average but 200ms p99 will frustrate users.
Traditional CI/CD tests code. ML CI/CD must also test data, model quality, and inference performance.