Skip to main content
Every LLM interaction in AFK flows through two typed contracts: LLMRequest (what you send) and LLMResponse (what you get back). These contracts normalize the differences between providers so your agent code never touches provider-specific types.

The flow

The adapter translates between AFK’s normalized contracts and the provider’s native format.

LLMRequest

LLMResponse

Structured output

Request structured JSON output with a Pydantic model:

Message types

Next steps

Adapters

Built-in providers and custom adapters.

Control & Session

Retry, caching, rate limiting, and circuit breaking.