Free — no signup required

Introduction: The "Last Mile" of Machine Learning

2 min read

The Jupyter Notebook Trap

You've done the hard work. You cleaned the data, engineered features, trained a neural network, and achieved impressive accuracy on your test set in a Jupyter notebook. But right now, your model is just a file sitting on a hard drive. A mobile app can't call a cell in your notebook. A website can't import your Python environment. The model is, for all practical purposes, useless to the outside world.

What is Model Serving?

Model Serving is the process of taking a trained model artifact and making its predictive functionality available to other software systems over a network. It is the "last mile" of the ML lifecycle — the bridge between experimental data science and production software engineering.

Concretely, model serving involves wrapping your model in software that can:
- Accept network requests from external clients
- Load the model into memory (RAM or GPU VRAM) at startup
- Transform raw input data into the format the model expects
- Execute the model's forward pass (the inference step) to produce a prediction
- Return that prediction to the caller

Without robust serving infrastructure, even the most accurate model is a science experiment. The entire value of machine learning is unlocked only when predictions reach the systems and people who need them.

The Full Picture: What "Serving" Actually Encompasses

Model serving is not just "run a Flask app." Production serving involves several concerns that compound in complexity as scale grows:

  • Latency: How fast does a single prediction come back? (milliseconds matter for user-facing products)
  • Throughput: How many predictions per second can the system handle?
  • Reliability: What happens when the model server crashes or the GPU runs out of memory?
  • Versioning: Which version of the model is currently serving traffic, and how do you roll back?
  • Observability: Are predictions drifting over time? Is the model making worse decisions than it did last month?

Each of these concerns maps to a specific tool or pattern covered in this lesson.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free