Production Runbook
Phase 7 · Document 10 · Production Serving Prev: 09 — Cost Controls · Up: Phase 7 Index
Table of Contents
- Why This Matters
- Core Concept
- Mental Model
- Hitchhiker's Guide
- Warmup Readings
- Deep Readings and External References
- Key Terms
- Important Facts
- Observations from Real Systems
- Common Misconceptions
- Engineering Decision Framework
- Hands-On Lab
- Verification Questions
- Takeaways
- Artifact Checklist
1. Why This Matters
This is the capstone of Phase 7: the operational discipline that turns the components you've built (engine, batching, caching, streaming, routing, observability, cost controls) into a service you can launch, operate, and recover without heroics. A runbook is what lets a tired on-call engineer at 3am resolve an incident by following steps instead of guessing — and what lets you launch safely (checklist), change safely (canary/rollback), and respond predictably (incident playbooks). LLM systems add failure modes ordinary services don't have — KV-cache OOM, model/prompt regressions, cost spikes, silent quality drops, prompt-injection — so the runbook must cover them explicitly. Shipping without one is how a provider blip becomes a multi-hour outage and a quality regression ships unnoticed.
2. Core Concept
Plain-English primer: launch safely, change safely, recover predictably
A production runbook has three jobs, each a checklist or playbook:
- Launch safely — the pre-launch checklist. A gate you pass before taking traffic: is everything from Phases 5–7 actually configured and tested?
- Change safely — rollout & rollback. Models, prompts, and routes change constantly; you ship changes via canary / staged rollout with a fast rollback, and you pin versions so nothing changes under you (Phase 5.10).
- Recover predictably — incident playbooks. For each common failure (latency, errors, cost, quality, capacity), a step-by-step diagnosis→mitigation, anchored to the observability dashboard.
The pre-launch checklist (LLM-specific)
QUALITY
☐ Eval harness passes on a golden set (incl. the FALLBACK models) [Phase 12, 07]
☐ Tested on 100+ real production-like samples
☐ Online quality signal wired (judge/JSON-valid/refusal) [08]
CONFIG
☐ max_tokens set on every path; context cap (--max-model-len) sane [09, 01]
☐ Model + provider + version PINNED (no aliases drifting) [5.10]
☐ Prompt/prefix caching enabled where applicable [05]
RELIABILITY
☐ Fallback chain configured AND chaos-tested (kill primary) [07]
☐ Circuit breaker + retries (typed by failure) configured [07]
☐ Streaming tested e2e: forward, disconnect-cancel, mid-stream error [06]
☐ Load-tested at expected concurrency; KV ceiling known [03, 04]
COST
☐ Per-user/project budgets + global ceiling set [09]
☐ Cost/request + attribution dashboards live [08, 09]
OBSERVABILITY
☐ p95/p99 TTFT/TPOT, error rate, KV usage, fallback rate dashboards live [08]
☐ SLOs defined + alerts wired (burn + leading indicators) → on-call [08]
SECURITY/PRIVACY
☐ Secrets/API keys in a secrets manager (not plaintext env) [Phase 14]
☐ PII redaction + log sampling; data-retention policy confirmed [Phase 14]
☐ Prompt-injection / input validation considered [Phase 14]
Rollout & rollback
- Canary / staged rollout: send a small % of traffic (or shadow traffic) to the new model/prompt/route; compare quality, latency, cost against control before ramping. LLM changes are behavioral — a new model can pass smoke tests yet regress your task, so gate the ramp on eval + online metrics, not just "it returns 200."
- Fast rollback: one switch back to the previous model/prompt/route. Keep the prior version pinned and warm.
- Version pinning: pin model versions (not aliases) and prompt versions so behavior is reproducible and changes are deliberate (Phase 5.10).
- A/B for quality: beyond canary, run A/B with an eval/online metric to choose between models, not just to de-risk a deploy.
Incident playbooks (symptom → steps)
| Incident | First checks → mitigation |
|---|---|
| High latency (p95/p99 ↑) | provider status → KV ceiling (gpu_cache_usage_perc≈1 / num_requests_waiting ↑, 04) → scale out / shed load / fail over [07] |
| High error rate | provider status → request shape (over context? bad tool schema?) → roll back recent prompt/model change → fail over [07] |
| Cost spike | max_tokens? prompt/context ballooned (cache busted [05])? reasoning-token share? traffic legit vs abuse? wrong (pricier) route? [09] |
| Quality regression | recent model/prompt change → roll back → run eval set → check provider quant/version drift [5.10] |
| Capacity / OOM | KV ceiling under load → reduce --max-model-len / KV-quant / add replicas → admission control [04, 03] |
| Provider outage | confirm via status/health checks → circuit breaker opens → traffic on fallback → comms [07] |
Each gets a written playbook with the exact dashboard panels, commands, and the rollback switch.
3. Mental Model
LAUNCH SAFELY → CHANGE SAFELY → RECOVER PREDICTABLY
pre-launch checklist canary + rollback incident playbooks
(quality·config· (gate ramp on EVAL, (symptom → dashboard →
reliability·cost· not 200s; pin versions; mitigation → rollback)
observability·security) fast rollback)
│ │ │
└──────── all anchored to the OBSERVABILITY dashboard + SLOs [08] ───────┘
LLM-specific failures to plan for: KV OOM · model/prompt regression · cost spike ·
silent quality drop · provider outage · prompt injection
Mnemonic: checklist before launch, canary+rollback for change, playbooks for incidents — all read off one dashboard, with LLM-specific failures planned in.
4. Hitchhiker's Guide
What to look for first: is there a written pre-launch checklist that's actually been run, a tested rollback, and incident playbooks linked from alerts? If any is missing, you're one bad deploy from an outage.
What to ignore at first: elaborate change-management process for a tiny service — but never skip max_tokens, budgets, a fallback, version pinning, and a rollback. Those are non-negotiable even at small scale.
What misleads beginners:
- "It passed smoke tests, ship it." LLM changes are behavioral — gate the ramp on eval + online quality, not status codes (Phase 12).
- No rollback plan. The fastest incident mitigation is reverting the last change — if you can't, every incident is long.
- Aliases, not versions. Floating aliases mean the provider can change your model under you (Phase 5.10).
- Untested fallback. A fallback you never chaos-tested won't work when you need it (07).
- No quality observability. Silent regressions ship and persist until users complain (08).
How experts reason: they make the system boring to operate: pin versions, gate changes behind canary + eval, keep a one-switch rollback, write playbooks tied to dashboard panels, run game days (chaos tests) so the team has muscle memory, and conduct blameless post-mortems that add the new failure mode to the runbook.
What matters in production: SLO adherence + error budget, MTTR (mean time to recover — driven by playbooks + rollback), change-failure rate (driven by canary/eval), and that every alert links to a playbook. The runbook is a living doc updated after every incident.
How to run an incident: declare it → check the SLO dashboard (which symptom?) → open the matching playbook → mitigate (often roll back or fail over first, diagnose later) → communicate → post-mortem → update the runbook.
Questions to ask before launch: Can I roll back in <5 min? Is the fallback chaos-tested? Are versions pinned? Are budgets + ceilings set? Does every alert link to a playbook? Has the eval gate been run on the exact deployed config?
What silently gets expensive/unreliable: no rollback (long MTTR), unpinned versions (silent drift), untested fallback, no quality gate (regressions ship), and stale playbooks no one updated after the last incident.
5. Warmup Readings
| Title | Why to read it | What to extract | Difficulty | Time |
|---|---|---|---|---|
| 08 — Observability | The dashboard incidents read from | SLOs, signals | Beginner | 25 min |
| 07 — Routing and Fallbacks | The reliability mechanism | fallback, breaker | Beginner | 25 min |
| Phase 5.10 — Provider Variance | Why pin versions | drift, fingerprint | Intermediate | 20 min |
| Phase 6.08 — Local Model Debugging | Symptom→cause discipline | the diagnostic tree | Beginner | 20 min |
6. Deep Readings and External References
| Title | URL | Why it matters | Read first | Lab connection |
|---|---|---|---|---|
| Google SRE — incident response | https://sre.google/sre-book/managing-incidents/ | The IR discipline | roles, comms | Incident lab |
| Google SRE — postmortems | https://sre.google/sre-book/postmortem-culture/ | Blameless learning | template | Post-mortem |
| Google SRE — release engineering | https://sre.google/sre-book/release-engineering/ | Canary/rollback | staged rollout | Rollout lab |
| OpenAI/Anthropic status pages | https://status.openai.com · https://status.anthropic.com | Provider incidents | subscribe | Incident checks |
| vLLM production guide | https://docs.vllm.ai/ | Self-host ops | deployment, metrics | Capacity playbook |
7. Key Terms
| Term | Simple meaning | Technical meaning | Why it matters | Where it appears | How to use it |
|---|---|---|---|---|---|
| Runbook | Ops playbook | Step-by-step procedures | Fast, calm response | ops | Link from alerts |
| Pre-launch checklist | Launch gate | Verifications before traffic | Catch gaps early | release | Run + sign off |
| Canary | Small-% rollout | Staged traffic to new version | De-risk change | deploy | Gate on eval [12] |
| Rollback | Revert | One switch to prior version | Fastest mitigation | deploy | Keep warm |
| Version pinning | Fix the version | Pin model/prompt versions | Reproducibility | config | No aliases [5.10] |
| SLO / error budget | Reliability target | p95/availability + allowance | Prioritize | ops [08] | Drive alerts |
| MTTR | Recovery speed | Mean time to recover | KPI of ops | metrics | Lower via rollback |
| Post-mortem | Incident review | Blameless root-cause + actions | Learning loop | after incident | Update runbook |
8. Important Facts
- A runbook does three jobs: launch safely (checklist), change safely (canary+rollback), recover predictably (playbooks).
- LLM changes are behavioral — gate rollouts on eval + online quality, not status codes (Phase 12).
- The fastest mitigation is usually rollback or failover — diagnose after you've stopped the bleeding.
- Pin model + prompt versions (not aliases) to prevent silent drift (Phase 5.10).
- Chaos-test the fallback — an untested fallback fails when needed (07).
- Every alert links to a playbook, anchored to dashboard panels (08).
- LLM-specific failures: KV OOM (04), cost spikes (09), silent quality regression, prompt injection (Phase 14).
- The runbook is a living doc — every post-mortem adds the new failure mode.
9. Observations from Real Systems
- Mature LLM platforms ship behind canary + eval gates and keep a one-click rollback — because a "better" model often regresses a specific task silently (Phase 12).
- The most common production incidents map exactly to earlier docs: KV-OOM/capacity (04), latency knee under load (03), cost spikes (09), provider outages (07), and prompt/model regressions (5.10).
- Gateways centralize the operational controls (budgets, fallback, version pinning, observability) that the runbook depends on (Phase 8).
- Provider status pages + health checks are the first stop in latency/error incidents — much LLM downtime is downstream.
- Teams that run game days recover faster — the playbook has been rehearsed, so MTTR is low when it's real.
10. Common Misconceptions
| Misconception | Reality |
|---|---|
| "Passed smoke tests, safe to ship" | LLM changes are behavioral — gate on eval + online quality |
| "We'll figure out incidents live" | Without playbooks + rollback, MTTR is long and stressful |
| "Use the model alias for latest" | Aliases drift — pin versions [5.10] |
| "The fallback will just work" | Untested fallback fails when needed — chaos-test it |
| "Diagnose fully before acting" | Stop the bleeding first (rollback/failover), then diagnose |
| "The runbook is a one-time doc" | It's living — every post-mortem updates it |
11. Engineering Decision Framework
OPERATE the service:
LAUNCH: run the pre-launch checklist (quality·config·reliability·cost·observability·security).
Block launch on any unchecked critical item (max_tokens, budgets, fallback, rollback, SLO).
CHANGE: canary/shadow the new model/prompt/route → compare quality+latency+cost vs control
→ ramp only if eval + online metrics hold → keep prior version pinned & warm for rollback.
RESPOND: alert fires → open linked playbook → MITIGATE FIRST (rollback / failover / shed load)
→ diagnose via dashboard+traces → comms → blameless post-mortem → UPDATE the runbook.
PIN: model+prompt versions; no floating aliases. [5.10]
REHEARSE: game-day the top incidents (provider outage, KV-OOM, cost spike) quarterly.
| Incident | Mitigate first |
|---|---|
| Latency/capacity | Scale / shed / fail over; reduce ctx |
| Errors | Roll back recent change; fail over |
| Cost spike | Enforce max_tokens/budget; fix route/prompt |
| Quality regression | Roll back model/prompt; run eval |
| Provider outage | Circuit breaker → fallback; comms |
12. Hands-On Lab
Goal
Produce a real runbook artifact for your serving stack: a pre-launch checklist you've executed, a tested rollback, and one rehearsed incident playbook.
Prerequisites
Steps
- Pre-launch checklist: copy the §2 checklist; for each item, mark configured/tested with evidence (dashboard link, test output). Fix any gaps; note any "accepted risk."
- Canary + rollback drill: deploy a new model/prompt to 10% of traffic; compare quality (eval/online), p95 latency, and cost/request vs the 90% control for a window; then roll back and time how long it takes (target < 5 min).
- Eval gate: show a case where the canary passes smoke tests (200s) but fails the eval gate (quality regression) — and that your process blocks the ramp. (Construct it with a deliberately worse prompt/model.)
- Incident game day: pick one — provider outage (kill the primary, confirm circuit breaker + fallback, 07) or KV-OOM (overload until
gpu_cache_usage_perc≈1, confirm admission control/shedding, 04). Follow your playbook; record detection time, mitigation, and MTTR. - Post-mortem: write a short blameless post-mortem (timeline, root cause, action items) and add the failure mode + fix to the runbook.
Expected output
A runbook document containing: an executed pre-launch checklist, a measured rollback time, an eval-gate-blocks-bad-canary demonstration, one rehearsed incident playbook with MTTR, and a post-mortem.
Debugging tips
- Rollback is slow → prior version not pinned/warm; fix that first.
- Canary "looks fine" but users complain → you gated on 200s, not quality; add the eval/online gate.
Extension task
Add shadow traffic (mirror prod requests to the candidate without serving its output) to compare quality/latency/cost with zero user risk before canary.
Production extension
Wire each alert to its playbook URL; schedule quarterly game days; track MTTR and change-failure rate as ops KPIs.
What to measure
Checklist completeness; rollback time; whether the eval gate blocks a bad canary; incident detection time + MTTR.
Deliverables
- An executed pre-launch checklist with evidence.
- A rollback drill result (time-to-revert).
- One incident playbook + a blameless post-mortem that updated the runbook.
13. Verification Questions
Basic
- What three jobs does a production runbook do?
- Why gate LLM rollouts on eval/online quality instead of status codes?
- Why pin model versions instead of using aliases?
Applied 4. Walk through your first five moves when p95 latency breaches the SLO. 5. Design a canary process for swapping the primary model, including the gate and rollback.
Debugging 6. A new prompt shipped and quality dropped, but all responses are 200 OK. How do you detect and recover? 7. A cost spike with flat traffic — runbook steps?
System design 8. Write the incident playbook for a primary-provider outage (detection → mitigation → comms → post-mortem).
Startup / product 9. How do MTTR, change-failure rate, and SLO adherence translate into customer trust and enterprise-readiness?
14. Takeaways
- A runbook = launch safely (checklist) + change safely (canary/rollback) + recover predictably (playbooks), all read off the observability dashboard.
- Gate rollouts on eval + online quality — LLM changes are behavioral; 200 OK isn't success.
- Mitigate first (rollback/failover), diagnose second; keep a <5-min rollback and pin versions.
- Chaos-test fallbacks and run game days so MTTR is low when incidents are real.
- The runbook is living — every post-mortem adds the new LLM-specific failure mode (04/09/Phase 14).
15. Artifact Checklist
- An executed pre-launch checklist with evidence + accepted risks.
- A tested rollback (time-to-revert measured) with pinned prior version.
- An eval/online quality gate that blocks a bad canary.
- At least one incident playbook tied to dashboard panels.
- A blameless post-mortem template + a living-runbook update process.
Up: Phase 7 Index · Next: Phase 8 — LLM Gateways