Add MiniMax as a new LLM provider client (default: MiniMax-M3)#533
Open
octo-patch wants to merge 3 commits into
Open
Add MiniMax as a new LLM provider client (default: MiniMax-M3)#533octo-patch wants to merge 3 commits into
octo-patch wants to merge 3 commits into
Conversation
Add MiniMaxClient extending ChatGPTClient, supporting MiniMax's OpenAI-compatible Chat Completions API with M2.7/M2.7-highspeed models, temperature clamping [0,1], 1M context window, proper user/assistant role messages, streaming, and conversation management. - src/MiniMaxClient.js: new client with buildPrompt override for proper chat message roles - bin/server.js, bin/cli.js: add 'minimax' client option in getClient() - settings.example.js: add miniMaxClient config section - demos/use-minimax-client.js: usage example - test/minimax-client-unit.js: 30 unit tests - test/minimax-client-integration.js: 3 integration tests - README.md: document MiniMax support
- Add MiniMax-M3 to model list and set as default - Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed - Remove older models (M2.5/M2.5-highspeed) - Update maxContextTokens default from 1M to 512K (M3 spec) - Update README/demos/settings docs to reflect M3 defaults - Update related unit and integration tests
clientToUseForMessage was declared with let inside the try block but referenced in the catch/error path, where it is out of scope — any request error would throw a ReferenceError instead of returning the intended error message. Hoist the declaration above the try block. Also apply eslint --fix for object-curly-newline / destructuring style to satisfy the airbnb-base config used by CI.
Author
|
Pushed a fix for the CI failure: |
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
MiniMaxClientextendingChatGPTClientfor MiniMax's OpenAI-compatible Chat Completions APIMiniMax-M3model (512K context window, up to 128K output, image input support); keepMiniMax-M2.7andMiniMax-M2.7-highspeedas alternativesminimaxclient option[0, 1]range, properuser/assistantrole message constructionAvailable models
MiniMax-M3(default)MiniMax-M2.7MiniMax-M2.7-highspeedChanges
src/MiniMaxClient.jsbuildPromptfor proper chat message roles; default model set toMiniMax-M3, defaultmaxContextTokensset to512000bin/server.jsminimaxcase ingetClient()factorybin/cli.jsminimaxclient option with MiniMax AI labelindex.jsMiniMaxClientsettings.example.jsminiMaxClientconfiguration section (M3 default, M2.7/M2.7-highspeed listed as alternatives)demos/use-minimax-client.jstest/minimax-client-unit.jsMiniMax-M3, defaultmaxContextTokensassertion updated to512000, plus a new test that overriding toMiniMax-M2.7still works)test/minimax-client-integration.jsMiniMax-M3README.mdMiniMax-M3as the default andMiniMax-M2.7/MiniMax-M2.7-highspeedas alternatives; note the 512K context / 128K output windowWhy M3 as default
MiniMax-M3is MiniMax's latest model and supersedes the M2.x line: 512K context window, up to 128K output, and image input support. M2.7 and M2.7-highspeed are kept as user-selectable alternatives so existing deployments remain functional, while older M2.5 entries are removed since they are superseded.Test plan
maxContextTokens(node --test test/minimax-client-unit.js)MiniMax-M3(MINIMAX_API_KEY=... node --test test/minimax-client-integration.js)clientToUse: 'minimax'works in API server modeclientToUse: 'minimax'works in CLI mode