v0.3.6 is out — configurable branding and reusable composition APIs. Read the notes
projectious·work
Back to examples Theme example
Architecture

Provider independence in an agentic stack

Keep AI vendor choices reversible without slowing delivery.

Teams often treat their model provider as a foundation decision. The provider is actually the layer most likely to change through pricing, capability and policy.

The switching cost is architectural

A contract can be changed quickly. A codebase that assumes one vendor’s request and response shape in forty places cannot. Route every call through one internal interface.

interface ModelClient {
  complete(request: CompletionRequest): Promise<Result>
}
The interface—not the model—is the unit worth testing.

What this costs you

An adapter layer adds a little deliberate work. It also gives evaluation, observability and policy enforcement one stable boundary.

Where to draw the line

Abstract capabilities your product actually uses. Do not attempt to normalize every provider feature before it creates value.