feature: add domainMapping in config, to allow for localModels#5
Conversation
|
fixes #4 🗺️ Add Configuration-Based Domain Mappings Feature Error: API Error: 400 provider not found: no provider implementation for domain: localhost Root Cause: The registry only supported predefined domains (api.openai.com, openrouter.ai, etc.) Solution Implemented
Supports YAML configuration format: # Route local LM Studio to use OpenAI transformations
domain_mappings:
localhost: openai
providers:
- name: local-lmstudio
url: "http://localhost:1234/v1/chat/completions"
api_key: "not-needed"
router:
default: "local-lmstudio,qwen/qwen3-coder-30b"
Added SetDomainMappings() method to accept config-based mappings Modified GetByDomain() to check config mappings first, then fall back to hardcoded mappings Priority System: Configuration mappings override hardcoded ones
Automatic configuration loading and application on startup
Now displays Domain Mappings section Shows configured domain → provider mappings cco config validate: Validates that mapped providers exist (both configured and built-in) Provides detailed error messages for invalid mappings cco config generate: Includes domain mappings in example configuration Provides local model setup examples
Registry integration tests for domain mapping functionality Configuration command tests Fixed test expectations to account for new local-lmstudio provider # Route local LM Studio to use OpenAI transformations
domain_mappings:
localhost: openai
providers:
- name: local-lmstudio
url: "http://localhost:1234/v1/chat/completions"
api_key: "not-needed"
router:
default: "local-lmstudio,qwen/qwen3-coder-30b"
|
|
Thanks for the contributions! |
No description provided.