Rollout sequence#
Run the labs#
| Task | Code |
|---|
| Canary simulator, lesson 20 | code/main.py |
|---|
| Inject a 25% cost regression | Regression(cost_mult=1.25) |
|---|
| Inject an 80% latency regression | Regression(latency_mult=1.80) |
|---|
| Check one stage against the gates | check_gates(metrics) |
|---|
| Sequential A/B simulator, lesson 21 | code/main.py |
|---|
| Sample size at 80% power | fixed_sample_size(baseline, lift) |
|---|
| Simulate a 5% lift | simulate(0.03, 0.0315) |
|---|
| Chaos runner, lesson 24 | run_experiment(e) |
|---|
Rollout and A/B terms#
- Shadow mode
- zero user impact. A smoke test, not a quality test.
- Canary
- gradual rollout to real users, with metric gates.
- Non-determinism
- up to 15% accuracy variation run to run on identical inputs.
- Policy flag
- rollback in config. It takes seconds, not hours.
- Model pin
- immutable registry digest. It does not auto-upgrade.
- Eval vs A/B
- an eval asks "can the model do the job?" An A/B test asks "do users care?"
- CUPED
- regress out pre-period variance. Typical reduction is 30-70%.
- SRM
- sample ratio mismatch. A 50/50 split that gives 47/53 is broken.
Chaos runner experiments#
| Command | What it does |
|---|
ERROR_BUDGET_PER_DAY = 0.001 | 99.9% SLO |
|---|
EXPECTED_ERROR_RATE = 0.0005 | Baseline error rate |
|---|
burn_rate > 2.0 | First half of the abort rule |
|---|
e.blast_radius_pct > 0.2 | Second half. Both must be true |
|---|
pod kill (1 decode replica) | 5 min, 5% blast. Completes |
|---|
provider 429 fallback | 5 min, 30% blast. Aborts |
|---|
malformed prompt tokenizer stall | 3 min, 10% blast. Completes |
|---|
Drift report#
- Input
layers, observed and optional sensitive. Later layers win.- equal
- the effective value and the observed value match.
- changed
- the values differ under
reflect.DeepEqual. - missing
- the layers declare the key. The observed config does not.
- unexpected
- the observed config has a key that no layer declares.
- History
- every layer that set the key, in order. Shadowed values stay.
- Redaction
- password, secret, token, api-key and credential names become
[REDACTED]. - Output
schemaVersion 1. The file has owner-only permissions 0600.
Q&A#
- Does shadow mode prove quality?
- No. It catches cost, length, refusal and hard errors only.
- When do you skip the A/B step?
- When the new model is only an improved version.
- Is "stable" equal to baseline?
- No. Stable means within expected variance.
- 20 tests at 95% confidence?
- One false positive by chance. Use Bonferroni or Benjamini-Hochberg.
- Which chaos experiment aborts?
- Provider 429. Burn rate is over 2.0 and blast radius is over 20%.
- What does
--check return on drift? - Exit status 2.
Tips#
- Fix the rollback path before you roll. It must not need a redeploy.
- Track cost per request. A 20% better model can cost 3x per call.
- Pause chaos when daily error-budget burn exceeds 2x expected.
- First chaos test: pod-kill one decode replica under steady traffic.
- Cadence: weekly canary, monthly game day, quarterly audit.
- Put named source identifiers in layer names, never secret values.