Skip to content

feat(studio): add MiniMax as an external LLM provider#6867

Open
octo-patch wants to merge 6 commits into
unslothai:mainfrom
octo-patch:octo/minimax-provider
Open

feat(studio): add MiniMax as an external LLM provider#6867
octo-patch wants to merge 6 commits into
unslothai:mainfrom
octo-patch:octo/minimax-provider

Conversation

@octo-patch

@octo-patch octo-patch commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add MiniMax as an external LLM provider in Unsloth Studio with both supported API protocols and regions.

Changes

  • Register minimax in studio/backend/core/inference/providers.py with MiniMax-M3 and MiniMax-M2.7, current context and modality metadata, and supported request capabilities.
  • Add selectable global and China mainland endpoints for the OpenAI-compatible and Anthropic-compatible protocols.
  • Route official Anthropic-compatible base URLs through the existing Messages translator while deriving /v1 internally, so saved base URLs remain the documented /anthropic values.
  • Use the documented catalog authentication for Anthropic-compatible model discovery and send the required Messages version header.
  • Map the Studio thinking control to MiniMax-M3 adaptive and disabled requests while preserving MiniMax-M2.7 always-on thinking.
  • Gate image attachments by the selected model so MiniMax-M2.7 remains text-only.
  • Add request-capture tests for chat and model discovery across all four endpoint combinations.

Testing

  • cd studio/backend && python -m pytest tests/test_minimax_provider.py -q
  • cd studio/backend && python -m pytest tests/test_anthropic_thinking_translation.py -q
  • python -m pytest tests/studio/test_minimax_provider_frontend.py -q
  • python -m ruff check studio/backend/core/inference/providers.py studio/backend/core/inference/external_provider.py studio/backend/tests/test_minimax_provider.py tests/studio/test_minimax_provider_frontend.py
  • cd studio/frontend && npm run typecheck
  • cd studio/frontend && npm run build

@octo-patch octo-patch requested a review from danielhanchen as a code owner July 4, 2026 08:43
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the MiniMax inference provider, updating both the provider registry and the test suite. The review feedback suggests adding the China mainland base URL to the provider notes for consistency and including MiniMax in the vision test parameters to ensure its vision capabilities are properly covered.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

"supports_tool_calling": True,
"auth_header": "Authorization",
"auth_prefix": "Bearer ",
"notes": "OpenAI-compatible API. API key from platform.minimax.io. MiniMax-M3 has a 1M-token context window and image input.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other China-based providers (like Kimi and Qwen), it is highly beneficial to mention the China mainland base URL (https://api.minimaxi.com/v1) in the notes field.

Suggested change
"notes": "OpenAI-compatible API. API key from platform.minimax.io. MiniMax-M3 has a 1M-token context window and image input.",
"notes": "OpenAI-compatible API. API key from platform.minimax.io. MiniMax-M3 has a 1M-token context window and image input. China mainland: override base URL to https://api.minimaxi.com/v1",

"huggingface": ("HUGGINGFACE_API_KEY", "meta-llama/Llama-3.3-70B-Instruct"),
"kimi": ("MOONSHOT_API_KEY", "moonshot-v1-8k"),
"qwen": ("DASHSCOPE_API_KEY", "qwen-turbo"),
"minimax": ("MINIMAX_API_KEY", "MiniMax-M3"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the minimax provider supports vision (supports_vision: True in the registry), it should also be included in the _VISION_PARAMS list (around line 480) so that its vision capabilities are covered by the integration tests.

@octo-patch

Copy link
Copy Markdown
Contributor Author

Updated the MiniMax registry metadata with both current default model IDs, the mainland base URL, and complete multimodal details, and added metadata assertions plus vision coverage. I ran the repository formatter, Ruff, direct registry assertions, and test collection (47 tests collected; live network cases skipped locally without credentials).

@octo-patch

Copy link
Copy Markdown
Contributor Author

Updated the MiniMax integration to support selectable global and China mainland OpenAI-compatible and Anthropic-compatible endpoints, including internal /v1/messages routing and MiniMax-M3/MiniMax-M2.7 thinking behavior. Added request-capture coverage for all four chat and model-discovery paths; focused pytest, Ruff, TypeScript typecheck, and the production frontend build pass.

@octo-patch

Copy link
Copy Markdown
Contributor Author

Updated MiniMax model discovery to use the documented catalog authentication, added the required Messages header, and made vision gating follow the selected model. I ran the focused backend tests, Ruff, the frontend capability test, TypeScript typecheck, and the production frontend build.

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