Skip to content

Add MiniMax as a new LLM provider client (default: MiniMax-M3)#533

Open
octo-patch wants to merge 3 commits into
waylaidwanderer:mainfrom
octo-patch:feature/add-minimax-provider
Open

Add MiniMax as a new LLM provider client (default: MiniMax-M3)#533
octo-patch wants to merge 3 commits into
waylaidwanderer:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Mar 22, 2026

Summary

  • Add MiniMaxClient extending ChatGPTClient for MiniMax's OpenAI-compatible Chat Completions API
  • Default to the latest MiniMax-M3 model (512K context window, up to 128K output, image input support); keep MiniMax-M2.7 and MiniMax-M2.7-highspeed as alternatives
  • Wire MiniMax into the API server, CLI, settings, and module exports as a first-class minimax client option
  • Temperature clamping to MiniMax's [0, 1] range, proper user/assistant role message construction

Available models

Model Notes
MiniMax-M3 (default) Latest MiniMax model — 512K context, 128K max output, image input
MiniMax-M2.7 Previous generation
MiniMax-M2.7-highspeed Previous generation, low-latency variant

Changes

File Description
src/MiniMaxClient.js New client extending ChatGPTClient with overridden buildPrompt for proper chat message roles; default model set to MiniMax-M3, default maxContextTokens set to 512000
bin/server.js Add minimax case in getClient() factory
bin/cli.js Add minimax client option with MiniMax AI label
index.js Export MiniMaxClient
settings.example.js Add miniMaxClient configuration section (M3 default, M2.7/M2.7-highspeed listed as alternatives)
demos/use-minimax-client.js Usage example with M3 defaults
test/minimax-client-unit.js Unit tests covering constructor, options, temperature clamping, buildPrompt, stop tokens (default-model assertions updated to MiniMax-M3, default maxContextTokens assertion updated to 512000, plus a new test that overriding to MiniMax-M2.7 still works)
test/minimax-client-integration.js Integration tests targeting MiniMax-M3
README.md Document MiniMax support with MiniMax-M3 as the default and MiniMax-M2.7 / MiniMax-M2.7-highspeed as alternatives; note the 512K context / 128K output window

Why M3 as default

MiniMax-M3 is 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

  • Unit tests updated for M3 default model and 512K maxContextTokens (node --test test/minimax-client-unit.js)
  • Integration tests target MiniMax-M3 (MINIMAX_API_KEY=... node --test test/minimax-client-integration.js)
  • ESLint passes on all new files
  • Verify clientToUse: 'minimax' works in API server mode
  • Verify clientToUse: 'minimax' works in CLI mode

PR Bot and others added 2 commits March 22, 2026 19:32
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
@octo-patch octo-patch changed the title Add MiniMax as a new LLM provider client Add MiniMax as a new LLM provider client (default: MiniMax-M3) Jun 7, 2026
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.
@octo-patch
Copy link
Copy Markdown
Author

Pushed a fix for the CI failure: clientToUseForMessage was declared inside the try block but referenced in the error handler, so any request error would throw a ReferenceError instead of returning the proper message. Hoisted the declaration and cleaned up the lint warnings flagged by airbnb-base.

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