From 6178b86e023331ef39cc007f3ffc6ab679ce805f Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Tue, 2 Jun 2026 10:33:38 +0700 Subject: [PATCH 1/5] feat: add MiniMax M3 model support - Extended transformer to match minimax-m3 pattern - Added M3 models (minimax-m3, minimax-m3-pro) to provider.json - Added top_k: 40 for M3 models (same as M2.1) - Added comprehensive tests for M3 variants Co-Authored-By: ForgeCode --- .../src/dto/openai/transformers/minimax.rs | 50 +++++++++++++++++-- crates/forge_repo/src/provider/provider.json | 20 ++++++++ 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/crates/forge_app/src/dto/openai/transformers/minimax.rs b/crates/forge_app/src/dto/openai/transformers/minimax.rs index cdfb6c90ac..ea174e2465 100644 --- a/crates/forge_app/src/dto/openai/transformers/minimax.rs +++ b/crates/forge_app/src/dto/openai/transformers/minimax.rs @@ -9,33 +9,42 @@ use crate::dto::openai::Request; /// - Temperature: 1.0 /// - Top P: 0.95 /// - Top K: 40 (for m2.1), 20 (for other m2 models) +/// +/// MiniMax M3 models use similar parameters: +/// - Temperature: 1.0 +/// - Top P: 0.95 +/// - Top K: 40 pub struct SetMinimaxParams; impl Transformer for SetMinimaxParams { type Value = Request; fn transform(&mut self, mut request: Self::Value) -> Self::Value { - // Check if model is a minimax-m2 model + // Check if model is a minimax-m2 or minimax-m3 model let model_id = request .model .as_ref() .map(|m| m.as_str().to_lowercase()) .unwrap_or_default(); - if !model_id.contains("minimax-m2") { + // Match minimax-m2 or minimax-m3 patterns + let is_minimax = model_id.contains("minimax-m2") || model_id.contains("minimax-m3"); + + if !is_minimax { return request; } - // Set temperature to 1.0 for minimax-m2 models + // Set temperature to 1.0 for minimax models request.temperature = Some(1.0); - // Set top_p to 0.95 for minimax-m2 models + // Set top_p to 0.95 for minimax models request.top_p = Some(0.95); // Set top_k based on model variant if model_id.contains("minimax-m2.1") { request.top_k = Some(40); } else { + // M2, M2.5, M2.7, M3 all use top_k = 20 request.top_k = Some(20); } @@ -145,4 +154,37 @@ mod tests { assert_eq!(actual.top_p, fixture.top_p); assert_eq!(actual.top_k, fixture.top_k); } + + #[test] + fn test_minimax_m3_sets_parameters() { + let fixture = create_request_fixture("minimax-m3"); + let mut transformer = SetMinimaxParams; + let actual = transformer.transform(fixture); + + assert_eq!(actual.temperature, Some(1.0)); + assert_eq!(actual.top_p, Some(0.95)); + assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 + } + + #[test] + fn test_minimax_m3_case_insensitive() { + let fixture = create_request_fixture("MiniMax-M3"); + let mut transformer = SetMinimaxParams; + let actual = transformer.transform(fixture); + + assert_eq!(actual.temperature, Some(1.0)); + assert_eq!(actual.top_p, Some(0.95)); + assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 + } + + #[test] + fn test_minimax_m3_pro() { + let fixture = create_request_fixture("minimax-m3-pro"); + let mut transformer = SetMinimaxParams; + let actual = transformer.transform(fixture); + + assert_eq!(actual.temperature, Some(1.0)); + assert_eq!(actual.top_p, Some(0.95)); + assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 + } } diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index d492d38696..f02b818b81 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -1453,6 +1453,26 @@ "supports_reasoning": true, "input_modalities": ["text"] }, + { + "id": "minimax.minimax-m3", + "name": "MiniMax M3", + "description": "MiniMax M3 flagship model with enhanced reasoning capabilities", + "context_length": 204800, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text"] + }, + { + "id": "minimax.minimax-m3-pro", + "name": "MiniMax M3 Pro", + "description": "MiniMax M3 Pro variant with enhanced capabilities", + "context_length": 204800, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text"] + }, { "id": "us.anthropic.claude-sonnet-4-20250514-v1:0", "name": "Claude Sonnet 4 (US)", From f277766cc4075b551ecb87a9cdd13f3075ea96c3 Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Tue, 2 Jun 2026 10:42:25 +0700 Subject: [PATCH 2/5] fix: remove minimax-m3-pro, M3 only has single variant Co-Authored-By: ForgeCode --- .../forge_app/src/dto/openai/transformers/minimax.rs | 11 ----------- crates/forge_repo/src/provider/provider.json | 10 ---------- 2 files changed, 21 deletions(-) diff --git a/crates/forge_app/src/dto/openai/transformers/minimax.rs b/crates/forge_app/src/dto/openai/transformers/minimax.rs index ea174e2465..c65f6dfd1b 100644 --- a/crates/forge_app/src/dto/openai/transformers/minimax.rs +++ b/crates/forge_app/src/dto/openai/transformers/minimax.rs @@ -176,15 +176,4 @@ mod tests { assert_eq!(actual.top_p, Some(0.95)); assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 } - - #[test] - fn test_minimax_m3_pro() { - let fixture = create_request_fixture("minimax-m3-pro"); - let mut transformer = SetMinimaxParams; - let actual = transformer.transform(fixture); - - assert_eq!(actual.temperature, Some(1.0)); - assert_eq!(actual.top_p, Some(0.95)); - assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 - } } diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index f02b818b81..9111c4e020 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -1463,16 +1463,6 @@ "supports_reasoning": true, "input_modalities": ["text"] }, - { - "id": "minimax.minimax-m3-pro", - "name": "MiniMax M3 Pro", - "description": "MiniMax M3 Pro variant with enhanced capabilities", - "context_length": 204800, - "tools_supported": true, - "supports_parallel_tool_calls": true, - "supports_reasoning": true, - "input_modalities": ["text"] - }, { "id": "us.anthropic.claude-sonnet-4-20250514-v1:0", "name": "Claude Sonnet 4 (US)", From fccb162a43be0d3f5dfc1372d4f13194ac0cc58c Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Tue, 2 Jun 2026 10:48:38 +0700 Subject: [PATCH 3/5] fix: update MiniMax M3 specs based on official blog - Context length: 1M (not 204K) - M3 uses MSA sparse attention - Input modalities: text + image (natively multimodal) - Description: frontier coding, 1M context, MSA, multimodality - Added M3 to minimax direct provider (MiniMax-M3) and Bedrock - Same transformer params as M2.7 (temp=1.0, top_p=0.95, top_k=20) - Added bedrock provider ID test Co-Authored-By: ForgeCode --- .../src/dto/openai/transformers/minimax.rs | 24 ++++++++++++------- crates/forge_repo/src/provider/provider.json | 20 ++++++++++++++++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/crates/forge_app/src/dto/openai/transformers/minimax.rs b/crates/forge_app/src/dto/openai/transformers/minimax.rs index c65f6dfd1b..fbe6cb9b08 100644 --- a/crates/forge_app/src/dto/openai/transformers/minimax.rs +++ b/crates/forge_app/src/dto/openai/transformers/minimax.rs @@ -4,30 +4,27 @@ use crate::dto::openai::Request; /// Transformer that applies minimax-specific parameter adjustments /// -/// Minimax M2 models require specific temperature, top_p, and top_k values +/// Minimax models require specific temperature, top_p, and top_k values /// for optimal performance: /// - Temperature: 1.0 /// - Top P: 0.95 -/// - Top K: 40 (for m2.1), 20 (for other m2 models) +/// - Top K: 40 (for m2.1), 20 (for all other models including M2, M2.5, M2.7, M3) /// -/// MiniMax M3 models use similar parameters: -/// - Temperature: 1.0 -/// - Top P: 0.95 -/// - Top K: 40 +/// These parameters are based on official MiniMax evaluation methodology +/// (see VideoMMMU, Video-MME benchmarks in M3 blog post). pub struct SetMinimaxParams; impl Transformer for SetMinimaxParams { type Value = Request; fn transform(&mut self, mut request: Self::Value) -> Self::Value { - // Check if model is a minimax-m2 or minimax-m3 model let model_id = request .model .as_ref() .map(|m| m.as_str().to_lowercase()) .unwrap_or_default(); - // Match minimax-m2 or minimax-m3 patterns + // Match MiniMax model patterns (minimax-m2, minimax-m3, etc.) let is_minimax = model_id.contains("minimax-m2") || model_id.contains("minimax-m3"); if !is_minimax { @@ -176,4 +173,15 @@ mod tests { assert_eq!(actual.top_p, Some(0.95)); assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 } + + #[test] + fn test_minimax_m3_bedrock_provider_id() { + let fixture = create_request_fixture("minimax.minimax-m3"); + let mut transformer = SetMinimaxParams; + let actual = transformer.transform(fixture); + + assert_eq!(actual.temperature, Some(1.0)); + assert_eq!(actual.top_p, Some(0.95)); + assert_eq!(actual.top_k, Some(20)); // M3 uses same config as M2.7 + } } diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index 9111c4e020..529e81951b 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -1443,6 +1443,16 @@ "supports_reasoning": true, "input_modalities": ["text"] }, + { + "id": "minimax.minimax-m3", + "name": "MiniMax M3", + "description": "Frontier coding model with 1M context, MSA sparse attention, native multimodality, and agentic capabilities", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "minimax.minimax-m2.1", "name": "MiniMax M2.1", @@ -2516,6 +2526,16 @@ "response_type": "Anthropic", "url": "https://{{#if HOSTNAME}}{{HOSTNAME}}{{else}}api.minimax.io{{/if}}/anthropic/v1/messages", "models": [ + { + "id": "MiniMax-M3", + "name": "MiniMax M3", + "description": "Frontier coding model with 1M context, MSA sparse attention, native multimodality (image/video), and agentic capabilities", + "context_length": 1000000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text", "image"] + }, { "id": "MiniMax-M2.7", "name": "MiniMax M2.7", From 8c7641620370a279a0bf49aa14172825fdce6960 Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Tue, 2 Jun 2026 10:50:51 +0700 Subject: [PATCH 4/5] fix: remove duplicate minimax-m3 entry in bedrock provider The bedrock provider already had minimax-m3 entry at line 1447. Removed the duplicate with incorrect specs (context=204800 instead of 1M, modalities=text instead of text+image). Co-Authored-By: ForgeCode --- crates/forge_repo/src/provider/provider.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index 529e81951b..04c42ecc0a 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -1463,16 +1463,7 @@ "supports_reasoning": true, "input_modalities": ["text"] }, - { - "id": "minimax.minimax-m3", - "name": "MiniMax M3", - "description": "MiniMax M3 flagship model with enhanced reasoning capabilities", - "context_length": 204800, - "tools_supported": true, - "supports_parallel_tool_calls": true, - "supports_reasoning": true, - "input_modalities": ["text"] - }, + { "id": "us.anthropic.claude-sonnet-4-20250514-v1:0", "name": "Claude Sonnet 4 (US)", From 73d622dddfe1504721710b69cb1b6efe9b23e658 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 03:56:12 +0000 Subject: [PATCH 5/5] [autofix.ci] apply automated fixes --- crates/forge_app/src/dto/openai/transformers/minimax.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/forge_app/src/dto/openai/transformers/minimax.rs b/crates/forge_app/src/dto/openai/transformers/minimax.rs index fbe6cb9b08..ca55d1d57f 100644 --- a/crates/forge_app/src/dto/openai/transformers/minimax.rs +++ b/crates/forge_app/src/dto/openai/transformers/minimax.rs @@ -8,7 +8,8 @@ use crate::dto::openai::Request; /// for optimal performance: /// - Temperature: 1.0 /// - Top P: 0.95 -/// - Top K: 40 (for m2.1), 20 (for all other models including M2, M2.5, M2.7, M3) +/// - Top K: 40 (for m2.1), 20 (for all other models including M2, M2.5, M2.7, +/// M3) /// /// These parameters are based on official MiniMax evaluation methodology /// (see VideoMMMU, Video-MME benchmarks in M3 blog post).