Add MiniMax Cloud API as LLM provider#316
Open
octo-patch wants to merge 1 commit intoInternLM:mainfrom
Open
Conversation
Introduce MiniMax Cloud API support as a first-class model format. MiniMaxAPI extends GPTAPI to handle MiniMax model types that the base class does not recognise, including correct request data generation and streaming response parsing. Changes: - Add MiniMaxAPI(GPTAPI) subclass with generate_request_data() and _stream_chat() overrides for MiniMax-compatible request/response handling - Add minimax preset dict (MiniMax-M1 default, configurable via MINIMAX_MODEL and MINIMAX_API_KEY env vars) - Document minimax as a --model_format option in README and README_zh-CN - Add MINIMAX_API_KEY / MINIMAX_MODEL to .env.example - Add 16 unit tests and 3 integration tests
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.
Summary
Add MiniMax as a first-class LLM provider via a new
minimaxmodel format.MiniMaxAPI(GPTAPI)subclass that overridesgenerate_request_data()and_stream_chat()to handle MiniMax model types not recognised by the base class's routing logic, and to fix streaming response parsing (the base class assumesfinish_reasonis always present in every SSE chunk, but MiniMax—following standard OpenAI behaviour—omits it in non-final chunks)minimaxpreset dict with sensible defaults (MiniMax-M1, configurable viaMINIMAX_MODEL/MINIMAX_API_KEYenv vars)minimaxas a--model_formatoption.env.exampleupdated withMINIMAX_API_KEYandMINIMAX_MODELplaceholdersUsage
Optionally override the model:
Test plan
MINIMAX_API_KEYpython -m unittest tests.test_minimax_models tests.test_minimax_integration