Skip to content

feat: add MiniMax as first-class model provider#1953

Open
octo-patch wants to merge 1 commit intostrands-agents:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as first-class model provider#1953
octo-patch wants to merge 1 commit intostrands-agents:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link

@octo-patch octo-patch commented Mar 21, 2026

Summary

Adds MiniMax as a first-class model provider for the Strands Agents SDK, extending OpenAIModel to work with MiniMax's OpenAI-compatible API.

Changes

  • src/strands/models/minimax.pyMinimaxModel class extending OpenAIModel with:
    • Default MiniMax API base URL (https://api.minimax.io/v1) and MINIMAX_API_KEY env var auto-detection
    • Empty tools list removal (MiniMax rejects empty tools arrays)
    • Custom structured_output using response_format: json_object instead of beta parse API (MiniMax includes <think> tags that break the beta parser)
    • _clean_response_content to strip <think> tags and markdown code blocks from structured output
  • src/strands/models/__init__.py — Lazy-loading entry for MinimaxModel
  • pyproject.tomlminimax optional dependency (openai>=1.68.0,<3.0.0), added to all extras
  • tests/strands/models/test_minimax.py — 33 unit tests covering init, config, format_request, stream, structured_output, and response cleaning
  • tests_integ/models/test_model_minimax.py — 3 integration tests (sync invoke, async invoke, structured output)
  • tests_integ/models/providers.py — MiniMax provider registration for cross-provider integration tests

Supported Models

  • MiniMax-M2.7 (latest)
  • MiniMax-M2.5-highspeed (fast inference, 204K context)

Design Decisions

  • Inherits from OpenAIModel since MiniMax provides an OpenAI-compatible chat completions endpoint
  • Uses response_format: json_object for structured output because MiniMax's reasoning models emit <think> tags that interfere with OpenAI's beta parse API
  • Strips <think> tags and markdown code blocks from structured output responses
  • Removes empty tools list from requests (MiniMax API rejects empty arrays)

Test Plan

  • 33 unit tests passing (pytest tests/strands/models/test_minimax.py)
  • 3 integration tests passing with live MiniMax API (pytest tests_integ/models/test_model_minimax.py)
  • CI pipeline validation

Related

Add MinimaxModel extending OpenAIModel for MiniMax's OpenAI-compatible
API with MiniMax-M2.7 and MiniMax-M2.5-highspeed model support.

Key features:
- Auto-configures MiniMax API base URL and MINIMAX_API_KEY env var
- Handles <think> tag stripping and markdown code block cleanup for
  structured output
- Removes empty tools lists (not accepted by MiniMax API)
- 33 unit tests and 3 integration tests
@octo-patch octo-patch force-pushed the feature/add-minimax-provider branch from fab5864 to b90c805 Compare March 21, 2026 06:49
@github-actions github-actions bot added size/l and removed size/l labels Mar 21, 2026
@octo-patch octo-patch changed the title feat: add MiniMax as built-in model provider feat: add MiniMax as first-class model provider Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant