Skip to content

feat(model): add MiniMax provider with global and China regions - #148

Open
octo-patch wants to merge 2 commits into
jd-opensource:mainfrom
octo-patch:octo/20260730-provider-add-recvqd27EYaFdy
Open

octo-patch wants to merge 2 commits into
jd-opensource:mainfrom
octo-patch:octo/20260730-provider-add-recvqd27EYaFdy

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Add the MiniMax model provider with global and China regions, exposing the current MiniMax-M3 and MiniMax-M2.7 models.

Changes

This adds MiniMax as a first-class built-in model provider, discovered and registered automatically by the existing provider auto-discovery mechanism (no manual registration needed).

  • New provider backend/app/core/model/providers/MiniMax.py: a MiniMaxProvider extending the OpenAI-compatible base. It exposes both regional endpoints and both API protocols:
    • Regions: global (https://api.minimax.io) and China (https://api.minimaxi.com).
    • OpenAI-compatible base URLs: https://api.minimax.io/v1 and https://api.minimaxi.com/v1.
    • Anthropic-compatible base URLs: https://api.minimax.io/anthropic and https://api.minimaxi.com/anthropic.
    • A region credential field selects the endpoint, and a protocol_type field (openai | anthropic) selects which compatible API to use; an optional base_url overrides either.
    • Predefined chat models: MiniMax-M3 (1M context, multimodal input, adaptive thinking) and MiniMax-M2.7 (204K context, always-on thinking).
    • Credential validation and model instance creation honor the resolved region/protocol base URL.
  • Display order backend/app/services/model_provider_service.py: register minimax in BUILTIN_PROVIDER_ORDER so it sorts with the other built-in providers.
  • Tests backend/tests/test_minimax_provider.py: cover provider identity, credential schema, predefined models, region/protocol base-URL resolution for both protocols in both regions, explicit base URL override, unknown-region fallback, and error handling.

The provider is picked up by get_all_provider_instances() / ModelFactory via directory auto-discovery, so no __init__.py registration is required.

Checks

  • ruff check on the changed files — passed.
  • ruff format --check on the changed files — passed.
  • mypy app/core/model/providers/MiniMax.py --ignore-missing-imports — no issues.
  • pytest tests/test_minimax_provider.py — 12 passed.

@octo-patch

Copy link
Copy Markdown
Author

Updated the MiniMax provider to use the canonical global_en/cn_zh region identifiers and expose the complete context, pricing, input modality, and thinking metadata for MiniMax-M3 and MiniMax-M2.7. I ran the 12 provider tests, Ruff check/format, and a targeted mypy check.

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