Add MiniMax as an LLM provider - #266
Open
octo-patch wants to merge 1 commit into
Open
Conversation
Register MiniMax in ChatLLMFactory with global and China regional routes for both the OpenAI-compatible and Anthropic-compatible endpoints, add the minimax_chat module, a minimax.yaml provider config defaulting to MiniMax-M3, and a provider-registration unit test.
|
Thanks for the review. I formatted the MiniMax chat provider to satisfy the lint configuration and pushed a new commit. I ran Black, Ruff, isort, and the MiniMax provider test (skipped because optional runtime dependencies are unavailable locally). |
1 similar comment
|
Thanks for the review. I formatted the MiniMax chat provider to satisfy the lint configuration and pushed a new commit. I ran Black, Ruff, isort, and the MiniMax provider test (skipped because optional runtime dependencies are unavailable locally). |
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: ChatLLMFactory only accepted a fixed provider list and rejected every other identifier, so MiniMax could not be selected.
What changed
ChatLLMFactorypreviously hard-coded its provider list and raisedValueErrorfor any identifier outside it. This PR adds MiniMax as a first-class provider following the existing per-provider pattern.llm/minimax_chat.pyexposingAssistantChatMiniMax(OpenAI-compatible route) andAssistantChatMiniMaxAnthropic(Anthropic-compatible route), pluscreate_minimax_chatandget_minimax_models, mirroring the existingopenai_chat.py/anthropic_chat.pymodules.api.minimax.io) and China (api.minimaxi.com) routes are supported through aregionsetting (global_en/cn_zh), each providing an OpenAI-compatible (/v1) and an Anthropic-compatible (/anthropic) base URL.apisetting (openai/anthropic) selects the compatibility route.get_minimax_modelsdiscovers models over the OpenAI-compatible route and falls back to the current release list (MiniMax-M3,MiniMax-M2.7).MINIMAX_API_KEYenvironment variable.llm/llm_factory.pyregistersminimaxinget_valid_providers,get_valid_models, theget_chat_modeldispatch, and the return type union.configs/minimax.yamlprovider config modeled on the existing provider configs, defaulting toMiniMax-M3on theglobal_enOpenAI-compatible route.tests/unittests/llm/test_minimax_provider.pyverifying provider registration, the regional endpoint map, and the current model list. The module is guarded withpytest.importorskipfor the optional runtime dependencies.Checks
python -m py_compileon the changed modules and tests — passed.python -m isort --check-onlyon the changed files — passed.python -m pytest tests/unittests/llm/test_minimax_provider.py— collected; skipped locally because the optional LLM runtime dependencies are not installed in this environment.