Multi-Model Client for MoE Judge Panel (H.3.5.2).
Provides unified interface to multiple LLM providers for judge evaluations. Supports: Anthropic (Claude), OpenAI (GPT-4), DeepSeek, Alibaba (Qwen), Meta (Llama), Google (Gemini).
Features:
- Unified completion API across providers
- Automatic fallback to backup models
- Retry logic with exponential backoff
- Token usage tracking
- Response timing for provenance
Configuration Priority:
- Runtime parameters
- Environment variables
- config/judge-model-routing.json
File: multi_model_client.py
Classes
ModelProvider
Supported model providers.
ModelConfig
Configuration for a specific model.
CompletionRequest
Request for model completion.
CompletionResponse
Response from model completion.
FallbackConfig
Fallback strategy configuration.
BaseProviderClient
Abstract base class for provider clients.
AnthropicClient
Anthropic Claude API client.
OpenAIClient
OpenAI GPT API client.
DeepSeekClient
DeepSeek API client (OpenAI-compatible).
TogetherClient
Together AI client for Meta Llama models.
Functions
create_default_client()
Create a MultiModelClient with default configuration.
get_provider_for_model(model)
Get the provider name for a model.
check_api_keys()
Check which API keys are configured.
to_dict()
Convert to dictionary for serialization.
provider()
Return provider enum.
provider()
No description
provider()
No description
provider()
No description
provider()
No description
provider()
No description
provider()
No description
get_backup_model(persona_id)
Get backup model for a persona.
get_available_providers()
Get list of providers with configured API keys.
get_model_info(model)
Get information about a model.