Skip to content

feat: add MiniMax Cloud API as engine backend#319

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

feat: add MiniMax Cloud API as engine backend#319
octo-patch wants to merge 1 commit intoxusenlinzy:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as a third engine type alongside HuggingFace and vLLM, enabling users to serve MiniMax cloud models through the same OpenAI-compatible API without local GPU.

Changes

  • New engine: api/engine/minimax.pyMiniMaxEngine class using OpenAI SDK with MiniMax's OpenAI-compatible endpoint
  • New routes: api/minimax_routes/ — Chat completion and text completion endpoints for MiniMax
  • Config: MINIMAX_API_KEY, MINIMAX_API_BASE environment variables via MiniMaxSettings
  • Temperature clamping: Automatically clamps temperature to MiniMax's accepted [0, 1] range
  • Streaming support: Both streaming and non-streaming responses
  • README: Added MiniMax section with setup instructions and supported models table
  • Tests: 29 unit tests + 3 integration tests

Supported Models

Model Context Length
MiniMax-M2.7 1M
MiniMax-M2.7-highspeed 1M
MiniMax-M2.5 245K
MiniMax-M2.5-highspeed 204K

Usage

export ENGINE=minimax
export MODEL_NAME=MiniMax-M2.7
export MINIMAX_API_KEY=your-api-key
python -m api.server

The API is fully compatible — existing client code using OpenAI SDK works without modification.

Test Plan

  • 29 unit tests covering engine initialization, temperature clamping, config, route kwargs building, module imports
  • 3 integration tests with real MiniMax API (chat completion, streaming, temperature clamping)
  • All tests passing

11 files changed, 769 additions(+), 5 deletions(-)

Add MiniMax (https://www.minimaxi.com/) as a third engine type alongside
HuggingFace and vLLM, enabling users to serve MiniMax cloud models
(M2.7, M2.5) through the same OpenAI-compatible API without local GPU.

- New engine: api/engine/minimax.py (MiniMaxEngine via OpenAI SDK)
- New routes: api/minimax_routes/ (chat + completion endpoints)
- Config: MINIMAX_API_KEY, MINIMAX_API_BASE env vars
- Temperature clamping to MiniMax [0, 1] range
- Streaming and non-streaming support
- 29 unit tests + 3 integration tests
- README docs with setup instructions

Usage: ENGINE=minimax MODEL_NAME=MiniMax-M2.7 MINIMAX_API_KEY=xxx python -m api.server
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