feat(sdk): upgrade MiniMax default model list to M3#4519
Conversation
Replace deprecated MiniMax-M2.5/M2.1/M2 (and their lightning variants) with MiniMax-M3, the latest flagship model from MiniMax with 512K context window and 128K max output. Signed-off-by: octo-patch <noreply@octo-patch.dev>
|
Someone is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
octo-patch seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR updates the supported model list for the MiniMax provider in the assets configuration file. The change replaces previously supported MiniMax model variants with the new ChangesMiniMax Model Registry Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| "minimax": [ | ||
| "minimax/MiniMax-M2.5", | ||
| "minimax/MiniMax-M2.5-lightning", | ||
| "minimax/MiniMax-M2.1", | ||
| "minimax/MiniMax-M2.1-lightning", | ||
| "minimax/MiniMax-M2", | ||
| "minimax/MiniMax-M3", | ||
| ], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if MiniMax-M3 is already registered in the installed litellm version
python3 << 'PYEOF'
try:
from litellm import model_cost as LITELLM_MODEL_COST
model = "minimax/MiniMax-M3"
print(f"Checking litellm registration for: {model}")
# Direct lookup
if model in LITELLM_MODEL_COST:
print(f"✓ Found in litellm.model_cost: {LITELLM_MODEL_COST[model]}")
else:
print(f"✗ NOT found in litellm.model_cost (direct lookup)")
# Fallback: check without prefix
if "/" in model:
without_prefix = model.split("/", 1)[1]
if without_prefix in LITELLM_MODEL_COST:
print(f"✓ Found without prefix: {without_prefix} -> {LITELLM_MODEL_COST[without_prefix]}")
else:
print(f"✗ NOT found in litellm.model_cost (without prefix: {without_prefix})")
# List all minimax entries
print("\nAll 'minimax' entries in litellm.model_cost:")
minimax_entries = {k: v for k, v in LITELLM_MODEL_COST.items() if 'minimax' in k.lower()}
if minimax_entries:
for k in sorted(minimax_entries.keys()):
print(f" - {k}")
else:
print(" (none found)")
except ImportError:
print("✗ litellm not available")
PYEOFRepository: Agenta-AI/agenta
Length of output: 84
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant portion of assets.py around the referenced lines
sed -n '150,230p' sdks/python/agenta/sdk/utils/assets.py | nl -ba
# Find and show the referenced test file (and relevant assertions) if present
TEST_FILE="$(fd -t f -a 'test_supported_llm_models.py' sdks/python . || true)"
echo "TEST_FILE=$TEST_FILE"
if [ -n "${TEST_FILE:-}" ]; then
# Print a focused window around likely model/cost assertions
# (limit output; adjust if file is small/large)
wc -l "$TEST_FILE"
sed -n '1,220p' "$TEST_FILE" | nl -ba
fi
# Also locate _get_model_costs definition (to verify its behavior)
fd -t f -a '_get_model_costs' sdks/python . | head -n 20Repository: Agenta-AI/agenta
Length of output: 103
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show assets.py context around the referenced lines
echo "== assets.py (context around 170-220) =="
sed -n '170,220p' sdks/python/agenta/sdk/utils/assets.py
# Show further context around where _get_model_costs likely lives
echo
echo "== assets.py (context around 220-320) =="
sed -n '220,320p' sdks/python/agenta/sdk/utils/assets.py
# Locate test file
echo
echo "== locating test_supported_llm_models.py =="
TEST_FILE="$(fd -t f -a 'test_supported_llm_models.py' . | head -n 20 || true)"
echo "TEST_FILE:"
echo "${TEST_FILE:-<not found>}"
if [ -n "${TEST_FILE:-}" ] && [ "${TEST_FILE:-}" != "<not found>" ]; then
echo
echo "== test file (first 260 lines) =="
sed -n '1,260p' "$TEST_FILE"
fi
# Search for usage of _get_model_costs and minimax metadata expectations
echo
echo "== searching for _get_model_costs usage =="
rg -n "_get_model_costs" sdks/python/agenta/sdk/utils/assets.py sdks/python/agenta | head -n 50
echo
echo "== searching for minimax/MiniMax-M3 and/or minimax metadata in tests =="
rg -n "minimax/MiniMax-M3|minimax\"|minimax.*M3|model_metadata\\[\"minimax\"\\]" . | head -n 100Repository: Agenta-AI/agenta
Length of output: 50375
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== assets.py imports around cost_calculator =="
sed -n '1,120p' sdks/python/agenta/sdk/utils/assets.py
echo
echo "== find tests referencing model_metadata or _get_model_costs =="
rg -n "model_metadata|_get_model_costs|cost_per_token|cost_calculator" sdks/python/oss/tests | head -n 200
echo
echo "== find tests referencing minimax/MiniMax-M3 or 'minimax' metadata =="
rg -n "minimax/MiniMax-M3|minimax\"|MiniMax-M3" sdks/python/oss/tests | head -n 200
echo
echo "== confirm supported_llm_models definition is imported in tests =="
rg -n "supported_llm_models" sdks/python/oss/tests/pytest/unit | head -n 200Repository: Agenta-AI/agenta
Length of output: 4860
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== searching for model_metadata usage =="
rg -n "model_metadata" sdks/python/oss/tests | head -n 200
echo
echo "== searching for minimax/MiniMax-M3 usage in tests =="
rg -n "minimax/MiniMax-M3" . | head -n 200
echo
echo "== searching for supported_llm_models usage in tests =="
rg -n "supported_llm_models" sdks/python/oss/tests | head -n 200Repository: Agenta-AI/agenta
Length of output: 101
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== searching for litellm.model_cost usage in tests =="
rg -n "litellm\.model_cost|model_cost" sdks/python/oss/tests | head -n 200
echo
echo "== searching for cost_calculator / cost_per_token usage in tests =="
rg -n "cost_calculator|cost_per_token|completion_cost" sdks/python/oss/tests | head -n 200
echo
echo "== locating assertions about minimax / model_metadata in tests =="
rg -n "model_metadata|minimax" sdks/python/oss/tests | head -n 200Repository: Agenta-AI/agenta
Length of output: 1429
Fix test-dependency reasoning for MiniMax-M3 (litellm.model_cost vs cost metadata)
"minimax": [
"minimax/MiniMax-M3",
],
sdks/python/oss/tests/pytest/unit/test_supported_llm_models.py fails based on model existence: it asserts every entry in supported_llm_models is present in litellm.model_cost (either directly, or after stripping the provider prefix). So minimax/MiniMax-M3 must land in litellm.model_cost for this PR’s test to pass.
The _get_model_costs() / model_metadata population via litellm.cost_calculator.cost_per_token(...) is a separate concern (it may omit minimax costs until litellm’s cost data exists), and I didn’t find a test here that directly asserts on model_metadata.
Merge sequencing suggestion remains: merge the litellm registry PR first → wait for a litellm release that includes M3 in model_cost → then merge this PR.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for any remaining references to removed MiniMax M2.x models
echo "=== Searching for MiniMax M2 model references ==="
rg -n --type=py --type=yaml --type=json --type=md -i 'minimax.*m2\.' -C2
echo ""
echo "=== Searching for any minimax model strings (broader search) ==="
rg -n --type=py --type=yaml --type=json -i 'minimax.*m2[.-]' -C2Repository: Agenta-AI/agenta
Length of output: 176
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Inspect assets.py around minimax entry ==="
nl -ba sdks/python/agenta/sdk/utils/assets.py | sed -n '150,230p'
echo
echo "=== Search for removed MiniMax M2.x model strings across entire repo (all file types) ==="
rg -n -i "MiniMax-M2(\.5|-\.5|-)?|MiniMax-M2\.1|MiniMax-M2\.5|MiniMax-M2\.1-lightning|MiniMax-M2\.5-lightning|MiniMax-M2\b" . || true
echo
echo "=== Search for 'minimax/MiniMax-M3' usage across repo ==="
rg -n -i "minimax/MiniMax-M3" . || true
echo
echo "=== Locate and inspect test_supported_llm_models.py ==="
TEST_FILE="$(fd -a -i "test_supported_llm_models\.py" . || true)"
echo "Found: ${TEST_FILE:-<none>}"
if [ -n "${TEST_FILE:-}" ]; then
nl -ba "$TEST_FILE" | sed -n '1,220p'
fi
echo
echo "=== Search for litellm.model_cost usage ==="
rg -n "litellm\.model_cost|_get_model_costs|supported_llm_models|model_cost" sdks/python/agenta . || trueRepository: Agenta-AI/agenta
Length of output: 168
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Inspect assets.py around minimax entry ==="
awk '{printf "%d\t%s\n", NR, $0}' sdks/python/agenta/sdk/utils/assets.py | sed -n '150,240p'
echo
echo "=== Search for removed MiniMax M2.x model strings across entire repo (all file types) ==="
rg -n -i "MiniMax-M2(\.5|-\.5|-)?|MiniMax-M2\.1|MiniMax-M2\.5|MiniMax-M2\.1-lightning|MiniMax-M2\.5-lightning|MiniMax-M2\b" . || true
echo
echo "=== Search for 'minimax/MiniMax-M3' usage across repo ==="
rg -n -i "minimax/MiniMax-M3" . || true
echo
echo "=== Locate and inspect test_supported_llm_models.py ==="
TEST_FILE="$(find . -name 'test_supported_llm_models.py' -print -quit || true)"
echo "Found: ${TEST_FILE:-<none>}"
if [ -n "${TEST_FILE:-}" ]; then
awk '{printf "%d\t%s\n", NR, $0}' "$TEST_FILE" | sed -n '1,260p'
fi
echo
echo "=== Search for litellm.model_cost / supported_llm_models / model_cost ==="
rg -n "litellm\.model_cost|_get_model_costs|supported_llm_models|model_cost" sdks/python/agenta . || trueRepository: Agenta-AI/agenta
Length of output: 18370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Inspect assets.py around model_metadata initialization ==="
awk '{printf "%d\t%s\n", NR, $0}' sdks/python/agenta/sdk/utils/assets.py | sed -n '230,330p'Repository: Agenta-AI/agenta
Length of output: 729
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Inspect top of assets.py for cost_calculator import/definition ==="
awk '{printf "%d\t%s\n", NR, $0}' sdks/python/agenta/sdk/utils/assets.py | sed -n '1,120p'
echo
echo "=== Inspect _get_model_costs body to see missing-model behavior ==="
awk '{printf "%d\t%s\n", NR, $0}' sdks/python/agenta/sdk/utils/assets.py | sed -n '180,255p'Repository: Agenta-AI/agenta
Length of output: 6853
Major breaking change: MiniMax M2.x models removed—add migration/deprecation and ensure litellm supports M3
sdks/python/agenta/sdk/utils/assets.py now lists only minimax/MiniMax-M3 under the minimax provider (removing the MiniMax-M2* variants). This can break existing user configs/workflows that still reference any MiniMax-M2* model strings.
- Repo impact: no remaining
MiniMax-M2*references were found in the codebase, but external user configuration/docs may still contain them. - LiteLLM/costs sequencing:
model_metadatais populated only whenlitellm.cost_calculator.cost_per_token()returns non-zero costs; otherwiseminimaxmetadata forminimax/MiniMax-M3will be absent. Additionally,sdks/python/oss/tests/pytest/unit/test_supported_llm_models.pyasserts everysupported_llm_modelsentry exists inlitellm.model_cost, so CI will fail untilminimax/MiniMax-M3is registered in LiteLLM.
Request: provide a deprecation/migration plan (or clearly documented release notes + migration guide) and ensure the LiteLLM registration timing aligns with the removal (or gate/adjust tests/metadata until it does).
mmabrouk
left a comment
There was a problem hiding this comment.
Thanks @octo-patch for the PR
I am not sure MiniMax-M2.5 is deprecated, I still can see it in the page (https://platform.minimax.io/docs/guides/text-generation)
As a rule we should include all the models that are available/usable. This means including also 2.7.
Your comment mentions this will not work until litellm adds it. Is that correct? Or is it so that it will work but won't have any cost?
Summary
Upgrade the
minimaxprovider entry insupported_llm_modelsto surface the latest MiniMax flagship model (MiniMax-M3) and prune the deprecated older series.Changes
sdks/python/agenta/sdk/utils/assets.py:minimax/MiniMax-M3.MiniMax-M2.5,MiniMax-M2.5-lightning,MiniMax-M2.1,MiniMax-M2.1-lightning, andMiniMax-M2entries.No other files needed changes — every other
minimaxreference in the repo (env vars, provider enums, helm templates, icons, transforms, etc.) is at the provider level and does not enumerate specific model IDs.Why
MiniMax-M3is the new flagship from MiniMax (release notes): 512K context window, 128K max output, image input, accessible over both OpenAI-compatible and Anthropic-compatible interfaces. The older M2.x line is being deprecated by the upstream provider.Note on the litellm model-registry test
test_supported_llm_models.pyasserts every model insupported_llm_modelsexists inlitellm.model_cost. The latestlitellmrelease (1.86.2) andmaindo not yet includeminimax/MiniMax-M3(only the M2.x entries), so that single parametrized case will fail until litellm registers M3 (cf. the precedent for M2: BerriAI/litellm#15950). The model still routes correctly through theminimax/prefix at runtime; only the cost-metadata lookup is missing.Happy to follow up by filing the litellm-registry PR, or to gate this PR on the litellm release if you prefer.
Test plan
ruff formatandruff checkclean on the changed filesupported_llm_models["minimax"]now resolves to["minimax/MiniMax-M3"]https://api.minimax.io/v1via the LiteLLMminimax/route once registered