OpenAI and Anthropic support
Added
-
OpenAI Provider: Native support for OpenAI API via new
OpenAIProviderclass- Direct integration with OpenAI's chat completion API
- Support for all OpenAI chat models (GPT-5, GPT-4, GPT-3.5, etc.)
- Automatic cost tracking using OpenAI's pricing model
- Dynamic model catalog fetching from OpenAI API
- Rate limiting protection
- Configuration via
OPENAI_API_KEYenvironment variable
-
Anthropic Provider: Native support for Anthropic Claude models via new
AnthropicProviderclass- Uses Anthropic's OpenAI-compatible API endpoint
- Support for all Claude models (Claude 4.5 Sonnet, Claude 4.5 Haiku, etc.)
- Hardcoded model catalog with pricing information for cost tracking
- Rate limiting protection
- Configuration via
ANTHROPIC_API_KEYenvironment variable
-
New Model Packages: Organized model-specific logic into dedicated packages
dialectus.engine.models.anthropic: Anthropic model definitions and pricingdialectus.engine.models.openai: OpenAI model definitions and pricing- Enhanced model info classes for provider-specific metadata
Changed
-
Extracted common OpenAI SDK logic into base provider class
- New
OpenAICompatibleProviderBaseabstract base class centralizes:- Chat completion generation (sync and streaming)
- Metadata extraction (tokens, cost, timing)
- Rate limiting and backoff logic
- Error handling and retry mechanisms
- Eliminates code duplication across OpenAI-compatible providers
- All providers using OpenAI SDK now extend this base class:
OpenRouterProviderrefactored to use base classOpenAIProviderimplemented using base classAnthropicProviderimplemented using base classOllamaProviderupdated to align with new architecture
- New
-
Provider Architecture: Improved separation of concerns
- Providers can override specific methods while inheriting common behavior
- Cleaner abstraction for provider-specific API differences
- Better support for future OpenAI-compatible providers
-
Configuration: Extended system configuration for new providers
- Added
openaiconfiguration section inSystemConfig - Added
anthropicconfiguration section inSystemConfig - Updated example config to demonstrate all provider options
- Added
-
Logging: Improved cost reporting
- Cost messages now logged at
INFOlevel instead ofWARNING - Better visibility into token usage and costs during debates
- Cost messages now logged at
Migration Notes
For users upgrading from 0.3.1:
- OpenRouter users: No changes required - existing configurations continue to work
- New OpenAI support: To use OpenAI directly, set
OPENAI_API_KEYand configure provider as"openai" - New Anthropic support: To use Claude models, set
ANTHROPIC_API_KEYand configure provider as"anthropic" - Configuration: Update your config files to take advantage of new provider options (see
debate_config.example.json)