feat(model): add MiniMax provider with global and China regions - #148
Open
octo-patch wants to merge 2 commits into
Open
octo-patch wants to merge 2 commits into
octo-patch wants to merge 2 commits into
Conversation
Author
|
Updated the MiniMax provider to use the canonical global_en/cn_zh region identifiers and expose the complete context, pricing, input modality, and thinking metadata for MiniMax-M3 and MiniMax-M2.7. I ran the 12 provider tests, Ruff check/format, and a targeted mypy check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: Add the MiniMax model provider with global and China regions, exposing the current MiniMax-M3 and MiniMax-M2.7 models.
Changes
This adds MiniMax as a first-class built-in model provider, discovered and registered automatically by the existing provider auto-discovery mechanism (no manual registration needed).
backend/app/core/model/providers/MiniMax.py: aMiniMaxProviderextending the OpenAI-compatible base. It exposes both regional endpoints and both API protocols:https://api.minimax.io) and China (https://api.minimaxi.com).https://api.minimax.io/v1andhttps://api.minimaxi.com/v1.https://api.minimax.io/anthropicandhttps://api.minimaxi.com/anthropic.regioncredential field selects the endpoint, and aprotocol_typefield (openai|anthropic) selects which compatible API to use; an optionalbase_urloverrides either.MiniMax-M3(1M context, multimodal input, adaptive thinking) andMiniMax-M2.7(204K context, always-on thinking).backend/app/services/model_provider_service.py: registerminimaxinBUILTIN_PROVIDER_ORDERso it sorts with the other built-in providers.backend/tests/test_minimax_provider.py: cover provider identity, credential schema, predefined models, region/protocol base-URL resolution for both protocols in both regions, explicit base URL override, unknown-region fallback, and error handling.The provider is picked up by
get_all_provider_instances()/ModelFactoryvia directory auto-discovery, so no__init__.pyregistration is required.Checks
ruff checkon the changed files — passed.ruff format --checkon the changed files — passed.mypy app/core/model/providers/MiniMax.py --ignore-missing-imports— no issues.pytest tests/test_minimax_provider.py— 12 passed.