ML model deployment is the process of making a trained model actually usable — serving real predictions to real users or systems, not just sitting accurately in a notebook.
Why a Great Model in a Notebook Delivers Zero Business Value
A model with 95% accuracy that never leaves a Jupyter notebook has delivered exactly the same business value as no model at all — zero. Deployment is the step that actually connects a trained model to the real decisions it was built to support, and in many real projects, it takes as much engineering effort as the modeling itself.
The Deployment Landscape
A typical path: save the trained pipeline, wrap it in an API, containerize for consistent deployment, then serve real requests.
Batch vs Real-Time Deployment — The First Big Decision
| Batch Inference | Real-Time Inference | |
|---|---|---|
| When predictions happen | Scheduled, on a large group of records at once | On-demand, per individual request |
| Example | Nightly churn-risk scoring for all customers | Live fraud check on a transaction as it happens |
| Latency requirement | Minutes to hours is fine | Milliseconds to seconds |
| Typical implementation | A scheduled script | An API endpoint (Flask/FastAPI) |
Practical Use Cases
- Every model intended to actually influence a real decision or product, rather than remaining a research artifact
Common Mistakes
- Treating deployment as an afterthought, tackled only once modeling is "done" — deployment requirements (latency, input format, monitoring) should shape modeling decisions from the start.
- Deploying only the model, without its full preprocessing pipeline — see ML Inference for why this causes train-serve mismatches.
Interview Relevance
Q: "How would you decide between batch and real-time deployment for a new model?" Look at how quickly a prediction is actually needed after the triggering event — a nightly credit-risk refresh can be batch; a live fraud check blocking a transaction in real time cannot; the required latency, not the model itself, usually determines this choice.
Practice Question
For each, decide batch or real-time: (a) monthly customer churn risk scores, (b) fraud detection at checkout, (c) product recommendations shown on a homepage.