This post compares model deployment strategies, the ways to release a new model version: rolling update, shadow, canary, blue/green, A/B test and multi-armed bandit. Each pattern comes with a configuration example taken from the documentation of a real tool, such as Kubernetes, Istio, Argo Rollouts, KServe, Seldon or SageMaker.
Two decisions come first: how predictions reach the product (batch or online), and how a new version replaces the old one. Our post AI model deployment challenges in production covers the problems that appear after a release, such as data drift and packaging errors.
Batch, online or embedded serving
| Batch | Online (real time) | Embedded or edge | |
|---|---|---|---|
| How it works | A scheduled job scores many records and writes results to a table | A service returns a prediction for each request | The model runs inside the app or on the device |
| Use when | Nobody waits for the answer: nightly scores, recommendation lists, risk rankings | The input exists only at request time, or the answer must reflect the latest state | Connectivity is poor, latency is tight, or data must stay on the device |
| Freshness | As old as the last run | Current | Current, with model updates tied to app releases |
| Operational load | A job, a table and a failure alert | Availability, latency, scaling and on-call | Distribution and version tracking across devices |
| Rollback | Rerun with the previous model | Shift traffic or redeploy | Slow, because it waits for device updates |
Prefer batch when the product allows it. A batch job has no latency target, and you can inspect the whole output before you publish it. A common hybrid computes the expensive parts in batch and runs a light online step at request time.
For batch scoring, the release pattern is simple: run the new model on the full data, compare its output with the current model's output, and publish when the checks pass. The rest of this post covers online serving, where traffic routing decides who sees the new model.
Release patterns compared
| Pattern | Users who see the new model | What it tells you | Extra cost |
|---|---|---|---|
| Rolling update | Everyone, as pods are replaced | The new version starts and passes health checks | A few surge pods |
| Shadow | Nobody | Behavior, latency and resource use on real inputs | A second copy of inference for every mirrored request |
| Canary | A small, growing share | Errors and metrics under real traffic at low exposure | Small |
| Blue/green | Everyone, at one switch | The new environment works before cutover | Two full environments during the switch |
| A/B test | A fixed share for a planned period | Whether the new model improves a product metric | Analysis time and enough traffic |
| Bandit | A share that moves toward the better model | Which model earns more reward, with less traffic on the weaker model | More complex routing and analysis |
Rolling deployment
A rolling deployment replaces old pods with new pods a few at a time. It is the default Kubernetes deployment strategy, so a Deployment does this without extra tools. Kubernetes calls this strategy type RollingUpdate. maxSurge sets how many extra pods can run above the desired count during the update, and maxUnavailable sets how many pods can be down. Both default to 25% of the desired count. The other type, Recreate, stops all old pods before it starts new ones.
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
A rolling update protects availability and does not check quality. Each user gets the new model as soon as a new pod is ready. Use it for low-risk changes, or when the model's output was validated before the release.
Shadow deployment
In a shadow deployment, the new model receives a copy of live requests. The service logs the new model's predictions and never returns them to users, while the old model still answers every request.
Shadow mode is the safest first test of a new model on real inputs. It shows prediction differences, latency and memory use without user impact. It cannot show effects on user behavior, because users never see the new output. Some predictions change what users do: a recommendation, for example, changes what users click. For those models, shadow data says little about real performance. Shadow mode also doubles inference cost for mirrored traffic, and side effects in the serving path, such as writes or emails, must be turned off.
Istio mirrors traffic with the mirror and mirrorPercentage fields of a VirtualService. Istio's mirroring guide says mirrored requests are "fire and forget", so their responses are discarded. Istio also adds -shadow to the Host header of each mirrored request, so the shadow service can recognize a mirrored request, for example to skip side effects.
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: scorer
spec:
hosts:
- scorer
http:
- route:
- destination:
host: scorer
subset: v1
weight: 100
mirror:
host: scorer
subset: v2
mirrorPercentage:
value: 100.0
Two model platforms have shadow mode built in:
- Amazon SageMaker shadow tests add a shadow variant to an endpoint, and only the production variant's responses go back to the caller. Shadow tests do not work on serverless, asynchronous or multi-model endpoints.
- A Seldon Core 2 Experiment takes a
mirrormodel and a percentage. Seldon does not return the mirror's responses to the caller.
Canary deployment strategy
A canary deployment sends a small share of live traffic to the new version. If the monitored metrics stay healthy, the share grows in steps until the new version takes all traffic. If a metric fails, traffic returns to the old version.
A canary needs enough traffic to show a problem in a reasonable time. A service with a few hundred requests a day can spend days in the first step before its metrics mean anything. Decide whether each user always goes to the same version, because a user who switches between models mid-session gets inconsistent answers and adds noise to the comparison.
Argo Rollouts
Argo Rollouts replaces a Deployment with a Rollout resource that has canary steps. Each setWeight step sets the share of traffic for the new version. Without a traffic router, Argo approximates that share with replica counts: at 20% of 10 replicas, 2 pods run the new version. Exact weights need a traffic router such as Istio, NGINX or an AWS load balancer. A pause step with no duration waits until someone runs kubectl argo rollouts promote.
strategy:
canary:
steps:
- setWeight: 20
- pause: {duration: 5m}
- analysis:
templates:
- templateName: success-rate
- setWeight: 50
- pause: {}
The analysis step runs an AnalysisTemplate, which runs a query against a metric provider, such as Prometheus. A condition such as result[0] >= 0.95 checks the query result, for example a success rate of at least 95%. When the condition fails more times than the template's failureLimit, Argo aborts the rollout. For a model, the query can measure error rate, latency, or the share of predictions in an expected range.
Flagger, part of the Flux project, also automates canary, A/B and blue/green releases. Like Argo Rollouts, Flagger checks metrics at each step and rolls back on failure.
KServe
KServe has a canaryTrafficPercent field on the predictor. KServe is Apache 2.0 licensed and has been a CNCF incubating project since November 2025. When you apply a new model URI with this field, the new revision gets that share of traffic.
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
name: sklearn-iris
spec:
predictor:
model:
modelFormat:
name: sklearn
storageUri: gs://kserve-examples/models/sklearn/1.0/model-2
canaryTrafficPercent: 10
Remove the field and re-apply to promote the new revision to 100%. Set it to 0 to send all traffic back to the previous revision. The KServe docs say canary rollout works only in Serverless mode, which runs on Knative. The Standard mode, formerly called RawDeployment, supports only a Kubernetes rolling update.
Amazon SageMaker
SageMaker deployment guardrails start the new version on a separate set of instances and then shift traffic to it. AWS calls this process blue/green deployment, and inside it a canary mode shifts traffic in two steps. The traffic mode is ALL_AT_ONCE, CANARY or LINEAR. After each shift, SageMaker waits for a set time, called the baking period, and watches CloudWatch alarms. If an alarm fires, SageMaker sends all traffic back to the old instances. The example below comes from SageMaker's canary guide:
"DeploymentConfig": {
"BlueGreenUpdatePolicy": {
"TrafficRoutingConfiguration": {
"Type": "CANARY",
"CanarySize": {"Type": "CAPACITY_PERCENT", "Value": 30},
"WaitIntervalInSeconds": 600
},
"TerminationWaitInSeconds": 600,
"MaximumExecutionTimeoutInSeconds": 1800
},
"AutoRollbackConfiguration": {
"Alarms": [{"AlarmName": "<your-cloudwatch-alarm>"}]
}
}
The API reference limits CanarySize to 50% of the instance count. In LINEAR mode, a LinearStepSize field sets each step at between 10% and 50%. With no update policy, SageMaker uses blue/green with all-at-once shifting.
Blue/green deployment
Blue/green runs two full environments. Blue serves production, and green runs the new version and receives test traffic or synthetic checks. When green passes, all traffic switches at once, and switching back is the rollback.
Use blue/green when the old and new versions expect different request formats or database schemas, so they cannot share live traffic. It also suits teams that want a rollback in one step. Blue/green needs capacity for two environments during the switch, and the cutover exposes every user at once. A passing green environment shows that the new version runs, not that the new model predicts better.
In Argo Rollouts, the blueGreen strategy uses an activeService for production and a previewService for the new version. The default for autoPromotionEnabled is true, so set it to false to wait for a manual promotion. SageMaker's ALL_AT_ONCE mode is blue/green with a baking period and alarm-based rollback.
A/B testing
An A/B test assigns users to model versions at random and keeps each user in one group. It then compares a product metric, such as conversion, retention or resolution rate, over a planned period. A canary checks that the new model is safe, and an A/B test checks that it is better.
SageMaker, Seldon Core 2, Istio and KServe all support weighted routing:
- SageMaker production variants split traffic by weight. A request can name a
TargetVariantto override the split. - A Seldon Core 2 Experiment lists candidate models with weights. Each candidate's share of traffic is its weight divided by the sum of all weights.
- Istio splits by the
weightfield on each route destination. - A KServe InferenceGraph has a Splitter node that divides traffic between models by weight.
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: churn-ab
spec:
default: churn-v1
candidates:
- name: churn-v1
weight: 50
- name: churn-v2
weight: 50
Random request-level weights do not keep a user in one group. For a clean A/B test, assign the group from a hash of the user ID in your application or gateway, and pass the group to the model service.
Fix the sample size and the analysis plan before the test starts. Checking the result repeatedly and stopping when it looks good inflates the false positive rate. The article How Not To Run an A/B Test explains the effect, and the same site's sequential test is one method that allows an early stop.
Multi-armed bandits
A fixed A/B split sends half the traffic to the worse model for the whole test. A multi-armed bandit moves traffic toward the model with the better reward as evidence comes in. Epsilon-greedy sends a fixed small share to random models and the rest to the current best. Thompson sampling gives each model a share of traffic equal to the estimated chance that the model is the best.
Seldon Core v1 shipped router examples for both methods. It still gets maintenance releases, and Seldon points new users to Core 2. Seldon Core 2 has no built-in bandit, so teams usually write the router in the application.
A bandit needs a reward that arrives soon after the prediction, such as a click. With delayed labels, the bandit allocates traffic on stale evidence. Bandit results are also harder to analyze than a fixed split, so most teams add a bandit only after a standard A/B setup works.
Choosing a pattern
| Situation | Pattern |
|---|---|
| Nightly scoring job | Score the full data with the new model, compare with the old output, publish when checks pass |
| First online release of a new model | Shadow, then canary |
| Routine retrain of an online model | Automated evaluation that blocks a weaker model, then canary with automatic rollback |
| Question of whether a model improves a product metric | A/B test after a canary shows the model is stable |
| Change tied to an API or schema version | Blue/green |
| Low traffic and low stakes | Rolling update with a smoke test and a manual rollback |
| Many candidate models and a fast reward signal | Bandit |
What every pattern needs underneath
Traffic routing works only when four things are in place:
- Versioned artifacts. The router must target a specific version, such as version 14, not "latest". A model registry records each version and the data and code behind it. MLflow's registry uses aliases such as
models:/churn@champion. MLflow deprecated its older Staging and Production stages in version 2.9, so point the router at an alias instead of a stage. - Metrics per model version. Latency, errors, prediction distribution and outcome metrics each carry the label of the version that produced them.
- Written rollback criteria. Set the thresholds that trigger a rollback before the release. A team that sets thresholds during an incident leaves a bad model live for longer.
- A fallback. Decide what happens when the model service is down or returns an invalid result: the previous version, a rule, or a default.
Delayed labels change the plan. If you learn whether a prediction was right only weeks later, a canary cannot use accuracy to decide each step. Decide each step with proxy signals, such as input and prediction distributions or downstream behavior, and evaluate true quality afterward.
LLM applications use the same patterns for prompts, model versions and retrieval settings. Our post LLM monitoring and observability lists the signals that decide whether each rollout step goes ahead.
FAQ
What is canary deployment?
Canary deployment releases a new version to a small share of live traffic first. The share grows in steps while error and latency metrics stay healthy. If a metric fails, all traffic returns to the old version.
Canary release vs blue/green: what is the difference?
A canary release moves traffic to the new version in small steps, so a bad version reaches few users. Blue/green runs two full environments and switches all traffic at once. Blue/green gives a one-step rollback, and a canary limits how many users see a problem.
What is the difference between a canary and an A/B test?
A canary limits risk. It sends a small share of traffic to the new version and stops the release when errors or latency rise. An A/B test measures benefit. It holds a fixed split for a planned period and compares a product metric. Run the canary first, then the A/B test.
Is shadow deployment the same as traffic mirroring?
Traffic mirroring is the network mechanism, such as Istio's mirror field. Shadow deployment is the release practice built on it: the new model gets mirrored requests, and its predictions are logged and compared but never returned.
What canary percentage should I start with?
No standard number exists. Pick the smallest share that still sends enough requests in the first step to detect an error rate above your threshold in the time you are willing to wait. SageMaker caps a canary step at 50% of capacity.
Does KServe canary work in Standard (RawDeployment) mode?
No. The KServe docs say canaryTrafficPercent works only in Serverless mode on Knative. In Standard mode, use a rolling update, or put Argo Rollouts or a service mesh in front of two InferenceServices.
Can Seldon Core 2 be used in production for free?
Seldon Core 2 uses the Business Source License 1.1. The license allows non-production use, and most production use needs a commercial license. Each version converts to Apache 2.0 four years after its release.
Need this built?
We design and build release pipelines like these as part of our MLOps and DevOps services. Our post "What is MLOps?" covers the wider lifecycle. To discuss your rollout, request a quote or email [email protected].