v2.20.0: OpenAI-compatible provider profiles
What's New
OpenAI-compatible provider profiles
New config-driven system for adding OpenAI-compatible providers without writing Python classes. Adding a new provider is now a 6-line config change:
# Built-in profiles work transparently
model = AIFactory.create_language("dashscope", "qwen-plus")
model = AIFactory.create_language("minimax", "MiniMax-M2.5")
# Register your own OpenAI-compatible endpoints
from esperanto import AIFactory, OpenAICompatibleProfile
AIFactory.register_openai_compatible_profile(
OpenAICompatibleProfile(
name="together",
base_url="https://api.together.xyz/v1",
api_key_env="TOGETHER_API_KEY",
default_model="meta-llama/Llama-3-70b-chat-hf",
)
)
model = AIFactory.create_language("together", "meta-llama/Llama-3-70b-chat-hf")New providers
- DashScope (Qwen) — Alibaba Cloud's Qwen models (
qwen-turbo,qwen-plus,qwen-max) - MiniMax — MiniMax models with 204K context (
MiniMax-M2.5,MiniMax-M2.5-highspeed)
Bug fix
- OpenAI-compatible tool calls — Fixed
OpenAICompatibleLanguageModel._normalize_responsesilently droppingtool_callsfrom API responses
Deprecated
DeepSeekLanguageModelandXAILanguageModeldirect instantiation — useAIFactory.create_language("deepseek", ...)/AIFactory.create_language("xai", ...)instead. Existing code still works but will emit aDeprecationWarning.
Documentation
- Added
ARCHITECTURE.mdwith design principles, provider tiers, and decision criteria - Rewrote
CONTRIBUTING.mdwith provider acceptance criteria and profile addition guide
See CHANGELOG.md for full details.