Skip to content

feat(providers): add native MiniMax support - #1162

Open
octo-patch wants to merge 2 commits into
weave-os:mainfrom
octo-patch:octo/20260903-provider-add-recvubki3x0oCw
Open

feat(providers): add native MiniMax support#1162
octo-patch wants to merge 2 commits into
weave-os:mainfrom
octo-patch:octo/20260903-provider-add-recvubki3x0oCw

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Reason: Add native MiniMax routing for the current text models with regional OpenAI-compatible endpoints.

  • Register MiniMax through the shared OpenAI-compatible client with global and mainland-China endpoint selection.
  • Add native catalog bindings with current upstream IDs, pricing, and cache rates while preserving existing route preference.
  • Document the MiniMax settings and cover regional URL selection, provider dispatch, catalog resolution, and model rewriting.

Checks:

  • go test ./...
  • go vet ./internal/providers/... ./internal/router/catalog ./internal/router/rl ./internal/translate ./cmd/router
  • git diff --check

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown

PR author is not in the allowed authors list.

@octo-patch

Copy link
Copy Markdown
Contributor Author

Updated this branch with the latest main and resolved the configuration conflict while preserving the MiniMax environment settings. I ran go test ./..., go vet ./internal/providers/... ./internal/router/catalog ./internal/router/rl ./internal/translate ./cmd/router, and git diff --check.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 380b2b5. Configure here.

{Provider: providers.ProviderFireworks, UpstreamID: "accounts/fireworks/models/minimax-m3",
Price: Pricing{InputUSDPer1M: 0.300, OutputUSDPer1M: 1.200, CacheReadMultiplier: 0.20}},
{Provider: providers.ProviderMiniMax, UpstreamID: "MiniMax-M3",
Price: Pricing{InputUSDPer1M: 0.600, OutputUSDPer1M: 2.400, CacheReadMultiplier: 0.12 / 0.600}},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

M3 uses long-context prices

High Severity

The native MiniMax M3 binding is priced at $0.60/$2.40 with a $0.12 cache-read rate, which is MiniMax's long-context tier for inputs over 512K. The model-level window stays at 512_000 and the MiniMax binding does not override ContextWindow, so routed turns never enter that tier. Official standard rates at or below 512K are $0.30/$1.20 with $0.06 cache reads. Catalog prices feed billing and planner EV, so MiniMax M3 usage is charged and scored at twice the actual cost.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 380b2b5. Configure here.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Thank you so much for this, @octo-patch — a native MiniMax provider is a genuinely useful addition, and you followed the internal/providers/AGENTS.md "adding a provider" recipe to the letter (sibling *BaseURL constant in openaicompat instead of a new adapter, the three-map edit in provider.go, registerDeploymentKeyedProvider in the composition root, the affinity/roster coverage maps, docs). That made this easy to carry over.

I've re-landed it as #1188 with your commits preserved and credited (Co-authored-by). It's not a fault with your work — the two things I had to touch are internal and not obvious from the outside:

  • Rebased onto main. The repo moved to the weave-os org and the module path changed to weave-os/router, and docs/CONFIGURATION.md gained new rows in the same spot, so the branch no longer merged cleanly.
  • M3 native binding priced at the ≤512k tier (0.300 / 1.200, cache read 0.06) instead of 0.600 / 2.400. Per MiniMax's pay-as-you-go table the 0.60/2.40 numbers are the >512k long-context tier (or the pre-discount list price); the catalog's ContextWindow: 512_000 never reaches it, and internal/router/catalog/AGENTS.md notes this table feeds billing and planner EV directly, so it needs to be the effective rate — same as the adjacent Fireworks/OpenRouter rows. Cursor's bot flagged this too. Test updated to match.

Everything else is exactly your change. Thanks again for contributing — hope to see more from you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant