Skip to content
mentoor

Topic 2 of 5 · 5 min read

Runbooks and on-call for model-backed features

Goal: Write a runbook entry for a provider outage with checks, actions and an owner.

A runbook is a short, ordered list that lets a tired on-call engineer handle a known incident type without improvising: what to check, what to switch, who to call. For LLM features it must cover the actions that only exist here: fallback models, kill switches and frozen prompts.

Check yourself · 1 of 3

Which item belongs in every runbook action?

Choose one answer

Why it matters

At 3 a.m. nobody remembers which flag disables the tool, or whether the fallback model has been tested with this prompt. Writing it down in calm hours turns a judgment call into a checklist. PagerDuty's incident guide and Google's SRE workbook both stress clear roles and declaring an incident early rather than debugging alone for an hour.

What an entry contains

  1. Trigger. The alert or symptom that opens this entry, such as "model API 5xx above 5% for 5 minutes".
  2. Checks. Two or three fast questions with exact links: the provider status page, your own dashboard, a test call from the command line.
  3. Actions. Numbered, each one a single command, flag or console click. Include how to undo it.
  4. Containment tools. The kill switch for the feature, the flag that disables a tool, the setting that freezes prompt and model changes during the incident.
  5. Owner and escalation. A named role, not a person's name that goes stale, and when to escalate.
  6. Done when. The measurable signal that ends the incident.

Prepare the fallbacks

A fallback you have never run is a guess. Before the incident, test the second model against the same eval set, and check that its output format still parses. A cached answer or a plain "this feature is paused" screen is also a valid fallback.

Before and after

Weak entry: "If the AI is down, check the provider and try to fix it."

Fixed entry:

Runbook: model provider outage
Trigger: 5xx or timeouts above 5% for 5 min (alert: llm-api-errors)
Checks:
  1. Provider status page - is there a posted incident?
  2. Dashboard "LLM health" - one region or all?
  3. curl the health script with a 20-token prompt
Actions:
  1. Set flag llm.fallback=true (undo: false). Fallback: model-b, tested nightly
  2. If fallback also fails: set flag assistant.enabled=false -> shows "paused" notice
  3. Freeze prompt deploys: flag deploys.prompts=locked
Owner: on-call platform engineer; escalate to feature owner after 15 min
Done when: error rate under 1% for 30 min on the primary

What goes wrong

  • Runbooks nobody opens. Link each alert to its entry, and rehearse one in a game day.
  • Steps that need judgment. "Decide whether to fail over" is not a step. Give the threshold.
  • Stale fallbacks. The fallback model was retired or its output format changed.
  • No freeze. A prompt deploy during an incident hides which change caused what.

Examples

Kill switch entry

Trigger: harmful output report with a trace id
Action 1: flag assistant.enabled=false (users see a paused notice)
Action 2: save trace t-<id> and 1 hour of surrounding traces
Owner: feature owner; notify the security lead if personal data is involved

Every step is one flag or one save, with no discussion needed.

A fallback that failed the test

The fallback model was switched on during an outage, and the JSON parser failed on 30% of replies because it wrapped output in code fences. A nightly job that runs the eval set against the fallback would have caught this weeks earlier.

Key points

  • A runbook entry has a trigger, checks, numbered actions, an owner and a done-when signal.
  • Every action should say how to undo it, so a wrong switch is cheap to reverse.
  • Test the fallback model against your eval set before the incident, not during it.
  • Freeze prompt and model changes while an incident is open so causes stay separable.
  • Link each alert to its entry and rehearse it, or nobody will open it at night.

Common mistakes

  • Writing "investigate the issue" as a step instead of a concrete check or command.
  • Never testing the fallback model with the real prompt and output parser.
  • Naming a person as owner instead of a role, so the entry is wrong after a job change.
  • Letting prompt deploys continue while an incident is open.

Check yourself · 2 of 3

Why test the fallback model against your eval set before an outage?

Choose one answer

Check yourself · 3 of 3

During an open incident, a teammate wants to deploy a small prompt improvement. What does the runbook say?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic