Skip to content
Merged
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
8 changes: 4 additions & 4 deletions examples/beginner/minimax_example.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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,
),
Expand Down
2 changes: 1 addition & 1 deletion gateway/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/config/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function envOverrides(base: Record<string, any>): Record<string, any> {

// 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())
Expand Down
4 changes: 2 additions & 2 deletions gateway/tests/provider/openrouter-body-injection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
17 changes: 8 additions & 9 deletions tests/unit/test_minimax_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down
Loading