Model deployment
Debug the bad model-service release
When schema drift drops a feature; scores shift 0.3 without version bump, the system must degrade on purpose without widening blast radius.
1Learn the idea
Read
Classify and bound retries
Map failure classes for POST /v1/predict: retryable vs fatal vs needs-human. Retries need budgets, jitter, and idempotency rules aligned to response includes model_version; unknown feature schema → 422, never silent default. The chapter’s signature failure — schema drift drops a feature; scores shift 0.3 without version bump — must take a deliberate branch, not a generic catch-all.
Read
Containment path
Implement the degrade/rollback/refuse behavior growth analyst calling /v1/predict with customer features needs when MODEL-SCHEMA-DRIFT-22 repeats. Prefer scoped controls (one flag, one weight, one tenant, one secret version) over fleet-wide restarts. Preserve evidence; do not delete logs to “clean the demo.”
Read
Implementation artifact
if psi(live_scores, baseline_scores) > 0.1:
page("score_distribution_shift", model_version=MODEL_VERSION)
Read
Verify harm reduction
After containment, check schema_reject_rate visible and score_psi ≤ 0.1 vs baseline week moves in the safe direction and watch for retry amplification. Write the stop condition that ends the incident response for this lab.
Read
Stage depth
Chaos note: inject only one fault class at a time and restore fixtures after. Watch for dual failures — dependency down and retry amplifier — which is how schema drift drops a feature; scores shift 0.3 without version bump becomes an outage. Customer communication templates (even if only for the drill) beat silence. If you queue deferred work, define poison-message handling. Budget documents should state the maximum extra spend allowed during retries. Close the loop by linking the containment action to a dashboard panel for schema_reject_rate visible and score_psi ≤ 0.1 vs baseline week.
Read
Field notes for `model-deployment` / `failure-handling`
Draw a state diagram for degrade modes and put it in the repo as ASCII if needed. Cap concurrent retries across the process, not only per request. Ensure cancellation propagates to downstream HTTP clients. When failing closed, choose a user-visible message that does not leak internals. Practice the single command that flips the kill switch or weight to zero. After recovery, drain or inspect deferred work before declaring green. In this chapter the product is versioned prediction HTTP service for churn risk scores, the human stakeholder is growth analyst calling /v1/predict with customer features, and the incident id you design against is MODEL-SCHEMA-DRIFT-22. Re-state the oracle in your notes — fixture row → score in [0,1] with model_version=churn-xgb-1.4.2 — and keep the invariant visible: response includes model_version; unknown feature schema → 422, never silent default. Track schema_reject_rate visible and score_psi ≤ 0.1 vs baseline week as the scoreboard. Surface under change control: POST /v1/predict. If you only have forty minutes, finish the fixture for schema drift drops a feature; scores shift 0.3 without version bump before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Go deeper
Before you start
Why this matters
Assume schema drift drops a feature; scores shift 0.3 without version bump is happening right now. Write the first safe action, the signal that confirms containment, and the action you will not take (infinite retry, broad restart, deleting evidence). Tie the plan to invariant: response includes model_version; unknown feature schema → 422, never silent default.
In the wild
See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.