Module 6 · Unit 17
Model Deployment
A model that lives only in a notebook changes nothing. This unit follows the model out of the lab and into production — production pipelines, serving APIs, monitoring for drift, and the operational discipline we call MLOps.
Unit at a glance
- 9 TutorialsConcept, worked examples, practice
- 4 Core topicsPipelines · APIs · Monitoring · MLOps
- 5 Hours of studyReading, activities and self-checks
- 1 Quiz + capstone phaseDeployment section of the final project
01 Overview
Everything you have built so far in COMP328 has lived inside a notebook:
a dataset loaded into memory, a model fitted in a few lines of
scikit-learn, and a metric printed at the bottom of a cell.
That is a perfectly good way to learn machine learning — but it is
not how machine learning creates value.
A model creates value only when it is deployed: when it is wired into a system that real users or real processes depend on, when it receives live data, and when someone is accountable for what it does at 3 a.m. on a Sunday. Deployment is where the interesting engineering lives — and where most machine learning projects quietly fail.
Unit 17 introduces the operational side of machine learning. You will learn how a trained model becomes a running service, how production pipelines are structured, how models are served through APIs, and how teams detect the moment a model stops working. We finish with an overview of MLOps, the set of practices that keeps machine learning systems healthy over time.
Why this unit matters
Industry surveys consistently report that the majority of machine learning models never reach production, and that the hardest part of a deployed system is not the algorithm — it is the data plumbing, the monitoring, and the maintenance. This unit gives you the vocabulary and mental models to work on that side of the problem.
The four questions this unit answers
- How does a model get from a notebook into production? The deployment mindset, and the difference between experimentation and engineering.
- What does a production pipeline actually look like? Data ingestion, feature computation, training, evaluation, packaging and release.
- How do other systems talk to a model? Serving patterns, REST APIs, batch jobs, streaming inference, and their trade-offs.
- How do we know the model is still working? Monitoring, data drift, concept drift, alerting and the MLOps lifecycle.
02 Learning outcomes
By the end of Unit 17 you should be able to do the following. These outcomes are written so that you can check your own progress against them.
Knowledge — what you will understand
- Explain the difference between an experimental and a production machine learning workflow.
- Describe the stages of a production machine learning pipeline and what each stage is responsible for.
- Distinguish between batch, online and streaming inference, and justify which is appropriate for a given problem.
- Explain what data drift and concept drift are, and why they cause deployed models to degrade.
- Define MLOps and describe how it differs from traditional DevOps.
Skills — what you will be able to do
- Package a trained model so that it can be reloaded and reused outside the notebook that created it.
- Wrap a model in a minimal REST API that accepts input and returns predictions.
- Identify the inputs, outputs and failure points of a proposed deployment architecture.
- Select appropriate monitoring signals for a deployed model and describe what an alert would look like.
- Sketch an end-to-end deployment plan for a machine learning project.
Professional competencies — how you will think
- Assess the operational risk of a machine learning system, not only its accuracy.
- Recognise when a model should be retrained, rolled back or taken offline.
- Communicate deployment decisions to both technical and non-technical stakeholders.
- Connect deployment choices to the ethical and governance concerns covered later in Module 6.
03 Reading roadmap
Unit 17 is delivered as nine tutorials. Work through them in order — each one assumes the concepts from the one before it. Tutorials 1–4 build the foundations, 5–7 cover serving and monitoring, and 8–9 place everything in a wider operational and professional context.
From Notebook to Production
The deployment mindset. Why experiments and production systems have different requirements, and what changes when a model has users.
T-02Anatomy of a Production Pipeline
Ingestion, validation, feature computation, training, evaluation, packaging and release — and where each stage can break.
T-03Data & Feature Pipelines
Keeping training and serving consistent. Feature stores, schema validation, and the training–serving skew problem.
T-04Serialization & Versioning
Saving and loading models, reproducibility, model registries, and why "model_final_v3_FINAL.pkl" is not a versioning strategy.
T-05Serving Models as APIs
From a fitted estimator to an HTTP endpoint. Request/response design, validation, latency budgets and error handling.
T-06Batch, Online & Streaming Inference
Three serving patterns, their latency and throughput characteristics, and how to choose between them.
T-07Monitoring & Drift Detection
What to measure after deployment: input distributions, prediction distributions, outcomes, and the drift signals that trigger retraining.
T-08Introduction to MLOps
CI/CD for models, automated retraining, rollback strategies, and the organisational practices that keep systems healthy.
T-09Case Study & Unit Review
A complete deployment walkthrough, from business problem to monitored production service, plus consolidation of the unit's key ideas.
04 Learning activities
Reading alone will not make deployment feel real. Each tutorial contains a mix of the following activity types, and the unit as a whole asks you to produce a deployment plan of your own.
Interactive activity · Trace a prediction
In T-02 you will be given a diagram of a production pipeline with the stages left blank. Label each stage, then mark every point at which the pipeline could fail silently — that is, produce an output that looks correct but is not. Compare your list with the worked answer.
Interactive activity · Choose a serving pattern
In T-06 you will be presented with six scenarios — a nightly credit-risk report, a fraud check inside a payment flow, an IoT sensor alert, a product recommendation widget, a medical imaging triage tool, and a weekly churn list. For each, decide whether batch, online or streaming serving is appropriate and justify your choice in two sentences.
The notebook mirrors the code in T-04 and T-05. It is deliberately small: the point is not to build a production system, but to see every moving part at once.
from sklearn.linear_model import LogisticRegression
import joblib
# 1. Train (in the notebook)
model = LogisticRegression(max_iter=1000).fit(X_train, y_train)
joblib.dump(model, "churn-model-v1.joblib")
# 2. Load (in the serving process — no notebook required)
model = joblib.load("churn-model-v1.joblib")
# 3. Predict (inside an API handler)
probability = model.predict_proba([request_features])[0, 1]
return {"churn_probability": round(float(probability), 4)}
Comparing serving patterns
The table below summarises the trade-offs you will explore in T-06. Keep it in mind as you work through the unit — almost every deployment decision comes back to these characteristics.
| Pattern | Latency | Throughput | Typical use |
|---|---|---|---|
| Batch | Minutes to hours | Very high | Nightly scoring, reporting, churn lists |
| Online | Milliseconds | Moderate | Recommendations, fraud checks, search ranking |
| Streaming | Sub-second | High | IoT telemetry, clickstream, live monitoring |
Study tip
For every tutorial in this unit, ask yourself one question: what would I need to know to be woken up at 2 a.m. about this? Deployment is fundamentally about observability and accountability, and that question surfaces both.
05 Assessment
Unit 17 is assessed through the end-of-unit quiz and through the deployment phase of the capstone project. There is no separate assignment for this unit — deployment is assessed where it belongs, inside a complete project.
Quiz questions
Multiple choice, short answer and scenario-based reasoning. Covers all nine tutorials. Unlimited attempts, best score counts.
Capstone · Deployment plan
A written deployment and monitoring plan for your capstone model, including serving pattern, versioning and alerting.
Self-check questions
Embedded in every tutorial. Not graded, but strongly recommended — they are the fastest way to find gaps.
How the outcomes are assessed
| Learning outcome | Quiz | Capstone deployment plan |
|---|---|---|
| Explain experimental vs. production workflows | Q1–Q2 | Section 1 |
| Describe production pipeline stages | Q3–Q5 | Section 2 |
| Choose a serving pattern and justify it | Q6–Q8 | Section 3 |
| Explain drift and select monitoring signals | Q9–Q11 | Section 4 |
| Define MLOps and describe its practices | Q12 | Section 5 |
Before you move on
The capstone deployment plan assumes you can describe a full pipeline without notes. If you cannot yet sketch the stages from memory, revisit T-02 and T-05 before starting the plan.
06 Summary
Unit 17 has taken the models you have built throughout COMP328 and asked what it would take to run them for real. The core ideas are worth stating plainly:
- Deployment is a design problem, not a final step. The serving pattern, the data contracts and the monitoring strategy should be decided before the model is trained, not after.
- Most production failures are data failures. Training–serving skew, broken upstream schemas and silent nulls cause more incidents than poor model accuracy.
- A model is a component, not a product. It has inputs, outputs, a version, a latency budget and a failure mode — and it must be treated with the same discipline as any other service.
- Deployed models decay. The world changes; the model does not. Monitoring for drift is how you find out before your users do.
- MLOps is DevOps plus uncertainty. The practices are familiar — versioning, CI/CD, rollback, observability — but they must account for data and models that change behaviour over time.
You are ready for Unit 18 when you can…
…sketch a production pipeline for a model of your choice, name the serving pattern you would use and why, and describe two signals you would monitor and what would trigger a retrain.
What comes next
Unit 18 turns to the ethical dimension of the systems you have just learned to build. Deployment gives a model reach; ethics asks whether that reach is being used responsibly. The governance and fairness material in Unit 19 builds directly on both.
Ready to leave the notebook behind?
Begin with T-01 — From Notebook to Production — and work through the unit in order. Nine tutorials, roughly five hours, one deployable mental model.