add MiniMax-M3 to model catalog - #179
Conversation
Register MiniMax-M3 metadata and pricing so the existing catalog can surface the provider's OpenAI and Anthropic-compatible endpoints. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thank you for your contribution. Before we can merge this, you need to sign our Contributor License Agreement. I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdded MiniMax-M3 pricing and a new minimax provider catalog entry with model mappings, regional endpoints, compatibility URLs, and model metadata. ChangesMiniMax-M3 Provider and Pricing
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@loki-ts/data/model-pricing.json`:
- Line 12: The MiniMax-M3 pricing entry is keyed with mixed case, but
pricingFor() lowercases model names before looking up PRICING, so the lookup
always misses. Update the pricing map entry in model-pricing.json to use the
normalized lowercase key minmax-m3/minimax-m3, or add key normalization where
PRICING is loaded, so pricingFor() matches the stored symbol consistently.
In `@providers/model_catalog.json`:
- Around line 82-113: The minimax provider entry includes per-region endpoint
data that is never consumed by the current schema, so `cn_zh` still won’t route
correctly. Update the `minimax` block in `providers/model_catalog.json` to
either fit the per-region schema used by the catalog consumers or remove the
unused `endpoints`/`region`/`docs_root` fields entirely; use the existing
`latest_*` and `models[]` structure as the source of truth and ensure the
Minimax China base URLs are actually represented where the provider runners and
`dashboard/server.py` read them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fe45be71-a432-4629-88b9-150be0e7402a
📒 Files selected for processing (2)
loki-ts/data/model-pricing.jsonproviders/model_catalog.json
| "haiku": { "input": 1.0, "output": 5.0 }, | ||
| "gpt-5.3-codex": { "input": 1.75, "output": 14.0 } | ||
| "gpt-5.3-codex": { "input": 1.75, "output": 14.0 }, | ||
| "MiniMax-M3": { "input": 0.6, "output": 2.4, "cache_input": 0.12 } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Confirm how the model name string reaches pricingFor() (case) for minimax models,
# and whether any normalization/alias-resolution happens before the pricing lookup.
rg -n -B3 -A10 'function pricingFor' loki-ts/src/runner/budget.ts
rg -nP 'MiniMax-M3|minimax-m3' -C3 --type=ts loki-tsRepository: asklokesh/loki-mode
Length of output: 801
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the pricing table load path and nearby helpers.
sed -n '1,220p' loki-ts/src/runner/budget.ts
printf '\n--- model-pricing.json ---\n'
cat -n loki-ts/data/model-pricing.json
printf '\n--- model-name usages ---\n'
rg -n -C3 'MiniMax-M3|minimax-m3|toLowerCase\(\)|PRICING\[' loki-ts/src loki-ts/dataRepository: asklokesh/loki-mode
Length of output: 21854
Lowercase the MiniMax-M3 pricing key
pricingFor() lowercases model names before indexing PRICING, but this entry is still MiniMax-M3, so every MiniMax-M3 lookup misses and falls back to sonnet pricing. Rename the key to minimax-m3 or normalize keys when loading.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@loki-ts/data/model-pricing.json` at line 12, The MiniMax-M3 pricing entry is
keyed with mixed case, but pricingFor() lowercases model names before looking up
PRICING, so the lookup always misses. Update the pricing map entry in
model-pricing.json to use the normalized lowercase key minmax-m3/minimax-m3, or
add key normalization where PRICING is loaded, so pricingFor() matches the
stored symbol consistently.
| "minimax": { | ||
| "latest_planning": "MiniMax-M3", | ||
| "latest_development": "MiniMax-M3", | ||
| "latest_fast": "MiniMax-M3", | ||
| "openai_base_url": "https://api.minimax.io/v1", | ||
| "anthropic_base_url": "https://api.minimax.io/anthropic/v1", | ||
| "endpoints": [ | ||
| { | ||
| "region": "global_en", | ||
| "openai_base_url": "https://api.minimax.io/v1", | ||
| "anthropic_base_url": "https://api.minimax.io/anthropic/v1", | ||
| "docs_root": "https://platform.minimax.io/docs" | ||
| }, | ||
| { | ||
| "region": "cn_zh", | ||
| "openai_base_url": "https://api.minimaxi.com/v1", | ||
| "anthropic_base_url": "https://api.minimaxi.com/anthropic/v1", | ||
| "docs_root": "https://platform.minimaxi.com/docs" | ||
| } | ||
| ], | ||
| "models": [ | ||
| { | ||
| "id": "MiniMax-M3", | ||
| "tier": "development", | ||
| "context_window": 1000000, | ||
| "input_price_per_mtok": 0.6, | ||
| "output_price_per_mtok": 2.4, | ||
| "cache_input_price_per_mtok": 0.12, | ||
| "thinking": ["adaptive", "disabled"], | ||
| "notes": "Anthropic-compatible endpoint requires /anthropic/v1. Docs: https://platform.minimax.io/docs/api-reference/api-overview and https://platform.minimaxi.com/docs/api-reference/api-overview." | ||
| } | ||
| ] |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the catalog loader/consumer to check if it reads `endpoints`, `region`, or `docs_root`.
rg -nP '\bendpoints\b|\bdocs_root\b|model_catalog' -C3 --type=ts --type=js -g '!**/node_modules/**' | head -100Repository: asklokesh/loki-mode
Length of output: 157
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== top-level files =="
git ls-files | sed -n '1,200p'
echo
echo "== model_catalog references =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'model_catalog\.json|model_catalog|endpoints|docs_root|anthropic_base_url|openai_base_url|region' \
. -g '!**/.git/**' -C 2 | sed -n '1,250p'Repository: asklokesh/loki-mode
Length of output: 25735
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'repo root: '; pwd
echo
echo "== files likely related to provider catalogs =="
fd -a 'model_catalog.json|catalog|provider' . -t f | sed -n '1,200p'
echo
echo "== exact references =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'model_catalog\.json|model_catalog|endpoints|docs_root|anthropic_base_url|openai_base_url|region' \
. -C 2 | sed -n '1,300p'Repository: asklokesh/loki-mode
Length of output: 30305
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== potential catalog-related files =="
git ls-files | rg '(^|/)(model_catalog\.json|.*catalog.*|.*provider.*|.*loader.*|.*config.*)\.(json|ts|js|mjs|cjs|py|go|rs|rb|java|kt)$'
echo
echo "== direct mentions anywhere =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'model_catalog\.json|endpoints|docs_root|anthropic_base_url|openai_base_url|region|MiniMax-M3|minimax' \
. -C 3 | sed -n '1,250p'Repository: asklokesh/loki-mode
Length of output: 22728
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== tools/probe-model-catalog.py =="
wc -l tools/probe-model-catalog.py
sed -n '1,260p' tools/probe-model-catalog.py
echo
echo "== loki-ts/src/runner/providers.ts =="
wc -l loki-ts/src/runner/providers.ts
sed -n '1,260p' loki-ts/src/runner/providers.ts
echo
echo "== providers/managed.py =="
wc -l providers/managed.py
sed -n '1,260p' providers/managed.pyRepository: asklokesh/loki-mode
Length of output: 26376
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== outline: loki-ts/src/runner/providers.ts =="
ast-grep outline loki-ts/src/runner/providers.ts --view expanded | sed -n '1,240p'
echo
echo "== outline: providers/managed.py =="
ast-grep outline providers/managed.py --view expanded | sed -n '1,240p'
echo
echo "== outline: tools/probe-model-catalog.py =="
ast-grep outline tools/probe-model-catalog.py --view expanded | sed -n '1,240p'Repository: asklokesh/loki-mode
Length of output: 3557
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== exact model_catalog.json references =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'model_catalog\.json' . -C 3
echo
echo "== tools/probe-model-catalog.py =="
wc -l tools/probe-model-catalog.py
sed -n '1,260p' tools/probe-model-catalog.py
echo
echo "== providers/managed.py =="
wc -l providers/managed.py
sed -n '1,260p' providers/managed.py
echo
echo "== loki-ts/src/runner/providers.ts =="
wc -l loki-ts/src/runner/providers.ts
sed -n '1,260p' loki-ts/src/runner/providers.tsRepository: asklokesh/loki-mode
Length of output: 46531
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== providers/models.sh =="
wc -l providers/models.sh
sed -n '1,240p' providers/models.sh
echo
echo "== dashboard/server.py provider-model endpoint =="
sed -n '1020,1065p' dashboard/server.py
echo
echo "== web-app/provider catalog consumers =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'/api/providers/models|providers/model_catalog\.json|provider.*models|model catalog|latest_planning|latest_development|latest_fast' \
web-app dashboard-ui dashboard loki-ts tests providers -C 2 | sed -n '1,260p'Repository: asklokesh/loki-mode
Length of output: 20171
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== providers/models.sh =="
wc -l providers/models.sh
sed -n '1,240p' providers/models.sh
echo
echo "== dashboard/server.py provider-model endpoint =="
sed -n '1020,1065p' dashboard/server.py
echo
echo "== consumer references for /api/providers/models and catalog fields =="
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'/api/providers/models|providers/model_catalog\.json|endpoints|docs_root|region' \
web-app dashboard-ui dashboard loki-ts tests providers -C 2 | sed -n '1,260p'Repository: asklokesh/loki-mode
Length of output: 22351
Wire minimax into the per-region schema, or remove the unused fields. providers/models.sh, dashboard/server.py, and the provider runners only read latest_* / models[]; endpoints, region, and docs_root are just pass-through JSON here, so cn_zh never routes to api.minimaxi.com.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@providers/model_catalog.json` around lines 82 - 113, The minimax provider
entry includes per-region endpoint data that is never consumed by the current
schema, so `cn_zh` still won’t route correctly. Update the `minimax` block in
`providers/model_catalog.json` to either fit the per-region schema used by the
catalog consumers or remove the unused `endpoints`/`region`/`docs_root` fields
entirely; use the existing `latest_*` and `models[]` structure as the source of
truth and ensure the Minimax China base URLs are actually represented where the
provider runners and `dashboard/server.py` read them.
Reason: add target provider/model to existing provider registry
Summary
Test plan
Generated by Octopatch.