Skip to the content.

← All patterns

Some of these patterns echo general distributed systems wisdom: batching (as in Prompt Amortization), fallback (as in Escalate to the LLM), and the redundant dispatch of Zeeguu’s parallel translation providers (not catalogued here as a pattern of its own). What makes them distinctly relevant to LLM integration is the combination of forces that arise when an LLM’s properties meet the demands of a live system:

Relationship to LLM Gateways

Several of these patterns (Fail-Fast Provider Chain, Centralized Model Selection, and hot-path caching) are being commoditized into LLM-gateway infrastructure (LiteLLM, Portkey, Cloudflare AI Gateway). This does not invalidate them as patterns; it relocates their implementation from application code into shared infrastructure. A pattern documents a recurring solution whether it is hand-rolled or shipped by a gateway, and knowing the pattern is precisely what lets one judge whether a given gateway implements it well (e.g. most gateways do not provide Multiplexed Dispatch with alternative-caching). Connection pooling remained a pattern long after every ORM started shipping one.

The recurring shape across all of these is that the gateway supplies a mechanism while the pattern owns the intent, the domain join, and the decision the mechanism drives. This is sharpest in Per-User Consumption Budget, where the gateway can throttle and cap but only the application knows which resource to bound and what the user should get when the budget is exhausted.


← All patterns

💬 Open an issue about this section