From 142c756a9de1b63c55e7372f538a454b090b4d00 Mon Sep 17 00:00:00 2001 From: octo-patch Date: Tue, 2 Jun 2026 01:10:01 +0800 Subject: [PATCH] feat: upgrade MiniMax model references to M3 Update the MiniMax example agent and related fallback samples to use the new MiniMax-M3 model as the default, while keeping M2.7 (including M2.7-highspeed) as supported options for backward compatibility. - examples/beginner/minimax_example.py: switch default id to MiniMax-M3 - tests/unit/test_minimax_example.py: assert M3 usage and refresh the known-models set - gateway/.env.example, gateway/src/config/loader.ts: update OpenRouter fallback example to minimax/minimax-m3 - gateway/tests/provider/openrouter-body-injection.test.ts: refresh test fixture to use the new model id --- examples/beginner/minimax_example.py | 8 ++++---- gateway/.env.example | 2 +- gateway/src/config/loader.ts | 2 +- .../provider/openrouter-body-injection.test.ts | 4 ++-- tests/unit/test_minimax_example.py | 17 ++++++++--------- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/examples/beginner/minimax_example.py b/examples/beginner/minimax_example.py index fec7c8289..e0a47288b 100644 --- a/examples/beginner/minimax_example.py +++ b/examples/beginner/minimax_example.py @@ -1,10 +1,10 @@ """MiniMax AI Research Agent -A Bindu agent powered by MiniMax's M2.7 model via OpenAI-compatible API. +A Bindu agent powered by MiniMax's M3 model via OpenAI-compatible API. MiniMax offers high-performance models with up to 1M context window. Features: -- MiniMax M2.7 model (1M context) +- MiniMax M3 model (1M context) - Web search integration via DuckDuckGo - Research and summarization capabilities @@ -30,11 +30,11 @@ MINIMAX_API_KEY = os.getenv("MINIMAX_API_KEY") MINIMAX_BASE_URL = "https://api.minimax.io/v1" -# Define your agent with MiniMax M2.7 +# Define your agent with MiniMax M3 agent = Agent( instructions="You are a research assistant that finds and summarizes information.", model=OpenAILike( - id="MiniMax-M2.7", + id="MiniMax-M3", api_key=MINIMAX_API_KEY, base_url=MINIMAX_BASE_URL, ), diff --git a/gateway/.env.example b/gateway/.env.example index 66f750a60..b5cebdaad 100644 --- a/gateway/.env.example +++ b/gateway/.env.example @@ -35,7 +35,7 @@ OPENROUTER_API_KEY=sk-or-v1-... # OpenRouter tries each fallback in order. No per-call retry code # needed — OpenRouter handles it transparently. # -# OPENROUTER_FALLBACK_MODELS=minimax/minimax-m2.7,openai/gpt-4o-mini +# OPENROUTER_FALLBACK_MODELS=minimax/minimax-m3,openai/gpt-4o-mini # Server GATEWAY_PORT=3774 diff --git a/gateway/src/config/loader.ts b/gateway/src/config/loader.ts index 4a14379b5..b57ea8bf0 100644 --- a/gateway/src/config/loader.ts +++ b/gateway/src/config/loader.ts @@ -126,7 +126,7 @@ function envOverrides(base: Record): Record { // Optional: comma-separated fallback model IDs. When primary fails // (rate limit, upstream error), OpenRouter tries each in order. - // Example: OPENROUTER_FALLBACK_MODELS="minimax/minimax-m2.7,openai/gpt-4o-mini" + // Example: OPENROUTER_FALLBACK_MODELS="minimax/minimax-m3,openai/gpt-4o-mini" if (process.env.OPENROUTER_FALLBACK_MODELS) { const fallbacks = process.env.OPENROUTER_FALLBACK_MODELS.split(",") .map((s) => s.trim()) diff --git a/gateway/tests/provider/openrouter-body-injection.test.ts b/gateway/tests/provider/openrouter-body-injection.test.ts index 9cc774b44..2094585ec 100644 --- a/gateway/tests/provider/openrouter-body-injection.test.ts +++ b/gateway/tests/provider/openrouter-body-injection.test.ts @@ -72,11 +72,11 @@ describe("injectFallbackModels — OpenRouter fail-over routing", () => { messages: [], }) const out = JSON.parse( - injectFallbackModels(body, ["minimax/minimax-m2.7", "openai/gpt-4o-mini"]), + injectFallbackModels(body, ["minimax/minimax-m3", "openai/gpt-4o-mini"]), ) expect(out.models).toEqual([ "anthropic/claude-sonnet-4.6", - "minimax/minimax-m2.7", + "minimax/minimax-m3", "openai/gpt-4o-mini", ]) expect(out.route).toBe("fallback") diff --git a/tests/unit/test_minimax_example.py b/tests/unit/test_minimax_example.py index 73f3e9bdf..741f135c6 100644 --- a/tests/unit/test_minimax_example.py +++ b/tests/unit/test_minimax_example.py @@ -55,10 +55,10 @@ def test_example_has_minimax_base_url(self): source = EXAMPLE_PATH.read_text() assert "https://api.minimax.io/v1" in source - def test_example_uses_minimax_m27(self): - """Verify the example uses MiniMax-M2.7 model.""" + def test_example_uses_minimax_m3(self): + """Verify the example uses MiniMax-M3 model.""" source = EXAMPLE_PATH.read_text() - assert "MiniMax-M2.7" in source + assert "MiniMax-M3" in source def test_example_reads_api_key_from_env(self): """Verify the example reads MINIMAX_API_KEY from env.""" @@ -125,16 +125,15 @@ class TestMiniMaxModelConstants: def test_valid_minimax_models(self): """Verify known MiniMax model identifiers.""" valid_models = { + "MiniMax-M3", "MiniMax-M2.7", "MiniMax-M2.7-highspeed", - "MiniMax-M2.5", - "MiniMax-M2.5-highspeed", } # Parse the example to check the model used source = EXAMPLE_PATH.read_text() for model in valid_models: - # At least M2.7 should be referenced - if model == "MiniMax-M2.7": + # At least M3 should be referenced + if model == "MiniMax-M3": assert model in source def test_minimax_api_url_format(self): @@ -200,7 +199,7 @@ def test_minimax_api_connection(self, api_key): "Content-Type": "application/json", }, json={ - "model": "MiniMax-M2.7", + "model": "MiniMax-M3", "messages": [{"role": "user", "content": "Hi"}], "max_tokens": 5, }, @@ -219,7 +218,7 @@ def test_minimax_chat_completion(self, api_key): "Content-Type": "application/json", }, json={ - "model": "MiniMax-M2.7", + "model": "MiniMax-M3", "messages": [{"role": "user", "content": "Say hello in one word."}], "max_tokens": 10, },