Model-Agnostic Pattern
Quick Answer
The model-agnostic pattern is an application-architecture pattern in which LLM pipeline code depends on an abstract capability — chat, embedding, tool call — rather than a specific vendor SDK. A gateway component resolves each capability request to a concrete backend at runtime, so swapping, adding, canarying, or failing over between hosted APIs and self-hosted models happens inside the gateway without changes to the pipeline code that consumes the capability.
Model-Agnostic Pattern
The model-agnostic pattern is an application-architecture pattern for LLM systems in which code requests an abstract capability — chat, embedding, tool call — instead of a specific vendor SDK. Its defining property is vendor isolation: swapping, adding, or failing over between backends becomes a change at one substitution point rather than across every call site, turning provider price changes, outages, and licensing shifts into configuration changes.
The pattern is a property of call sites, not a component in a diagram. A system is model-agnostic when every model call already passes through one interface — a networked LLM API gateway, a library router, or a thin in-process wrapper. The gateway is the implementation warranted when many services share backends; a single-process pipeline gets identical isolation from a much smaller abstraction.
It differs from multi-model routing, which optimizes cost or latency: model-agnosticism also asserts the pipeline does not know which vendor answered.
See also
- What building a model-agnostic research pipeline actually took — where the pattern held, and where it was oversized.
- Compound AI system — the broader class of multi-call, multi-tool systems within which the pattern is often applied.