Skip to content

Add MiniMax Cloud API as LLM provider#316

Open
octo-patch wants to merge 1 commit intoInternLM:mainfrom
octo-patch:feature/add-minimax-provider
Open

Add MiniMax Cloud API as LLM provider#316
octo-patch wants to merge 1 commit intoInternLM:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link

Summary

Add MiniMax as a first-class LLM provider via a new minimax model format.

  • MiniMaxAPI(GPTAPI) subclass that overrides generate_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 assumes finish_reason is always present in every SSE chunk, but MiniMax—following standard OpenAI behaviour—omits it in non-final chunks)
  • minimax preset dict with sensible defaults (MiniMax-M1, configurable via MINIMAX_MODEL / MINIMAX_API_KEY env vars)
  • Documentation updates in README.md and README_zh-CN.md listing minimax as a --model_format option
  • .env.example updated with MINIMAX_API_KEY and MINIMAX_MODEL placeholders

Usage

export MINIMAX_API_KEY="your-key"
python -m mindsearch.app --lang en --model_format minimax --search_engine DuckDuckGoSearch

Optionally override the model:

export MINIMAX_MODEL="MiniMax-M1-highspeed"

Test plan

  • 16 unit tests covering preset config, MiniMaxAPI request generation, parameter stripping, env var overrides, and .env.example validation — all pass
  • 3 integration tests (basic chat, streaming, init_agent resolution) — all pass with a valid MINIMAX_API_KEY
  • Run with python -m unittest tests.test_minimax_models tests.test_minimax_integration

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
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