Chaos Engineering for LLM Production
Chaos engineering for LLM services only works once you have SLIs and SLOs, observability, automated rollback, runbooks, and someone on call. With those in place, four planes (control, target, safety, observability) plus a feedback loop into your SLOs keep experiments contained. The safety plane pauses an experiment when daily error-budget burn passes 2x expected. LLM stacks add their own experiments: memory overload, network failures, provider outages, malformed prompts, and KV cache eviction storms. Run a small canary weekly, a game day monthly, and a cross-team audit quarterly.
Learning Objectives
- Name the five chaos engineering prerequisites (SLI/SLO, observability, rollback, runbooks, on-call) and explain why skipping any breaks the practice.
- Diagram the four planes (control, target, safety, observability) and the feedback loop into SLO.
- Enumerate five LLM-specific experiments (memory overload, network fail, provider outage, malformed prompt, KV eviction storm).
- Pick a tool (Harness, LitmusChaos, or Chaos Mesh) given your stack.
The Problem
Chaos testing in traditional stacks is well established. LLM stacks add failure modes that older playbooks never covered. A 4K-token prompt with a poison character stalls the tokenizer for 12 seconds. An upstream provider returns 429s, your gateway retries, and the retries amplify concurrency until the service runs out of memory. A burst of load causes a KV cache eviction storm, and the re-prefill cascade that follows saturates compute.
Unit tests catch none of these. Chaos engineering is how you find them before your users do.
The Concept
Prerequisites
Don't run chaos in production without these five things:
- SLI/SLO. Defined service-level indicators and objectives. Without them you can't say whether an experiment hurt.
- Observability. Traces, metrics, and logs, wired to dashboards.
- Automated rollback. The policy-flag rollback from Phase 17 · 20.
- Runbooks. Structured ones, as in Phase 17 · 23.
- On-call. Someone has to respond.
Miss any one and the chaos becomes a real incident.
Four planes plus a feedback loop
Control plane. The experiment scheduler: a Litmus workflow, a Chaos Mesh schedule, or the Harness UI.
Target plane. The things you break: services, pods, nodes, load balancers, data stores.
Safety plane. Kill switch, suppression windows, blast-radius limits, and error-budget gates.
Observability plane. Your normal metrics, plus trace-ID correlation so you can tell chaos-induced failures from natural ones.
Feedback loop. Findings flow back into SLO adjustments, runbook updates, and code fixes.
Guardrails are mandatory
- Burn-rate alert: pause the experiment if daily error-budget burn exceeds 2x expected.
- Suppression windows: silence non-experiment alerts inside the blast radius while the experiment runs.
- Trace-ID correlation: tag every experiment-induced error so on-call can dedupe.
Five LLM-specific experiments
-
Memory overload. Force a KV cache preemption storm with long-context requests at high concurrency. Observe whether the service sheds load gracefully or crashes.
-
Network failure. Cut connectivity between the inference gateway and the provider. Observe whether fallback kicks in within SLA (Phase 17 · 19).
-
Provider outage simulation. Return 429 on 100% of OpenAI calls. Observe whether routing fails over to Anthropic (Phase 17 · 16, 19).
-
Malformed prompt. Inject a tokenizer-stalling payload, such as deeply nested unicode or a huge UTF-8 codepoint. Observe whether a single request can lock up a worker.
-
KV eviction storm. Saturate the vLLM block budget to force eviction. Observe whether LMCache recovers or the service degrades.
Cadence
- Weekly: small canary experiments in staging, maybe 5% of prod.
- Monthly: a scheduled game day on one specific scenario, with cross-team attendance and a postmortem.
- Quarterly: a cross-team resilience audit and a dependency map update.
Tooling
- Harness Chaos Engineering is commercial. It offers AI-derived experiment recommendations, blast-radius downscaling, and MCP tool integration.
- LitmusChaos is CNCF graduated and Kubernetes workflow-based.
- Chaos Mesh is CNCF sandbox and Kubernetes-native, with a CRD style.
- Gremlin is commercial with broad support.
- AWS FIS and Azure Chaos Studio are the managed cloud offerings.
Starting small
Your first experiment: kill one decode replica under steady traffic and watch the rerouting and recovery. If that works and looks safe, graduate to network chaos.
Your first LLM-specific experiment: inject a provider 429 for 5 minutes and watch the fallback. Most teams find their fallback wasn't fully tested.
Numbers you should remember
- Four planes: control, target, safety, observability.
- Burn-rate pause: 2x expected daily budget burn.
- Cadence: weekly canary, monthly game day, quarterly audit.
- Five LLM experiments: memory, network, provider, malformed prompt, KV storm.
Use It
code/main.py simulates three chaos experiments behind safety plane gates and reports which ones would trip the burn-rate abort.
Ship It
This lesson produces outputs/skill-chaos-plan.md. Given your stack and maturity, it picks the first three experiments and the tooling.
I'd run main.py first and read the table before the prose. It runs three experiments (pod kill, provider 429 fallback, malformed prompt tokenizer stall) and only one of them aborts. The malformed prompt run has the highest burn rate in the table and still completes.
The reason is the gate. In the code it is a conjunction: burn rate above 2.0x expected and blast radius above 20%. The provider 429 experiment trips both, with a 30% blast radius. The tokenizer stall burns hot but touches 10% of traffic, so it runs to the end. The 2x rule from the guardrails list is only half of what the toy enforces, and I think the blast-radius half is the one worth copying. A hot experiment on a small slice is how you learn something cheaply.
I'd also keep the toy in proportion. The burn rate is a ratio of a hard-coded induced error rate to a hard-coded baseline, and the duration never enters the gate. Nothing here talks to a real service. It shows how the safety plane decides, not how to measure the inputs. For that you need the observability and SLO work from the prerequisites, and I'd do it before trying any of the five experiments against production.
Exercises
- Run
code/main.py. Which experiment trips the burn-rate gate, and why? - Design the first five chaos experiments for a vLLM-based RAG service. Include success criteria.
- Your burn-rate alert paused an experiment. How do you determine the root cause, chaos or natural?
- Argue whether chaos should run in production or only in staging. When is production the right answer?
- Name three LLM-specific failure modes that generic network chaos cannot reproduce.
Key Terms
| Term | What people say | What it actually means |
|---|---|---|
| SLI / SLO | "service targets" | Indicator + objective; required prerequisite |
| Blast radius | "scope" | Set of services / users affected by experiment |
| Burn-rate alert | "budget gate" | Fires when error-budget burn rate > 2x expected |
| Game day | "monthly drill" | Scheduled cross-team chaos exercise |
| LitmusChaos | "CNCF workflow" | Graduated CNCF Kubernetes chaos tool |
| Chaos Mesh | "CNCF CRD" | CNCF sandbox Kubernetes-native chaos |
| Harness CE | "commercial AI-assisted" | Harness chaos with AI recommendations |
| Malformed prompt | "tokenizer bomb" | Input that stalls tokenization |
| KV eviction storm | "preemption cascade" | Mass eviction triggering re-prefills |
Code
- main.py (python, 70 lines)