Skip to main content
AgentChat agents can work with any LLM provider through the model client abstraction. All model clients implement the ChatCompletionClient interface.

OpenAI

The most commonly used provider:

Available models

  • gpt-4o - Latest multimodal model
  • gpt-4o-mini - Faster, cheaper version
  • gpt-4-turbo - Previous generation
  • gpt-3.5-turbo - Legacy, cheaper

Azure OpenAI

For Azure deployments:
See Azure OpenAI documentation for more details.

Anthropic

For Claude models:

Available models

  • claude-3-5-sonnet-20241022 - Latest, most capable
  • claude-3-5-haiku-20241022 - Fast and efficient
  • claude-3-opus-20240229 - Most powerful (legacy)

Extended thinking

Claude supports extended thinking mode:

Ollama

For local models:
Ollama requires running Ollama server locally. Install from ollama.com.

Available models

  • llama3.2 - Meta’s Llama 3.2
  • codellama - Code-specialized
  • mistral - Mistral AI models
  • phi3 - Microsoft’s Phi-3
See Ollama library for all models.

Llama.cpp

For GGUF models:

Configuration options

All model clients support these common parameters:
str
required
The model identifier
float
default:"1.0"
Sampling temperature (0.0 to 2.0). Lower = more deterministic.
int
Maximum tokens to generate
float
default:"1.0"
Nucleus sampling parameter
str
API key (can also use environment variables)

Streaming

Enable streaming for real-time responses:

Token counting

Track token usage:

Model comparison

Environment variables

Set API keys via environment variables:
Then create clients without explicit keys:

Switching providers

Switch between providers by changing the model client:
The agent code stays the same - just swap the model client.

Best practices

Never hardcode API keys in source code. Use environment variables or secret managers.
Test with cheaper models (gpt-4o-mini, claude-3-5-haiku) before using expensive ones.
Track token usage to control costs. Use TokenUsageTermination in teams.
Use Ollama or Llama.cpp for rapid development without API costs.

Next steps

Model Clients Guide

Full model client documentation

Azure Integration

Azure-specific configuration

Quickstart

Build your first agent

Examples

See model clients in action