Canary rollouts for ML models, decided by statistics. Each traffic step is tested against the stable version on latency, errors, prediction quality and drift with confidence intervals, and the rollout is promoted, rolled back or frozen for a human on its own.
Benchmark scenarios as expectedBaseline, latency failure, error failure, quality failure and success: two rollbacks, one freeze for a human and one promotion, each matching the expected outcome.
+400 ms injected on the canary30.9 s
Latency regression to rollbackFrom the rollout starting to the worker's rollback, with the worker's production 15 s poll interval. The 50% error fault was rolled back in 30.7 s.
Plus 395 backend tests8
Real-stack CI scenariosCI boots the real stack and runs promotion, rollbacks on latency, recall and drift, and router restarts against the real worker, then the observability check and Playwright.
A model can be up and still be wrong.
A new model version starts, answers requests and passes its health check. None of that says whether its predictions are as good as the version it replaces, or whether it is slower on real traffic. Deploying it to everyone at once turns that question into an incident.
ModelOps Control Plane makes a new version earn production traffic one step at a time. Each step is tested against the stable version on latency, errors, prediction quality and drift, with confidence intervals, so the decision rests on evidence instead of a dashboard glance.
A worker promotes, rolls back or freezes the rollout for a human on its own, and explains every decision in plain English. It all runs with one docker compose up on a 16 GB laptop.
Built for the person shipping the model.
Start a rollout from the dashboard or the API, then let the control loop do the watching.
Ramp traffic gradually
A canary climbs 10%, 25%, then 50%, one tested step at a time, and a pass at 50% promotes it. Traffic goes through a real gateway with sticky routing, a circuit breaker per version and rate limits.
A bad version reaches a small share of requests before anyone has to notice it.
Decide with statistics
Error rate, p95 latency and recall each come with a confidence interval and a p-value. A check fails only when the whole interval is past the limit, and the error budget is spent across a rollout's repeated evaluations.
Two unlucky requests cannot roll back a good model, and re-checking every cycle cannot add up to a false rollback.
Judge quality, not just uptime
Ground-truth labels arrive late and incomplete through a real ingestion API. Quality checks wait for a matured window and enough positive examples. Before any label arrives, drift checks compare the canary's inputs and scores with its training data.
A model that answers fast but predicts badly is caught too.
Act on its own, explain itself
A worker promotes, rolls back or freezes the rollout for a human. Every check writes a sentence saying why, the timeline tells the whole story, and each decision sends a signed webhook.
An operator reads why a rollout ended instead of reconstructing it from graphs.
Heal routing drift
The database holds the desired traffic split, the router holds the observed one. A reconciler repairs any difference, even after the router restarts and forgets everything.
A restart or a failed push never leaves traffic on the wrong version.
From 10% to promoted.
The Gateway page during a live rollout: beam width is each version's share of traffic, speed is its request rate. Below it, the control loop that moves the split.
Start. A rollout sends 10% of a model's traffic to the canary. The worker reads its state from the control plane every cycle and acts through the same API an operator uses.
Measure. Reliability checks read the most recent window. Quality checks read an older, matured window, because labels arrive late.
Decide. Each check compares the canary with stable and stores the interval it measured. One FAIL rolls the canary back; one INCONCLUSIVE holds it where it is.
Step up. A PASS moves the canary to 25%, then 50%. A pass at 50%, while both sides still serve real traffic, promotes it.
Freeze. A rollout that stays undecided after its retries is frozen for a human, who promotes or rolls it back from the dashboard.
Explain. Every state change, worker action and policy result lands on one timeline, marked automatic or manual with the operator's name.
Fail on the interval, not the estimate.
A check passes when its estimate is within the limit, fails when the whole interval is past it, and is inconclusive when the interval still reaches back across. The overall verdict is FAIL over INCONCLUSIVE over PASS.
Check
Measures
Statistics
max_error_rate
Canary 5xx share
Wilson score interval, exact binomial test
latency_p95_increase
Canary p95 vs stable p95
Bootstrap interval of the p95 ratio, one-sided Mann-Whitney U
minimum_recall
Recall over matured labels
Wilson score interval, exact binomial test
feature_drift
Canary inputs vs training data, no labels needed
PSI corrected for sample size, chi-square with Bonferroni
prediction_drift
Canary scores vs validation scores, no labels needed
PSI corrected for sample size, chi-square test
Evidence gates
Enough requests, labels, label coverage and positive labels
Gates: INCONCLUSIVE until met
Thresholds and the confidence level, 95% by default, are set per rollout. The level covers the whole rollout: the first look is held to 97.5%, later looks to more.
The control plane never touches a model.
The gateway serves predictions and reports one metric per request. The control plane decides and pushes revisioned traffic splits back. The router only ever receives version-to-weight maps, so each side can be restarted, replaced or scaled without the other noticing.
The control plane holds each model's desired traffic split with a monotonic revision and pushes it to the gateway, which only ever receives version-to-weight maps, never a host. The gateway applies a rate limit, sticky routing and a circuit breaker per version, forwards each prediction with a prediction_id, and reports one metric per request. A stateless worker evaluates the policy checks with confidence intervals over a fresh reliability window and an older, matured quality window, then steps, promotes, rolls back or freezes the rollout through the same API an operator uses, and reconciles the router's observed split back to the desired one.
01
Prediction / traffic path
A failed request is answered 503 and recorded against the version it was meant for, never sent to another version.
Client Traffic requests Gateway. Gateway routes Stable Model (current version). Gateway routes Canary Model (candidate version, never failed over). Stable Model and Canary Model emits Control Plane.
ClientClient Trafficprediction request
requests
ServiceGatewayrate limit, sticky routing, circuit breaker per version
routes
ServiceStable Modelcurrent version
ServiceCanary Modelcandidate version, never failed over
emits
ControlControl Planeone prediction_id-tagged metric per request
02
Delayed ground-truth / quality path
Label and metric writes are independent; a GroundTruthLabel is durable even before its matching PredictionMetric arrives.
The database is the durable desired routing state; the router's config is an in-memory, restart-losable cache the control plane pushes best-effort after committing that decision.
TrafficAllocation revisions are scoped per model (RoutingGeneration), not per deployment, so the router rejects an equal-or-stale push even when it comes from an already-superseded rollout.
SQLAlchemy optimistic concurrency (a version column bumped on every commit) and a DB-level partial unique index together stop a losing concurrent action from corrupting a rollout and cap each model at one unresolved deployment at a time — INCONCLUSIVE counts as unresolved too.
INCONCLUSIVE means frozen for manual review, not a silent revert to the previous traffic split — its allocation stays the router's authoritative desired state until a human resolves it, the same as a completed PROMOTED or ROLLED_BACK rollout.
These hold through restarts, failed pushes and late data, so the traffic split always matches the decision behind it.
A down canary is never hidden
The gateway never sends a request to a different version when one is down. A failed request is answered 503 and recorded against the version it was meant for, so a broken canary is rolled back instead of looking idle.
Every traffic split change gets a new, monotonic revision in the database. The router's copy is a cache; a failed push never fails the rollout, and the next reconcile tick closes the gap.
A check fails when the entire confidence interval is past the limit and is INCONCLUSIVE when it straddles it. The first look is held to 97.5% and later looks to more, so a rollout's 95% level covers all its evaluations.
Wait for positive labels
Recall's denominator is positive examples. At a 2% fraud rate a window can hold hundreds of labels and only two frauds, so recall waits for enough positives before it speaks.
Catch drift before labels
Feature drift reads the training profile written next to each model; prediction drift reads its validation scores. Both act from the first window, before any ground truth exists.
A worker with no state
The worker reads everything from the control plane each cycle and only calls its REST endpoints, so a crash or restart loses nothing, and one rollout can be paused without stopping the worker for others.
Keep the boundary narrow
The control plane never talks to a model container, and the router only receives version-to-weight maps, never a host. Each side can be restarted or replaced without the other noticing.
Every scenario ends as expected.
Each benchmark runs against the real stack with Locust at about 100 requests per second, under its own model name, with faults switched on at runtime and always reset afterwards.
Scenario
Fault
Outcome
Time to action
Latency failure
+400 ms on canary
Rolled back
30.9 s
Error failure
50% 5xx on canary
Rolled back
30.7 s
Quality failure
Weak model
Frozen for a human
46.3 s
Success
None
Promoted at 50%, then 100%
55.9 s
Time to action runs from the rollout starting to the worker's final decision, with the worker's production 15 s poll interval. The baseline served 29,871 requests with 0 errors at p95 97 ms.
Every screen below is the running stack. Open any screenshot to see it full size.
See every model at once
Rollout outcomes and who decided them, the gateway fanning out to each active model with its live split, and the rollouts in flight.
Follow every request
Clients, the gateway's rate limit, sticky routing and circuit breakers, then the control loop that measures the split and moves it.
Fail fast when a canary is down
After five consecutive failures the breaker opens and the gateway fails fast instead of waiting on timeouts, until a half-open probe succeeds.
See the rollback
A canary with 400 ms injected: p95 latency per version across the rollout, with the traffic steps, the limit and the moment the worker rolled it back.
Read the evidence
Each check stores its observed value, the interval drawn against the limit, the p-value and a plain-English reason.
Read the story
Every state change, worker action and policy result in one timeline, top to bottom.
Control a live rollout
The split the router actually applied, the canary analysis against stable, and the controls to pause automation, promote or roll back.
Run the benchmarks
Five repeatable end-to-end scenarios, started from the dashboard or the CLI.
Watch it in Grafana
Canary against stable per model, the control loop and circuit breakers, with decisions marked on every graph.
Trace one prediction
Router, readiness check, model service and model.inference as one trace in Jaeger.
Tested on the real stack.
Every real bug in this project was found by running the actual stack, so CI boots it on every push and runs the real worker against it.
Benchmarks
5 of 5 as expected
Locust against the real stack · about 100 req/s
Latency and error faults rolled back in 30.9 s and 30.7 s, the weak model frozen for a human in 46.3 s, the healthy canary promoted in 55.9 s. Baseline: 29,871 requests, 0 errors, p95 97 ms.
Real-stack CI
8 scenarios on every push
Real worker, router and models
Promotion on a real recall PASS, rollbacks on latency, recall, feature drift and prediction drift, and two router restarts repaired by reconcile and startup sync.
Drift without labels
Rolled back before any label
CI scenarios 7 and 8
A canary fed inputs with amount scaled 4× is rolled back on feature drift; one on 20% fraud traffic is rolled back on prediction drift while every input stays within limits.
Verification
395 backend tests
ruff, mypy --strict, eslint, tsc, next build
An API-contract job regenerates the OpenAPI schema and TypeScript types and fails on any diff. Labels come from a synthetic dataset through the real ingestion API, not production feedback.
Run it locally.
Python
FastAPI
SQLAlchemy
SQLite
Alembic
Next.js
TypeScript
scikit-learn
Prometheus
Grafana
OpenTelemetry
Jaeger
Locust
Playwright
Docker Compose
One command trains the models and another starts the stack: the control plane, dashboard, gateway, five model services, the worker, a webhook sink, Prometheus, Grafana and Jaeger.
git clone https://github.com/negativexq/modelops-control-plane.git
cd modelops-control-plane
make prepare-models
make dev
make benchmark-latency-failure
# Open http://localhost:3000
Labels flow through the real API but come from a synthetic dataset. SQLite, one worker and one router keep it on a laptop; the README lists what changes for production.
In short
What is ModelOps Control Plane?
ModelOps Control Plane is a FastAPI and Next.js platform that rolls out a new ML model version through a real gateway, 10% then 25% then 50% of traffic. At each step a policy engine compares the canary with the stable version on error rate, p95 latency, recall from delayed labels, and input and prediction drift, each with a confidence interval. A stateless worker promotes, rolls back or freezes the rollout and explains every decision in plain English.
What problem does ModelOps Control Plane solve?
A model can start, answer requests and still be wrong for production. Deciding whether a new version deserves more traffic means comparing it with the current one on reliability and on quality, when labels arrive late and incomplete, without letting two unlucky requests roll back a good model or a thin sample promote a bad one. The routing that carries the decision also has to survive restarts and failed pushes.