Skip to content

Add MiniMax as an LLM provider - #266

Open
octo-patch wants to merge 1 commit into
autogluon:mainfrom
octo-patch:octo/20260730-provider-add-recvqd2yfibEwU
Open

Add MiniMax as an LLM provider#266
octo-patch wants to merge 1 commit into
autogluon:mainfrom
octo-patch:octo/20260730-provider-add-recvqd2yfibEwU

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: ChatLLMFactory only accepted a fixed provider list and rejected every other identifier, so MiniMax could not be selected.

What changed

ChatLLMFactory previously hard-coded its provider list and raised ValueError for any identifier outside it. This PR adds MiniMax as a first-class provider following the existing per-provider pattern.

  • New llm/minimax_chat.py exposing AssistantChatMiniMax (OpenAI-compatible route) and AssistantChatMiniMaxAnthropic (Anthropic-compatible route), plus create_minimax_chat and get_minimax_models, mirroring the existing openai_chat.py / anthropic_chat.py modules.
    • Both global (api.minimax.io) and China (api.minimaxi.com) routes are supported through a region setting (global_en / cn_zh), each providing an OpenAI-compatible (/v1) and an Anthropic-compatible (/anthropic) base URL.
    • An api setting (openai / anthropic) selects the compatibility route.
    • get_minimax_models discovers models over the OpenAI-compatible route and falls back to the current release list (MiniMax-M3, MiniMax-M2.7).
    • Credentials are read from the MINIMAX_API_KEY environment variable.
  • llm/llm_factory.py registers minimax in get_valid_providers, get_valid_models, the get_chat_model dispatch, and the return type union.
  • New configs/minimax.yaml provider config modeled on the existing provider configs, defaulting to MiniMax-M3 on the global_en OpenAI-compatible route.
  • New tests/unittests/llm/test_minimax_provider.py verifying provider registration, the regional endpoint map, and the current model list. The module is guarded with pytest.importorskip for the optional runtime dependencies.

Checks

  • python -m py_compile on the changed modules and tests — passed.
  • python -m isort --check-only on the changed files — passed.
  • python -m pytest tests/unittests/llm/test_minimax_provider.py — collected; skipped locally because the optional LLM runtime dependencies are not installed in this environment.

Register MiniMax in ChatLLMFactory with global and China regional routes
for both the OpenAI-compatible and Anthropic-compatible endpoints, add the
minimax_chat module, a minimax.yaml provider config defaulting to MiniMax-M3,
and a provider-registration unit test.
@kapelame

kapelame commented Aug 5, 2026

Copy link
Copy Markdown

Thanks for the review. I formatted the MiniMax chat provider to satisfy the lint configuration and pushed a new commit. I ran Black, Ruff, isort, and the MiniMax provider test (skipped because optional runtime dependencies are unavailable locally).

1 similar comment
@kapelame

kapelame commented Aug 5, 2026

Copy link
Copy Markdown

Thanks for the review. I formatted the MiniMax chat provider to satisfy the lint configuration and pushed a new commit. I ran Black, Ruff, isort, and the MiniMax provider test (skipped because optional runtime dependencies are unavailable locally).

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.

2 participants