Skip to main content
The LLM layer normalizes communication with language models across all supported providers. Your agent code uses provider-agnostic contracts (LLMRequest / LLMResponse) while built-in adapters handle the provider-specific details.

The LLMBuilder

Create LLM clients with the builder pattern:
1

Choose a provider

2

Set the model

3

Add policies (optional)

4

Build

Middleware

The LLM layer supports middleware for intercepting and transforming requests and responses. Use middleware for logging, tracing, caching, and custom request/response handling.

Built-in middleware

Custom middleware

Middleware protocols

Supported providers

OpenAI

GPT-4.1, GPT-4.1-mini, GPT-4.1-nano, o-series

Anthropic

Claude Opus and Sonnet families

LiteLLM

100+ providers via the LiteLLM proxy
All providers expose the same LLMClient interface. Your agent code never touches provider-specific types.

Example model choices

Use these as starting points, then verify model availability, pricing, and context limits with your provider account.

How agents use the LLM layer

You rarely build LLMClient directly. Agents resolve their model automatically:

Next steps

Contracts

LLMRequest / LLMResponse — what flows across the boundary.

Adapters

Built-in providers and custom adapter registration.