Module 11A: Projects
Starter projects are guided step by step and suit freshers. Stretch projects are open-ended, add production concerns, and suit experienced readers.
One project: an optional stretch, the operations pack. It runs keylessly. The module's code is pure Python: traces go to JSONL files and metrics to an in-memory backend, and the operations scripts are standard-library files that read the documents you write. No provider keys, no GPU, no cloud account, no services started. The starter project that wires this module's tracing and metrics into a service is in Module 11C's projects.
The building blocks. The pack uses the artefacts and scripts that the day-2 lesson 11C.4 ships, beside your llm-service project (uv init llm-service --bare --python 3.13, as in lesson 03.1, Part 4):
- From 11C.4: the
ops/artefacts and theseverity.py,incident_metrics.py,oncall.pyandreadiness.pyscripts - From 11A.2: the metrics catalogue and the worked SLO document that the pack's
ops/slo.mdbuilds on
Do the pack after Module 11C (specifically 11C.4), when you know what the inventory, runbooks and checklist are protecting.
Stretch (optional): Operations pack#
Goal: Write the day-2 operating system for your llm_service (or docs_qa): runbooks for the incident classes LLM services actually see, the system inventory, retention and deletion schedules, vendor files, the SLO document, and a filled production-readiness checklist — all keyless, all runnable.
What you'll practise:
- What pages you and what doesn't; the incident lifecycle with contain-first ordering (lesson 11C.4, 1.2, 1.3)
- The severity classifier and incident-command roles (11C.4, 1.4)
- Writing runbooks for the nine incident classes: provider outage, rate-limit exhaustion, cost spike, quality regression, retrieval failure, prompt injection, PII leak, runaway agent, leaked key (11C.4, 1.5)
- Kill switches, feature flags and degraded modes — and testing them before you need them (11C.4, 1.6)
- Blameless postmortems with the LLM-specific contributing factors, and incident metrics (MTTR, repeat incidents) (11C.4, 1.7, 1.8)
- Governance: the
ai_inventory.yamlschema, change tiers, access control, audit logs, data classification, vendor files with DPAs/subprocessors/exit plans (11C.4, Part 2, 2.7) - The data lifecycle: retention per store, deletion across logs/traces/caches/index/backups/provider-side, residency and access reviews (11C.4, Part 3, 3.3)
- Cost and quality governance cadences, reliability practices (SLO reviews, game days, DR RPO/RTO), team roles, on-call rotation and the LLMOps maturity model (11C.4, Parts 4–6)
- The production-readiness checklist and launch review as a gate (11C.4, Part 7, 7.2)
Setup: Python 3.11+ stdlib only — severity.py, incident_metrics.py, oncall.py, readiness.py are self-contained scripts saved under scripts/ (or ops/scripts/). The artefacts live under ops/ beside your service, matching 11C.4's consolidated layout. Do this after the starter project so the inventory and SLO doc describe a real system.
Steps:
- Inventory first. Write
ops/ai_inventory.yamlwith one entry per AI artefact in your service: every prompt/template version, model alias and resolved snapshot, tool, retrieval index, eval suite and provider key — each with owner, purpose, data classes, provider, version, eval result and status (11C.4, 2.2). Anything you can't fill in is a governance gap; note it. - Write the runbooks. For each incident class your service can actually hit, fill the lesson's skeleton — trigger, severity, owner, the eight steps — using your dashboards, flags and kill switches by name (11C.4, 1.5). Start with the three most likely (provider outage, cost spike, quality regression) plus leaked-key; aim for five to nine total. Where you must write "check with the team", that's a runbook gap to fix.
- Wire the kill switches. For each feature, tool, tenant and model route, name the flag that disables it and the degraded path that serves instead (cached answer, smaller model, retrieval-only, honest queue) (11C.4, 1.6). Then test each switch once — an untested kill switch is a hypothesis.
- Data lifecycle. Write
ops/retention_schedule.yaml: for every store your system writes user data to — request logs, traces, feedback, eval datasets, vector index, caches, prompt registry, backups, provider-side storage — the retention period and the mechanism that enforces it (11C.4, 3.2). Write the deletion runbook covering all of them (3.3) — hashed user IDs still count. - Vendor files. For each provider/gateway/observability vendor, fill the file: contract/DPA status, certifications actually seen, subprocessors, data posture (training/retention/ZDR/regions), SLA, exit plan, review cadence (11C.4, 2.7). Answer the exit question honestly: can you leave your most critical vendor in 30 days?
- SLO and cost governance. Write
ops/slo.mdfrom your 11A.2 metrics: SLIs, targets, error-budget policy, page-vs-ticket routing. Add the cost section: budgets, per-tenant caps, unit economics review cadence, price-change monitoring (11C.4, 4.1, 4.2). - Run the scripts. Create
incidents.jsonl(real or plausible incidents), runpython3 scripts/severity.py incident.jsonon three crafted incidents (one SEV1, one SEV3, one borderline) andpython3 scripts/incident_metrics.py incidents.jsonl; runpython3 scripts/oncall.py --people ... --weeks 4for your team size and check the coverage output (11C.4, 1.4, 1.8, 6.2). - Tabletop and gate. Walk one scenario from the lesson's exercise library against your runbooks, timed, and record where you got stuck (11C.4, 5.2). Then fill
ops/readiness_checklist.jsonhonestly — gate items block, track items need owner+date — and runpython3 scripts/readiness.py ops/readiness_checklist.json(7.1). Hold the launch review using the 7.2 template and score your LLMOps maturity (6.4).
Verify it, and what you should see:
python3 scripts/severity.py incident.json # suggested severity + the human-confirm prompt
python3 scripts/incident_metrics.py incidents.jsonl # MTTR, MTBF, repeat-incident table
python3 scripts/oncall.py --people "ada,grace,linus" --weeks 4 # rotation + coverage check
python3 scripts/readiness.py ops/readiness_checklist.json # gate/track verdictExpected: each script prints real analysis of the files you wrote — a severity suggestion that may under-triage by design (the human confirm is the safeguard), incident stats with the class-level repeat view, a rotation with no gaps, and a checklist score that tells you honestly whether the service could launch.
Done when:
ai_inventory.yamlcovers every prompt, model alias, tool, index, eval suite and key — with owners and data classes filled.- At least five runbooks exist in the shared skeleton, each naming real dashboards/flags/kill switches, and one tabletop exercise is logged with its findings.
- Every kill switch has been triggered once deliberately, and the degraded path was observed serving.
retention_schedule.yamlcovers every store including backups and provider-side, and the deletion runbook reaches all of them.- Vendor files exist per provider with an honest exit plan; the SLO doc has SLIs, targets and a page/ticket split.
- The readiness checklist is filled with gate/track honesty —
naonly with reasons — and the maturity assessment names your level and the single highest-leverage next move.
Stretch ideas: Add the postmortem archive (ops/postmortems/) and write one for a real or imagined incident hunting the LLM contributing factors — silent quality failure, unpinned alias, console prompt edit, missing eval case (11C.4, 1.7). Design the DR plan with RPO/RTO per store — the vector-index rebuild is usually the RTO long pole (5.3). Write the complaint→eval-case loop: how a user report becomes an evalkit example (11C.4, 4.2).
Common problems:
- Runbooks that say "investigate" — a runbook with no named dashboard, flag or command is a wish list; the lesson's skeleton forces the specifics (11C.4, 1.5).
- Inventory drift — prompts edited in a provider console never touch git; the inventory must include console-side artefacts and the audit log must capture who changed what (11C.4, 2.3, 2.5).
- "The vendor handles retention" — retention promises are per-endpoint and per-feature; files, batch and abuse logs often differ (11C.4, 2.7).
- Checklist theatre — marking items done that aren't, or
nawithout reasons; the checklist exists so "ready" is a claim with evidence (11C.4, 7.1). - On-call coverage that isn't — a rotation that looks balanced on paper but has no tested escalation path; run
oncall.pyand actually call the escalation contact once (11C.4, 6.2).