Skip to content

Add MiniMax as a first-class API model provider - #1968

Open
octo-patch wants to merge 1 commit into
dottxt-ai:mainfrom
octo-patch:octo/20260729-provider-add-recvq9fGG4OBpf
Open

Add MiniMax as a first-class API model provider#1968
octo-patch wants to merge 1 commit into
dottxt-ai:mainfrom
octo-patch:octo/20260729-provider-add-recvq9fGG4OBpf

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Outlines has first-class API model adapters but no MiniMax adapter.

Summary

Adds MiniMax as a first-class API model provider. MiniMax exposes an
OpenAI-compatible chat completions API, so MiniMax / AsyncMiniMax wrap the
openai SDK, mirroring the existing SGLang and OpenAI integrations.

Changes

  • src/outlines/models/minimax.py: new MiniMax, AsyncMiniMax,
    from_minimax, and MiniMaxTypeAdapter.
    • MiniMaxTypeAdapter formats text, image and video inputs into the content
      parts expected by the OpenAI-compatible endpoint, and reuses the OpenAI
      response_format handling for JSON schema / JSON mode structured outputs.
    • MINIMAX_BASE_URLS exposes both regional OpenAI-compatible endpoints
      (global https://api.minimax.io/v1 and cn https://api.minimaxi.com/v1)
      so callers select the region on their openai client.
  • src/outlines/models/__init__.py: register MiniMax / AsyncMiniMax /
    from_minimax in the package and the BlackBoxModel / AsyncBlackBoxModel
    unions.
  • src/outlines/exceptions.py: route MiniMax through the OpenAI SDK exception
    map (it uses the openai client), matching vLLM and SGLang.
  • Docstrings and docs document MiniMax-M3 (1,000,000 token context window;
    text, image and video input) and MiniMax-M2.7 (204,800 token context
    window; text input).
  • tests/models/test_minimax.py and
    tests/models/test_minimax_type_adapter.py: unit tests for the model
    wrappers (mocked client) and the type adapter, including image and video
    inputs and structured output formatting.
  • Docs: new docs/features/models/minimax.md, mkdocs nav entry, README API
    support line and the model index list.

Testing

  • ruff check --config=pyproject.toml (repo-pinned ruff 0.9.1) on all changed
    Python files: passes.
  • pytest tests/models/test_minimax.py tests/models/test_minimax_type_adapter.py:
    20 passed.
  • pytest tests/models/test_openai_type_adapter.py tests/models/test_sglang_type_adapter.py:
    passes (regression on the reused OpenAI formatting).

MiniMax exposes an OpenAI-compatible chat completions API. Add MiniMax
and AsyncMiniMax model classes and a from_minimax factory that wrap the
openai SDK, alongside a MiniMaxTypeAdapter that formats text, image and
video inputs and reuses the OpenAI response_format handling.

- Register MiniMax/AsyncMiniMax in the models package and the
  BlackBoxModel / AsyncBlackBoxModel unions.
- Expose both regional OpenAI-compatible endpoints via MINIMAX_BASE_URLS
  (global and cn).
- Normalize MiniMax errors through the OpenAI SDK exception map.
- Document MiniMax-M3 (1,000,000 token context; text, image, video input)
  and MiniMax-M2.7 (204,800 token context; text input).
- Add unit tests for the model wrappers and the type adapter, plus docs.
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