Supported Providers
OpenAI
GPT models, embeddings, and function calling with full streaming support.
Anthropic
Claude models with OpenAI-compatible API interface.
Quick Start
Provider Features
Feature | OpenAI | Anthropic |
---|---|---|
Text Generation | ✅ Full support | ✅ Full support |
Streaming | ✅ Real-time | ✅ Real-time |
Tool Calling | ✅ Native | ✅ Compatible |
Structured Output | ✅ Native | ✅ Compatible |
Embeddings | ✅ Full support | ❌ Not available |
Function Calling | ✅ Native | ✅ Compatible |
Authentication
Environment Variables
Set your API keys as environment variables:Explicit API Keys
Pass API keys directly to the provider functions:Common Parameters
All providers support these common parameters:Parameter | Type | Default | Description |
---|---|---|---|
model | str | - | Model identifier (required) |
api_key | str | None | API key (uses env var if not provided) |
temperature | float | 1.0 | Controls randomness (0.0 = deterministic) |
max_tokens | int | None | Maximum tokens to generate |
top_p | float | 1.0 | Nucleus sampling parameter |
frequency_penalty | float | 0.0 | Reduces repetition |
presence_penalty | float | 0.0 | Encourages new topics |
Provider-Specific Features
OpenAI
- Native structured output with
response_format="json_object"
- Function calling with full tool support
- Embedding models with automatic batching
- Vision models with multimodal support
Anthropic
- OpenAI-compatible API using compatibility layer
- Function calling via OpenAI SDK
- Streaming support with real-time deltas
- System prompts and message-based conversations
Bring Your Own Provider
Implement theLanguageModel
or EmbeddingModel
interface – only a handful of methods are required:
generate_text
and you instantly get the full SDK experience (tool-calling, streaming, …) without writing another line of glue code.
We maintain zero coupling between helpers and providers, so community packages can live in
separate repos.
Error Handling
All providers handle common errors gracefully:- Invalid API key - Check your credentials
- Rate limiting - Implement exponential backoff
- Model not found - Verify model name
- Token limit exceeded - Reduce input length