This post lists ten AI model deployment challenges in production, with the signs of each problem and a concrete fix. Most of the problems are outside the model, in the data, code, infrastructure and team around it.
The problems appear in the rough order in which teams run into them. Each section covers classical machine learning model deployment first and adds the LLM case where it differs. Our post Model deployment strategies covers release patterns such as shadow, canary and blue/green, and "What is MLOps?" covers the wider lifecycle.
Problems and fixes at a glance
| Problem | Typical sign | First fix |
|---|---|---|
| Notebook state | The service gives different scores from the notebook on the same rows | One saved artifact for preprocessing and model |
| Training-serving skew | Offline accuracy is good and live accuracy is lower from day one | Log served features and compare them with training features |
| Upstream data changes | Predictions shift after another team's release | Input validation and a data contract |
| Drift | Quality falls slowly over weeks | Label-free drift signals, then delayed quality metrics |
| Latency and cost | p99 latency (the slowest 1% of requests) is too high, or GPU spend is over budget | A per-stage latency budget, and batch scoring where nobody waits for the answer |
| Packaging | Container images of many gigabytes, CUDA errors at startup | Pinned builds in CI and weights stored outside the image |
| Versioning and rollback | Nobody can say which model served a request | A registry and deploys by version |
| Testing | A new version improves the average and breaks a segment | A versioned evaluation set and segment gates |
| Security and privacy | Personal data in logs, unsafe model files | Logging policy, safe formats, endpoint controls |
| Ownership | Alerts fire and nobody acts | A named owner and a runbook per model |
1. The model works in the notebook and not in the service
A model trained in a notebook depends on the notebook's state. That state includes library versions, columns renamed in an earlier cell, and a scaler fit on a slice of data that nobody saved. The service rebuilds the preprocessing by hand and gets a slightly different input.
Fix. Turn training into a script with explicit inputs and outputs. Save the preprocessing and the model as one object, for example a scikit-learn Pipeline. The service then always runs the same transformations used in training before it calls the model. Build the serving image from the same lockfile as the training environment.
Version pinning matters for the saved file too. The scikit-learn model persistence guide says there is no supported way to load a model trained with a different scikit-learn version. scikit-learn shows an InconsistentVersionWarning when you load a model saved with a different version. The same guide describes ONNX export as a way to serve without the Python object.
2. Training-serving skew
Features computed in production can differ from the features used in training, even when training and serving share one saved pipeline. One cause is a feature that is easy to compute over a historical table and hard to compute in a live request. The online service then gets its own copy of the feature, often in another programming language, and the two copies disagree on edge cases. Another cause is leakage: a training row uses information that did not exist at prediction time.
Google's Rules of Machine Learning give a whole section to this problem, including rules on logging the features used at serving time, reusing code between the training and serving pipelines, and measuring the skew.
Fix.
- Compute each feature with one implementation that both training and serving call.
- Log the exact feature vector the service used for each prediction.
- Compare the distribution of logged features with the training data on a schedule.
- Build training sets with point-in-time joins, so each row uses only data that existed at its timestamp. Feature stores such as Feast (Apache 2.0) do these joins in
get_historical_features.
3. Upstream data changes
The model service usually reads data that another team produces. That team renames a field, changes a unit from dollars to cents, or starts sending nulls. A batch job runs late, and the service reads yesterday's table. The model raises no error and returns a confident prediction on bad input.
Fix. Validate inputs where they enter the service, checking types, ranges, allowed categories and null rates. Libraries such as Pandera (MIT) and Great Expectations (Apache 2.0) express these checks as code.
Decide in advance what the service does with invalid input: reject the request, return a default, or apply a fixed business rule instead of the model. Count each outcome in a metric so a spike is visible. Agree on a data contract with the producing team, so the team announces a schema change before it ships.
4. Drift and silent degradation
Production data changes over time: customer behavior moves, a new product line launches, a sensor is replaced. Data drift is a change in the input distribution. Concept drift is a change in the relationship between inputs and the outcome. Neither kind of drift raises an exception.
Ground truth often arrives late. A churn label can take months, and a fraud label waits for a chargeback. A team that waits for accuracy to fall reacts months after the change.
Fix. Watch three kinds of signal, from fastest to slowest:
- Input and prediction distributions, which need no labels and are available at once.
- Business proxies that arrive sooner than labels, such as clicks, overrides by staff, or complaints.
- True quality metrics, computed when labels arrive and charted per model version.
Evidently (Apache 2.0) runs drift checks in a scheduled job, and its default test depends on column type and sample size. For numeric columns it uses the Kolmogorov-Smirnov test up to 1,000 rows and the Wasserstein distance above that. Other distance measures, such as the population stability index (PSI), are options.
NannyML (Apache 2.0) estimates model performance before labels arrive. For classification it uses the model's own confidence scores, and for regression it trains a second model to predict the error. Its last release was in July 2025, so check the repository for recent commits before you depend on it.
Treat a drift alert as a reason to investigate, and do not retrain automatically on it. A shift in inputs does not always mean the model is wrong.
5. Latency, throughput and cost
A model that scores in 20 milliseconds on a laptop can take far longer inside a service. Serialization, network hops, feature lookups and a cold container all add time. Sudden traffic peaks reach throughput limits, and idle GPUs between requests raise cost.
Fix. Set a latency budget for the whole request and measure each stage against it. Load-test with realistic payloads before launch. If nobody waits for the answer, score in batch on a schedule instead of serving an API.
For online serving, these tools address specific bottlenecks:
- Request batching. NVIDIA Triton's dynamic batcher groups requests on the server, and
max_queue_delay_microsecondssets how long it waits to fill a batch. - LLM serving engines. vLLM uses PagedAttention, and its paper reports 2 to 4 times the throughput of earlier systems at the same latency.
- Scale to zero. Knative scales idle services to zero to save cost. The first request after the service scales to zero waits for a pod to start and the model to load, so latency-sensitive services keep a minimum replica count.
- Quantization and smaller models, tested on your evaluation set before release.
6. Packaging, dependencies and environments
Native libraries, CUDA versions, large weight files and mismatched Python versions cause many "works on my machine" incidents. Images grow to many gigabytes, and deploys slow down.
CUDA adds a driver constraint. NVIDIA's compatibility guide lists a minimum driver for each toolkit family: 525 or newer for CUDA 12.x and 580 or newer for CUDA 13.x. An image built on a newer toolkit can fail on nodes with an older driver.
Fix.
- Build containers in CI from pinned dependencies, and test the built image, not only the source tree.
- Keep weights out of the application image and load them by version from an artifact store at startup.
- On Kubernetes, ship weights as their own OCI artifact. KServe Modelcars do this with an
oci://storage URI. Kubernetes image volumes mount an OCI image as a read-only volume and have been stable since Kubernetes v1.36. - Use the same base image for training and serving where you can, and record the driver version per node pool.
7. Versioning and rollback
Replacing a model is a release, and a release needs a record of what changed, a limit on how many users see the new version first, and a quick rollback. A team that overwrites a file in a bucket has no record, no limit and no rollback.
Fix. Register every model version with its training data, code commit and parameters. Deploy by version identifier, so the service and the logs both name the version. Keep the previous version deployable without a rebuild, so a rollback takes minutes. Release to a fraction of traffic first. Our post Model deployment strategies describes the rollout patterns, with configuration examples.
8. Testing a model that has no single right answer
Unit tests do not show whether a model got worse. A new version can raise the overall score and break an important customer segment.
Fix.
- Keep a versioned evaluation set that includes hard cases and examples from past incidents.
- Release only when the metrics pass for each segment as well as overall, and compare with the current production model on the same data.
- Add behavioral tests from the CheckList paper. A minimum functionality test checks simple cases the model must get right. An invariance test checks that an irrelevant change, such as a different name, leaves the output the same.
- For LLM applications, run the evaluation set in CI on every change to a prompt, model or retrieval setting. Our post LLM monitoring and observability explains how to add production failures to the evaluation set.
Google's ML Test Score paper gives a longer rubric of tests for data, model, infrastructure and monitoring.
9. Security, privacy and compliance
Prediction logs contain user data, and training sets can hold personal data that someone later asks to delete. Model endpoints are an attack surface, and so are model files.
Python pickle files can run code when loaded, and the scikit-learn persistence guide warns never to load a pickle from an untrusted source. Formats such as safetensors and the skops loader avoid this risk for weights and scikit-learn models.
LLM applications add risks that classical models lack. The OWASP Top 10 for LLM Applications 2025 lists prompt injection, sensitive information disclosure, excessive agency and unbounded consumption, among others.
Fix.
- Decide what you log, mark which fields hold personal data, and set a retention period.
- Make sure a deletion request reaches training data, feature stores, logs and vector indexes.
- Put authentication and rate limits in front of every endpoint.
- Load model files only from your own registry, and prefer formats that do not run code.
Three of our guides cover the privacy side: PII redaction for LLM prompts and traces, Access and deletion requests against LLM logs and vector stores, and LLM privacy: data flows, duties and controls. For models that make decisions about people, read our guide Where the EU AI Act and GDPR overlap. This post is not legal advice.
10. Ownership
Unclear ownership delays the response to an incident. Three groups work on a model in production: the data scientist who trained it, the platform team that runs the cluster, and the product team that owns the feature. Each group can assume another group will respond, so an alert fires and nobody acts.
Fix. Name one owner per model. Write a short runbook that says how to check health, how to roll back and whom to contact in the teams that produce its input data. Review the runbook after each incident, using a blameless format such as the one in Google's SRE book chapter on postmortems.
Machine learning model deployment best practices: a pre-launch checklist
- Preprocessing and model ship as one versioned artifact, with pinned library versions.
- The service validates inputs and has a defined behavior for invalid input.
- The service logs feature vectors and predictions, within your retention policy.
- Dashboards show latency and error rate, with alerts.
- At least one input or prediction drift signal has a monitor.
- The previous model version can be restored without a rebuild.
- The model has a named owner and a runbook.
If a model makes decisions about people, such as credit, hiring or access to a service, also plan a legal and fairness review, because engineering checks alone do not cover those risks.
FAQ
How is AI model deployment different from deploying ordinary software?
A model's behavior depends on data as well as code, so the same code can give worse predictions when the input data changes. A model release therefore needs data checks and quality monitoring in addition to the usual software tests.
What is the difference between data drift and concept drift?
Data drift is a change in the distribution of the inputs, such as a new mix of customer ages. Concept drift is a change in how inputs relate to the outcome, such as the same customers now churning for a different reason. Input monitoring catches data drift without labels, but concept drift usually shows only when labels or business outcomes arrive.
Should drift trigger automatic retraining?
Retraining on a schedule is common and safe when every new version passes the same evaluation gate. Retraining on every drift alert is riskier, because the alert may come from a broken upstream feed.
How do I find training-serving skew?
Log the feature vector at serving time. Recompute the same features for the same entities and timestamps with the training pipeline, and compare the two values feature by feature.
Batch or real-time serving?
Use batch scoring when nobody waits for the answer, such as nightly risk scores or recommendation lists. Use an online service when the input exists only at request time. Our post Model deployment strategies compares the two in a table.
Do LLM applications have the same problems?
Most of them, in a different form. Prompt templates, retrieval settings and the provider's model version all change behavior, and each needs versioning and an evaluation gate. A wrong answer still returns HTTP 200, the success code, so error metrics miss it. Tracing and evaluation of answers find these failures, as drift monitoring does for classical models.
Need this built?
Our MLOps service covers packaging, serving, monitoring and release pipelines for machine learning models. If a model works as a prototype but not yet in production, request a quote and describe what blocks the release, or email [email protected].