From a notebook that works on one laptop to a service that keeps working: why notebooks break, which serving tools are alive in October 2026, what they cost, and how to catch a model that quietly gets worse.
The Notebook Graveyard
A model scores 94% on the test set in a Jupyter notebook. The charts look good and the stakeholders are pleased. Six months later the notebook is still on one laptop, serving nobody, or it is serving traffic and nobody has looked at it since the first week. This guide covers the distance between those two situations: why notebooks break, how to migrate one, which serving tools are alive in October 2026 and what they cost, and how to notice when a deployed model has quietly gotten worse.
You will often see the claim that 87% of machine learning models never reach production. It comes from the headline of a July 2019 VentureBeat article about a conference panel, and the article cites no study, survey or sample. Treat it as a slogan. Two measurements are more reliable.
The first is about notebooks. Pimentel and colleagues (2019) collected 1,159,166 unique notebooks from 264,023 public GitHub repositories and tried to re-run 863,878 of them. Only 24.11% executed without errors, and only 4.03% produced the same results. The most common causes were missing dependencies, hidden state and out-of-order execution, and unavailable data. These are public repositories from 2019, not production code, so read the numbers as how fragile notebooks are by default, not as your odds.
The second is about what happens after deployment. Vela and colleagues (Scientific Reports, 2022) trained four standard model types on 32 datasets with long time spans, giving 128 model and dataset pairs, and tested each on data from later dates. Quality degraded over time in 91% of the pairs. Some models stayed accurate for about a year and then broke down fast, with no abrupt change in the data to explain it. A model that is accurate on the day you ship it promises nothing about next quarter.
Why Notebooks Fail in Production
Notebooks are excellent for exploration and poor for production, for reasons you can name.
Hidden state. Cells run in whatever order you click them. Run cell 12, go back and edit cell 3, run cell 15, and the state of the notebook depends on a history nobody can see. In the Pimentel corpus, 36.36% of the notebooks with an unambiguous execution order had cells run out of order. A colleague who runs all cells top to bottom gets different numbers, which is why “restart and run all” is the first test every notebook should pass.
Dependency chaos. A notebook records nothing about the packages it ran on, and libraries move underneath it. pandas 3.0.0, released on January 21, 2026, made a dedicated string type the default, switched to copy-on-write semantics and requires Python 3.11 or newer, according to its release notes, which warn of breaking consequences. A notebook written against pandas 2.x and an unpinned install in a fresh container can now behave differently, or fail to install on an older Python. The current scikit-learn (1.9.1) and onnxruntime (1.31.0) list the same Python 3.11 floor on PyPI.
Train-serve skew. Google’s Rules of Machine Learning defines training-serving skew as a difference between performance during training and performance during serving. It can come from handling data differently in the two pipelines, from data that changed between training and serving, or from a feedback loop. The remedies are cheap: log the features used at serving time and reuse them for training (Rule 29), reuse code between the training and serving pipelines (Rule 32), and measure the skew (Rule 37). Picture a user attribute backfilled from a warehouse during training but read from a real-time database 30 minutes late in production. Same feature name, different values, no error message.
No error handling. In a notebook an exception prints a traceback and you fix it. In production an unhandled exception at 3 AM means blank pages for customers. Notebooks have no retries, fallbacks or graceful degradation because they were never built for them.
Try this yourself. Create a fresh virtual environment, install only what your pinned requirements file lists, restart the kernel and run all cells top to bottom. If the notebook fails, or the headline metric moves away from the number you reported, you have found hidden state or an unrecorded dependency before production did. Keep the metric from that clean run as the reference number for your deployment tests.
| Concern | Jupyter Notebook | Production System |
|---|---|---|
| Execution order | Manual, arbitrary | Defined pipeline, deterministic |
| Dependencies | Whatever is installed | Locked, versioned, containerized |
| Error handling | Traceback + manual fix | Retry, fallback, alerting |
| Scaling | Single machine | Horizontal, auto-scaled |
| Monitoring | Print statements | Metrics, logs, drift detection |
| Reproducibility | Fragile | Version-controlled, auditable |
The Migration Playbook: Notebook to Deployable Code
The migration follows a predictable order, and skipping steps usually costs more later. Teams that try to “just containerize the notebook” often end up rewriting it anyway, only now under deadline pressure.
Step 1 is where most teams underinvest. Refactoring a notebook into modules sounds tedious, and it is. But this is where you discover the hidden dependencies, the cells that only work because of execution order, and the hardcoded file paths that will break on any machine except the author’s laptop. Separate configuration from code using YAML or environment variables. Make every path relative or configurable. Delete the cells that were “just for exploration.”
Step 2 is non-negotiable. A container carries the operating-system libraries and Python packages along with your code, so the environment travels with it. Pin your Python version and every library, including the transitive ones through a lock file, and test the image on a clean machine. If your model needs a GPU, start from NVIDIA’s CUDA base images and match the CUDA version to your driver. A container that builds locally but fails in CI has untracked dependencies.
For data versioning, DVC tracks datasets and model artifacts alongside your Git repository, using cloud storage as a backend, so that dvc pull restores the data and model that match the current commit. Its ownership changed recently: lakeFS acquired the DVC open source project from Iterative.ai on November 18, 2025 and says DVC continues as an independent open source tool. The latest release on PyPI (3.67.1, Apache-2.0) is dated March 31, 2026, so check the project’s activity before you build a team process around it.
Choosing a Serving Layer in October 2026
Three questions decide most of the choice: does inference need a GPU, do you already run Kubernetes, and is the model a language model. The table shows where each common option stood on 15 October 2026, taken from package registries, vendor documentation and release notes.
| Option | Status on 15 Oct 2026 | Fits | Watch out for |
|---|---|---|---|
| FastAPI | 0.143.1 (14 Oct 2026), MIT | A CPU model behind a small HTTP API | Health checks, input validation and model loading are yours to write |
| BentoML | 1.4.39 (7 May 2026), Apache-2.0 | General model serving; its PyPI page calls it “the easiest way to serve AI apps and models” | Latest release is five months old |
| KServe | Python SDK 0.21.0 (25 Sep 2026), Apache-2.0; CNCF incubating project | Teams already on Kubernetes: one custom resource covers autoscaling, health checks and canary deployments | Needs a cluster and someone to run it |
| NVIDIA Triton | Container 26.09, notes updated 1 Oct 2026; new containers monthly | Several frameworks behind one server (the container bundles ONNX Runtime 1.28.0, TensorRT 11.3, OpenVINO 2026.3.0 and vLLM 0.29.0) | Each container is built on one CUDA release (26.09: CUDA 13.4.1), so check your driver first |
| vLLM | 0.31.0 (5 Oct 2026), Apache-2.0 | Serving language models with an OpenAI-compatible API | Releases on 9 Sep, 22 Sep and 5 Oct, so pin the version |
| TorchServe | Repository archived 7 Aug 2025; documentation states no planned updates, bug fixes, new features or security patches | Existing deployments only | Do not start new work on it |
| Seldon Core | Python package 1.19.0 (23 Jan 2026), Business Source License 1.1 | Serving on Kubernetes | Read the license before commercial use |
Managed platforms are the alternative to running any of this yourself: Amazon SageMaker AI, Azure Machine Learning, and Google’s Gemini Enterprise Agent Platform, which is the former Vertex AI. The Register reported the rebrand on April 22, 2026, and Google’s documentation now lists “Name changes from Vertex AI”. If a tutorial still says Vertex AI, expect the console and the docs to use the new name.
What serving costs. Google’s Cloud Run pricing page works through examples for a service in europe-west1. At 10 million requests a month and 400 ms per request, an API where 20 requests share one vCPU is estimated at $13.69 a month. The same traffic with one request per instance, which is how Google models a CPU-intensive, non-thread-safe app, is estimated at $81.72. A GPU service with an NVIDIA L4, 4 vCPU and 16 GiB that peaks at two instances comes to $822.40. These are Google’s estimates including the free tier, and prices change, so rerun them in the pricing calculator. The pattern is the useful part: concurrency per CPU is the biggest lever, and a server that cannot share a CPU between requests costs about six times as much for the same traffic. Many model servers fit that shape, so load test yours before you estimate.
A rule of thumb, not a benchmark. A CPU model with no Kubernetes in sight starts as FastAPI or BentoML in a container on a serverless platform. Kubernetes shops look at KServe. Mixed-framework GPU fleets look at Triton. Language models go to vLLM.
Monitoring: The Part Everyone Skips Until It Burns Them
The 91% in the degradation study is the reason this section exists. A model that passed integration tests with good latency can lose accuracy months later, and nothing on your uptime dashboard will show it. Teams treat monitoring as a post-launch ticket when it is a deployment requirement.
Production ML monitoring splits into three layers, and you need all of them.
Infrastructure
Latency, GPU, Errors
Prometheus + Grafana
Model Quality
Accuracy, Confidence
MLflow + Evidently
Data Drift
Distribution Shift
Evidently + Great Expectations
Infrastructure metrics tell you whether the system is alive. Latency per request, throughput, error rates, GPU utilization, memory consumption. These are table stakes. Prometheus and Grafana handle this well. Set alerts for p99 latency spikes and error rate thresholds.
Model quality metrics tell you whether the system is useful. Track prediction confidence distributions over time. If the average confidence score drops, the model is encountering inputs it is uncertain about. Log a sample of predictions with their inputs so you can audit model behavior after the fact. The MLflow Model Registry stores each model version with lineage back to the run that produced it, plus aliases and tags, so you can say which version is live (MLflow’s current release is 3.17.1, from October 13, 2026).
Data drift metrics tell you whether the world has changed underneath your model. Statistical tests quantify how far the current input distribution has moved from the training distribution. Evidently’s defaults are a reasonable starting point: for reference data of up to 1,000 rows, a two-sample Kolmogorov-Smirnov test on numeric columns that flags drift at p of 0.05 or lower, and for larger data the Wasserstein distance with a 0.1 threshold. SciPy implements the K-S test as scipy.stats.ks_2samp. Older guides pair drift checks with WhyLabs, but WhyLabs, Inc. now states that it is discontinuing operations and has open sourced its platform, so choose a tool you can run yourself.
A worked example with the arithmetic. The Population Stability Index compares bin shares: the sum over bins of (live share minus training share) times ln(live share divided by training share). Say requests fell into three order-value bands at 50%, 30% and 20% in training and at 40%, 30% and 30% this week. The terms are (0.40 – 0.50) x ln(0.40/0.50) = 0.0223, (0.30 – 0.30) x ln(1.0) = 0, and (0.30 – 0.20) x ln(0.30/0.20) = 0.0405, so PSI is about 0.063. Whether 0.063 matters is a question about your own history, not a universal threshold: compute PSI between pairs of weeks that preceded no incident, and alert when a new value clearly exceeds that normal spread.
The teams that get this right build dashboards before they deploy, not after. Before your next release, write down three things and ship them with the model: the drift statistic and threshold you will watch, how long labels take to arrive so you know when accuracy can first be measured, and who gets paged.
Frequently Asked Questions
No public benchmark with a traceable method turned up while preparing this guide, and the 8 to 12 months that circulates names no source. Measure your own pipeline instead. The first deployment is slow because it builds everything at once: the module structure, the pinned container, the serving API, CI/CD, the registry and the monitoring. Later models reuse that path, so time the first one step by step and you will know what the second one costs.
Managed platforms such as Amazon SageMaker AI, Azure Machine Learning and Google’s Gemini Enterprise Agent Platform remove infrastructure work and suit teams without dedicated MLOps engineers. Self-hosting with tools such as KServe, Triton, BentoML and MLflow gives more control and needs engineers who can run them, and KServe in particular needs a Kubernetes cluster. Price depends more on traffic shape than on the label: the Cloud Run examples above differ by a factor of six on concurrency alone. Load test your model, price both options with those numbers, and revisit the choice once you know your real traffic.
Deploy the new version next to the old one, send it a small share of traffic (often 5 to 10 percent), raise the share if quality holds, and roll back if it does not. Decide the duration before you start, because accuracy needs labelled outcomes. To detect a rise in error rate from 6% (94% accuracy) to 8% at a 5% significance level with 80% power, the textbook two-proportion approximation gives n = 2 x (1.96 + 0.84)^2 x 0.07 x 0.93 / 0.02^2, about 2,550 labelled outcomes per version. If 1,000 labelled outcomes arrive per day and the canary gets 10%, it collects 100 a day and needs about 26 days; at a 50% split it needs about 5. If labels arrive slowly, compare latency, error rate and agreement with the old model’s predictions on the same requests during the canary, and judge accuracy afterwards.