Let’s Get Certified
Module 10 / 13 · Deployment and orchestration of ML and AI workflows

Gate model releases and preserve a rollback target

An approved training artifact is ready, but the live route still needs a controlled rollout.

Gate model releases and preserve a rollback target

An approved training artifact is ready, but the live route still needs a controlled rollout. Save exact artifact, image, prompt and index versions. A canary limits exposure while a gate checks whether the candidate should continue serving.

At 2:04:21 the instructor pins a served agent version and describes how to move the route back. The local lab applies a release gate to a model using labeled slices.

Work through the decision

A drift event starts training and a candidate clears aggregate recall, but recall falls sharply for rare returns. Should the pipeline promote?

Check your reasoning

Evaluate predeclared per-slice gates and minimum sample sizes. Hold or roll back the candidate if a required slice fails. Retain the previous registered model, image and endpoint configuration.

MLA-C02 recording · 2:04:21

Continue in the recording · 2:07:10 · 2:14:24 · 2:21:07.

Decisions and tradeoffs

Immutable registered model version
An approved version identifies a reproducible artifact and provides a stable target for audit and rollback.
Canary traffic shift
Start with a small served cohort, evaluate a defined health window and route back on breach.
Versioned prompt regression suite
Test prompt versions on fixed representative inputs and expected policy or quality outcomes before promotion.
Knowledge base sync and retrieval gate
Refresh the index after approved document changes and verify retrieval on known cases before advancing its version.
Triggered retraining with approval
A drift or schedule event can start training while evaluation and approval control production promotion.
Stage-specific build logs and artifacts
Locate the first failed build, test or deployment stage and inspect its exact revision, permissions and artifacts.

Practice each guide skill

The numbers below follow the AWS task and skill identifiers.

  1. Define a canary fraction, observation window and rollback rule. Prove the previous route can still be served.
  2. Trace a source revision through connection, build, artifact publication, pipeline approval and deployment. Inspect the first failed stage.
  3. Specify data channels, compute and artifacts for a managed training job; define input and output contracts for inference.
  4. Use unit tests for transformations, contract tests for the endpoint and slice-based quality gates before promotion.
  5. Trigger retraining from new approved labels or a drift signal. Keep production approval distinct from starting the job.
  6. Associate each registry version with training data, code and environment so the prior production result is reproducible.
  7. Version the prompt and evaluation inputs beside the release. Preserve the previous prompt for rollback.
  8. Pin an immutable agent runtime version and change the served version only after task, permissions and tool checks pass.
  9. Test representative prompts, required response fields and allowed actions under controlled fixtures; inspect individual failures.
  10. Reference the exact customized model version in deployment automation. Compare with the last approved model before shifting traffic.
  11. Trigger knowledge-base synchronization after approved source changes. Gate promotion on document counts, known passage hits and freshness.

Official objectives for this lesson

Gate a model release and exercise rollback

An approved candidate clears the overall recall target. Simulate a canary, calculate recall on each labeled slice, and change the served version only if every slice passes. Run with Python 3 and its standard library.

versions = {"stable": "model-v7", "candidate": "model-v8"}
route = versions["candidate"]
true_positives = {"usual": (96, 100), "rare": (7, 10)}
recall = {s: found / total for s, (found, total) in true_positives.items()}
overall = sum(x for x, _ in true_positives.values()) / sum(n for _, n in true_positives.values())
print(f"overall recall: {overall:.2f}")
for name, score in recall.items():
    print(f"{name}: {score:.2f}")
if min(recall.values()) < 0.80:
    route = versions["stable"]
print("served:", route)
Check the result
overall recall: 0.94
usual: 0.96
rare: 0.70
served: model-v7

The candidate passes the aggregate check but misses the rare-slice threshold. An actual rollout also needs a time window, enough labeled examples, alarms and a tested previous deployment target.

Related lesson · Ship pipeline code against a repeatable contract

Knowledge check

Gate model releases and preserve a rollback target quiz

Answer 3 questions. Check each answer for an explanation.

Worked example · Gate model releases and preserve a rollback target