Skip to content

feat: add MiniMax as cloud LLM provider#165

Open
octo-patch wants to merge 1 commit intoX-D-Lab:masterfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as cloud LLM provider#165
octo-patch wants to merge 1 commit intoX-D-Lab:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax M2.7 and M2.7-highspeed as cloud LLM providers alongside existing local models (ChatGLM, BELLE, Vicuna, InternLM, Yuan2). This enables users without GPU hardware to use the knowledge-based QA system via MiniMax's cloud API.

Changes

  • minimax_llm.py (new): ChatMiniMaxLLM class extending LangChain LLM, using MiniMax OpenAI-compatible API (https://api.minimax.io/v1) with temperature clamping to (0, 1] and think-tag stripping
  • config.py: Added MiniMax model entries (MiniMax-M2.7, MiniMax-M2.7-highspeed) to llm_model_dict; fixed missing comma syntax error
  • app.py: Added MiniMax detection in init_model_config() — uses ChatMiniMaxLLM for cloud inference, skipping local model loading
  • requirements.txt: Added openai>=1.0.0 dependency
  • README.md: Added MiniMax models to supported models table with usage instructions

Usage

export MINIMAX_API_KEY="your-api-key"
python app.py
# Select MiniMax-M2.7 or MiniMax-M2.7-highspeed from the model dropdown

Test Plan

  • 21 unit tests covering initialization, API calls, temperature clamping, history management, think-tag stripping, stop tokens
  • 5 integration tests verifying config syntax, app dispatch logic, README content
  • 3 API integration tests with real MiniMax API (basic completion, highspeed model, Chinese Q&A)
  • All 29 tests pass (28/29 with network; 1 transient timeout)

Add MiniMax M2.7 and M2.7-highspeed as cloud LLM options alongside
existing local models (ChatGLM, BELLE, Vicuna, InternLM, Yuan2).

- New minimax_llm.py: ChatMiniMaxLLM class extending LangChain LLM,
  using MiniMax OpenAI-compatible API with temperature clamping and
  think-tag stripping
- Updated config.py: added MiniMax model entries to llm_model_dict
  (also fixed missing comma syntax error between internlm and yuan2)
- Updated app.py: MiniMax model type detection in init_model_config,
  uses ChatMiniMaxLLM for cloud inference (no GPU required)
- Updated requirements.txt: added openai>=1.0.0 dependency
- Updated README.md: added MiniMax models to supported models table
  with usage instructions
- Added tests/test_minimax_llm.py: 21 unit tests + 3 integration tests
  covering init, API calls, temp clamping, history, think-tag stripping

Usage: set MINIMAX_API_KEY env var, then select MiniMax-M2.7 or
MiniMax-M2.7-highspeed from the model dropdown in the web UI.
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