Xiaomi Mimo Model Support#730
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates the MiMo LLM provider into the system. The changes include adding the MIMO_API_KEY to environment configurations, updating the LLM provider list and factory, and defining a model catalog for MiMo. Feedback suggests removing the 'xiaomi/' prefix from model identifiers to ensure compatibility with native API endpoints and ensuring consistency in model validation logic by excluding MiMo from the VALID_MODELS definition.
| "mimo": { | ||
| "quick": [ | ||
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "xiaomi/mimo-v2.5"), | ||
| ("MiMo-V2-Flash - Open-source 309B MoE, fast reasoning", "xiaomi/mimo-v2-flash"), | ||
| ("MiMo-V2-Omni - Multimodal (image/video/audio)", "xiaomi/mimo-v2-omni"), | ||
| ("Custom model ID", "custom"), | ||
| ], | ||
| "deep": [ | ||
| ("MiMo-V2.5-Pro - Flagship, 1T params, 1M context, best agent perf", "xiaomi/mimo-v2.5-pro"), | ||
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "xiaomi/mimo-v2.5"), | ||
| ("MiMo-V2-Pro - Previous flagship, 1T params, 1M context", "xiaomi/mimo-v2-pro"), | ||
| ("Custom model ID", "custom"), | ||
| ], | ||
| }, |
There was a problem hiding this comment.
The model identifiers for MiMo (e.g., xiaomi/mimo-v2.5) include a xiaomi/ prefix. While this format is common on aggregator platforms like OpenRouter, native provider endpoints (like the one configured in openai_client.py: https://token-plan-sgp.xiaomimimo.com/v1) typically expect the model name without the provider prefix. Based on the pattern used for other native providers in this catalog (such as Qwen and GLM), these should likely be updated to remove the prefix to ensure compatibility with the native API.
| "mimo": { | |
| "quick": [ | |
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "xiaomi/mimo-v2.5"), | |
| ("MiMo-V2-Flash - Open-source 309B MoE, fast reasoning", "xiaomi/mimo-v2-flash"), | |
| ("MiMo-V2-Omni - Multimodal (image/video/audio)", "xiaomi/mimo-v2-omni"), | |
| ("Custom model ID", "custom"), | |
| ], | |
| "deep": [ | |
| ("MiMo-V2.5-Pro - Flagship, 1T params, 1M context, best agent perf", "xiaomi/mimo-v2.5-pro"), | |
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "xiaomi/mimo-v2.5"), | |
| ("MiMo-V2-Pro - Previous flagship, 1T params, 1M context", "xiaomi/mimo-v2-pro"), | |
| ("Custom model ID", "custom"), | |
| ], | |
| }, | |
| "mimo": { | |
| "quick": [ | |
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "mimo-v2.5"), | |
| ("MiMo-V2-Flash - Open-source 309B MoE, fast reasoning", "mimo-v2-flash"), | |
| ("MiMo-V2-Omni - Multimodal (image/video/audio)", "mimo-v2-omni"), | |
| ("Custom model ID", "custom"), | |
| ], | |
| "deep": [ | |
| ("MiMo-V2.5-Pro - Flagship, 1T params, 1M context, best agent perf", "mimo-v2.5-pro"), | |
| ("MiMo-V2.5 - Native omnimodal, 1M context, cost-efficient", "mimo-v2.5"), | |
| ("MiMo-V2-Pro - Previous flagship, 1T params, 1M context", "mimo-v2-pro"), | |
| ("Custom model ID", "custom"), | |
| ], | |
| }, |
| provider_lower = provider.lower() | ||
|
|
||
| if provider_lower in ("ollama", "openrouter"): | ||
| if provider_lower in ("ollama", "openrouter", "mimo"): |
There was a problem hiding this comment.
Adding mimo to the bypass list here allows any model ID to pass validation. However, mimo was not added to the exclusion list in the VALID_MODELS dictionary comprehension (lines 6-10). This creates an inconsistency where VALID_MODELS contains data for mimo that is never used because of this early return. For consistency with ollama and openrouter, mimo should also be excluded from the VALID_MODELS definition.
Added inbuilt support for Xiaomi Mimo Models