Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions crates/forge_domain/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl ProviderId {
pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita"));
pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio"));
pub const MODAL: ProviderId = ProviderId(Cow::Borrowed("modal"));
pub const XIAOMI_MIMO: ProviderId = ProviderId(Cow::Borrowed("xiaomi_mimo"));

/// Returns all built-in provider IDs
///
Expand Down Expand Up @@ -110,6 +111,7 @@ impl ProviderId {
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
ProviderId::MODAL,
ProviderId::XIAOMI_MIMO,
]
}

Expand Down Expand Up @@ -139,6 +141,7 @@ impl ProviderId {
"novita" => "Novita".to_string(),
"google_ai_studio" => "GoogleAIStudio".to_string(),
"modal" => "Modal".to_string(),
"xiaomi_mimo" => "XiaomiMimo".to_string(),
_ => {
// For other providers, use UpperCamelCase conversion
use convert_case::{Case, Casing};
Expand Down Expand Up @@ -186,6 +189,7 @@ impl std::str::FromStr for ProviderId {
"novita" => ProviderId::NOVITA,
"google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO,
"modal" => ProviderId::MODAL,
"xiaomi_mimo" => ProviderId::XIAOMI_MIMO,
// For custom providers, use Cow::Owned to avoid memory leaks
custom => ProviderId(Cow::Owned(custom.to_string())),
};
Expand Down Expand Up @@ -618,6 +622,24 @@ mod tests {
assert!(built_in.contains(&ProviderId::MODAL));
}

#[test]
fn test_xiaomi_mimo_from_str() {
let actual = ProviderId::from_str("xiaomi_mimo").unwrap();
let expected = ProviderId::XIAOMI_MIMO;
assert_eq!(actual, expected);
}

#[test]
fn test_xiaomi_mimo_display_name() {
assert_eq!(ProviderId::XIAOMI_MIMO.to_string(), "XiaomiMimo");
}

#[test]
fn test_xiaomi_mimo_in_built_in_providers() {
let built_in = ProviderId::built_in_providers();
assert!(built_in.contains(&ProviderId::XIAOMI_MIMO));
}

#[test]
fn test_io_intelligence() {
let fixture = "test_key";
Expand Down
41 changes: 41 additions & 0 deletions crates/forge_repo/src/provider/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3229,5 +3229,46 @@
}
],
"auth_methods": ["api_key"]
},
{
"id": "xiaomi_mimo",
"api_key_vars": "XIAOMI_MIMO_API_KEY",
"url_param_vars": [
{ "name": "CLUSTER", "options": ["token-plan-sgp.xiaomimimo.com", "token-plan-cn.xiaomimimo.com", "token-plan-ams.xiaomimimo.com"] }
],
Comment on lines +3236 to +3238
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url_param_vars includes CLUSTER, which makes CLUSTER mandatory when creating credentials from environment variables (see provider_repo reading all url_param_vars and erroring if any are missing). That conflicts with the template’s {{else}} token-plan-sgp... default and the PR description (“defaults to Singapore”). Consider making CLUSTER optional (e.g., remove it from url_param_vars and hardcode the default URL), or adjust credential/env handling so missing CLUSTER doesn’t block configuration while still allowing UI selection.

Suggested change
"url_param_vars": [
{ "name": "CLUSTER", "options": ["token-plan-sgp.xiaomimimo.com", "token-plan-cn.xiaomimimo.com", "token-plan-ams.xiaomimimo.com"] }
],
"url_param_vars": [],

Copilot uses AI. Check for mistakes.
"response_type": "OpenAI",
"url": "https://{{#if CLUSTER}}{{CLUSTER}}{{else}}token-plan-sgp.xiaomimimo.com{{/if}}/v1/chat/completions",
"models": [
{
"id": "mimo-v2-pro",
"name": "MiMo V2 Pro",
"description": "Xiaomi's flagship foundation model with 1T+ parameters and 1M context length",
"context_length": 1000000,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text"]
},
{
"id": "mimo-v2-omni",
"name": "MiMo V2 Omni",
"description": "Xiaomi's omni-modal model that natively processes image, video, and audio inputs",
"context_length": 262100,
"tools_supported": true,
"supports_parallel_tool_calls": true,
"supports_reasoning": true,
"input_modalities": ["text", "image"]
Comment on lines +3255 to +3260
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model mimo-v2-omni is declared with input_modalities of ["text", "image"], but its description claims it natively processes "image, video, and audio". This is misleading for users and inconsistent with the declared capabilities; either update the description to match the supported modalities or extend input_modalities if video/audio are actually supported by the rest of the stack.

Copilot uses AI. Check for mistakes.
},
{
"id": "mimo-v2-tts",
"name": "MiMo V2 TTS",
"description": "Xiaomi's text-to-speech model",
"context_length": 8192,
"tools_supported": false,
"supports_parallel_tool_calls": false,
"input_modalities": ["text"]
}
],
"auth_methods": ["api_key"]
}
]
Loading