Skip to content

feat: add MiniMax as LLM provider via OpenAI-compatible API#2284

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

feat: add MiniMax as LLM provider via OpenAI-compatible API#2284
octo-patch wants to merge 1 commit intoSciPhi-AI:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax AI as a supported LLM provider in R2R's OpenAI completion provider, following the same integration pattern as DeepSeek.

MiniMax offers an OpenAI-compatible API at https://api.minimax.io/v1 with models like MiniMax-M2.7 (latest, 204K context) and MiniMax-M2.5-highspeed (optimized for speed).

Changes

  • OpenAI provider (py/core/providers/llm/openai.py): Add MiniMax client initialization (sync + async) with MINIMAX_API_KEY env var, minimax/ prefix routing in both sync and async client selection, and temperature clamping to MiniMax's [0, 1] range
  • R2R router (py/core/providers/llm/r2r_llm.py): Add minimax/ to OpenAI-like prefixes for automatic routing
  • Config (py/core/configs/minimax.toml): Ready-to-use config for MiniMax-powered R2R deployment
  • README (py/README.md): Add MiniMax getting started instructions

Usage

export MINIMAX_API_KEY=your-key
export R2R_CONFIG_NAME=minimax
python -m r2r.serve

Or with the R2R provider (auto-routing):

response = client.retrieval.rag(
    query="What is quantum computing?",
    rag_generation_config={"model": "minimax/MiniMax-M2.7"}
)

Models supported

Model Context Best for
minimax/MiniMax-M2.7 204K Quality, complex reasoning
minimax/MiniMax-M2.5 204K Balanced performance
minimax/MiniMax-M2.5-highspeed 204K Speed-optimized

Test plan

  • 19 unit tests covering client init, prefix routing, temperature clamping, base args, R2R router dispatch, and config validation
  • 3 integration tests (async completion, streaming, JSON mode) with real MiniMax API
  • All 22 tests pass

Add MiniMax AI (https://api.minimax.io/v1) as a supported LLM provider
in the OpenAI completion provider, following the same pattern as
DeepSeek. Users can use models like minimax/MiniMax-M2.7 and
minimax/MiniMax-M2.5-highspeed.

Changes:
- Add MiniMax client init in OpenAICompletionProvider (sync + async)
- Add minimax/ prefix routing in client selection methods
- Add temperature clamping to [0, 1] range for MiniMax API
- Add minimax/ to R2R router's OpenAI-like prefixes
- Add minimax.toml config file for quick setup
- Update README with MiniMax getting started instructions
- Add 19 unit tests and 3 integration tests

Configuration:
  export MINIMAX_API_KEY=your-key
  # Use model: minimax/MiniMax-M2.7 or minimax/MiniMax-M2.5-highspeed
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