Skip to content

feat: add MiniMax provider support - #106

Open
octo-patch wants to merge 2 commits into
1rgs:mainfrom
octo-patch:octo/20260728-provider-add-recvpywUHDvDVd
Open

feat: add MiniMax provider support#106
octo-patch wants to merge 2 commits into
1rgs:mainfrom
octo-patch:octo/20260728-provider-add-recvpywUHDvDVd

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Add MiniMax provider support — the current model mapping supports only OpenAI, Gemini, and Anthropic; MiniMax-M3/MiniMax-M2.7 and the global/CN endpoints are absent.

Changes

  • Add MINIMAX_API_KEY and MINIMAX_BASE_URL environment variables.
  • Default MINIMAX_BASE_URL to the global endpoint (https://api.minimax.io/v1); the CN endpoint (https://api.minimaxi.com/v1) is selectable via env.
  • Add MiniMax-M3 and MiniMax-M2.7 to the known model list (MINIMAX_MODELS).
  • Add PREFERRED_PROVIDER=minimax support: haiku/sonnet map to SMALL_MODEL/BIG_MODEL prefixed with minimax/.
  • Prefix bare MiniMax models with minimax/ in both MessagesRequest and TokenCountRequest validators.
  • In convert_anthropic_to_litellm, translate the minimax/ prefix to openai/ for the LiteLLM call so MiniMax's OpenAI-compatible endpoint is used with the configured api_base and api_key.
  • In create_message and count_tokens, select the MiniMax API key and base URL for minimax/ models.
  • Update .env.example and README.md with the new configuration.

Checks

  • python3 -m py_compile server.py — syntax check passed.
  • uv run python -c "import server; ..." — import and model-mapping assertions passed (sonnetminimax/MiniMax-M3, haikuminimax/MiniMax-M2.7, bare MiniMax-M3minimax/MiniMax-M3, and convert_anthropic_to_litellm translates minimax/openai/ for the LiteLLM call).

Add MiniMax as a new PREFERRED_PROVIDER option alongside OpenAI, Google,
and Anthropic. MiniMax exposes an OpenAI-compatible endpoint, so models
prefixed with minimax/ are routed through LiteLLM's openai provider using
a configurable api_base and api_key.

- Add MINIMAX_API_KEY and MINIMAX_BASE_URL environment variables
- Default MINIMAX_BASE_URL to the global endpoint (https://api.minimax.io/v1);
  the CN endpoint (https://api.minimaxi.com/v1) is selectable via env
- Add MiniMax-M3 and MiniMax-M2.7 to the known model list
- Map haiku/sonnet to SMALL_MODEL/BIG_MODEL with the minimax/ prefix when
  PREFERRED_PROVIDER=minimax
- Prefix bare MiniMax models with minimax/ in both message and token-count
  validators
- Select the MiniMax API key and base URL for minimax/ models in
  create_message and count_tokens
- Update .env.example and README with the new configuration
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