AIEP

50 patterns · 292 passing tests · MIT

Production LLM patterns
you can run.

Caching, routing, guardrails, evals and agent loops. Each pattern explains when not to use it and how it fails, and ships with a tested reference implementation you can run in under a minute.

examples/
$ pip install pytest
$ pytest reliability/test_circuit_breaker.py -v
PASSED test_trips_once_failure_rate_crosses_threshold
PASSED test_a_short_burst_below_min_calls_does_not_trip
PASSED test_open_circuit_skips_the_primary_entirely
PASSED test_half_open_probes_close_the_circuit_after_cooldown
PASSED test_slow_answers_are_returned_but_count_as_failures
…
7 passed in 0.02s · no API key needed

Tested, not just described

Every pattern has a small, dependency-free Python implementation with tests that run offline in CI. The code on the page is copied from those files, so it can’t drift.

When NOT to use it

Each page says where the pattern is the wrong tool. That section saves more engineering time than the rest of the page.

How it fails

Failure modes that show up even when the pattern is built correctly, and the test that checks for each one.

Start from your problem

Nobody needs all 50. Pick the symptom you have today.

Full decision guide →

Browse by pillar

Run one of these in production?

Send a field report, fix a failure mode we missed, or add a pattern. The bar is a page plus a runnable example with tests.

How to contribute