Commit c4e297f
committed
feat(model-info): ✨ add provider priority system and enhanced model metadata
This commit significantly improves the model lookup and metadata capabilities of the ModelInfoService:
- Introduces a provider priority system that prefers native/authoritative providers (anthropic, openai, google) over proxy/aggregator providers (openrouter, azure, requesty) when multiple sources exist for the same model
- Adds provider alias mapping to support custom provider names (e.g., nvidia_nim -> nvidia, gemini_cli -> google) for direct model ID resolution
- Extends ModelMetadata with new ModelInfo dataclass containing family, description, knowledge_cutoff, release_date, open_weights, status, tokenizer, and huggingface_id fields
- Adds extended capabilities support: structured_output, temperature, attachments, and interleaved content
- Implements version pattern normalization to handle different version formats (e.g., claude-opus-4-5 matches claude-opus-4.5)
- Refactors data merger to use best-source selection instead of averaging multiple sources, preserving queried model identity while inheriting technical specs from best matching native provider
- Restructures API response format with clear separation between core OpenAI fields, extended fields, legacy compatibility fields, and debug metadata
- Adds parent model tracking in origin field for transparency when fuzzy matching occurs
- Exports ModelMetadata in __all__ for public API access
The provider priority system ensures that when looking up custom provider models (e.g., antigravity/claude-opus-4-5), the service intelligently inherits accurate pricing and capabilities from the native provider source (anthropic/claude-opus-4.5) while preserving the queried model's provider identity.1 parent ed4dd55 commit c4e297f
2 files changed
+709
-289
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | | - | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| 33 | + | |
24 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
25 | 39 | | |
0 commit comments