Skip to content

Add MiniMax as alternative LLM provider#428

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

Add MiniMax as alternative LLM provider#428
octo-patch wants to merge 1 commit intoNVIDIA:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link

Summary

  • Add MiniMax as an alternative LLM provider in the RAG chain server get_llm() factory
  • MiniMax provides an OpenAI-compatible API with models like MiniMax-M2.7 (1M context) and MiniMax-M2.5-highspeed (204K context, speed-optimized)
  • Uses ChatOpenAI from langchain-openai with MiniMax base URL — no new proprietary SDK required
  • Temperature clamping to [0, 1] range for MiniMax API compatibility

Changes

File Change
RAG/src/chain_server/utils.py Add minimax branch in get_llm() factory using ChatOpenAI
RAG/src/chain_server/configuration.py Update model_engine help text to list minimax
RAG/src/chain_server/requirements.txt Add langchain-openai>=0.0.6 dependency
docs/change-model.md Add MiniMax usage documentation with env vars
RAG/src/chain_server/tests/ Add 15 unit tests + 3 integration tests

Usage

Test plan

  • 15 unit tests covering MiniMax provider creation, temperature clamping, parameter forwarding, config defaults, error handling
  • 2 unit tests verifying NVIDIA AI endpoints path is unchanged
  • 3 integration tests verifying real API calls (chat completion, streaming, M2.5-highspeed model)
  • Docker compose integration test with APP_LLM_MODELENGINE=minimax

Add MiniMax Cloud API (https://api.minimax.io/v1) as an alternative LLM
provider alongside NVIDIA AI endpoints. MiniMax offers an OpenAI-compatible
API with models including MiniMax-M2.7 (1M context) and MiniMax-M2.5-highspeed
(204K context, speed-optimized).

Changes:
- Add 'minimax' model_engine branch in get_llm() factory (utils.py)
- Use ChatOpenAI from langchain-openai with MiniMax base_url
- Temperature clamping to [0, 1] range for MiniMax API compatibility
- Auto-detect MINIMAX_API_KEY environment variable
- Add langchain-openai dependency to requirements.txt
- Update LLMConfig help text to mention minimax
- Add MiniMax usage documentation in docs/change-model.md
- Add 15 unit tests and 3 integration tests

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
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