Skip to main content
Every provider in infy implements the same ChatModel protocol, so you can swap one for another without touching the rest of your code. A model built from any provider drops into the same chains, agents, and graphs.

The ChatModel protocol

Each provider class exposes an identical surface: Because the surface is shared, providers are interchangeable. Write your chain, agent, or graph once, then point it at whichever model you want.

Available providers

Provider SDKs are optional extras. The infy core has no third-party runtime dependencies, so you install only the providers you use.

Installing a provider

Pick the extra that matches the provider you want.
Every provider needs Python 3.10 or later.

Provider notes

Install infy[openai], then construct OpenAIChat with a model name.
Supports chat, tool calling, and structured output.

Streaming

The same model instance streams synchronously or asynchronously.

Structured output

with_structured_output accepts either a JSON-schema dict (parsed by the Rust JsonParser, no validation) or a pydantic model (parsed and validated by pydantic-core). The return type follows what you pass in.
Validated structured output needs pydantic. Install it with pip install "infy[pydantic]".

Where to go next

Tools and agents

Build tool-calling agents with create_agent on any provider.

Governance

Policy-check every tool call and write a tamper-evident audit.