feat: add MiniMax as first-class model provider#1953
Open
octo-patch wants to merge 1 commit intostrands-agents:mainfrom
Open
feat: add MiniMax as first-class model provider#1953octo-patch wants to merge 1 commit intostrands-agents:mainfrom
octo-patch wants to merge 1 commit intostrands-agents:mainfrom
Conversation
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
fab5864 to
b90c805
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds MiniMax as a first-class model provider for the Strands Agents SDK, extending
OpenAIModelto work with MiniMax's OpenAI-compatible API.Changes
src/strands/models/minimax.py—MinimaxModelclass extendingOpenAIModelwith:https://api.minimax.io/v1) andMINIMAX_API_KEYenv var auto-detectiontoolsarrays)structured_outputusingresponse_format: json_objectinstead of beta parse API (MiniMax includes<think>tags that break the beta parser)_clean_response_contentto strip<think>tags and markdown code blocks from structured outputsrc/strands/models/__init__.py— Lazy-loading entry forMinimaxModelpyproject.toml—minimaxoptional dependency (openai>=1.68.0,<3.0.0), added toallextrastests/strands/models/test_minimax.py— 33 unit tests covering init, config, format_request, stream, structured_output, and response cleaningtests_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 testsSupported Models
MiniMax-M2.7(latest)MiniMax-M2.5-highspeed(fast inference, 204K context)Design Decisions
OpenAIModelsince MiniMax provides an OpenAI-compatible chat completions endpointresponse_format: json_objectfor structured output because MiniMax's reasoning models emit<think>tags that interfere with OpenAI's beta parse API<think>tags and markdown code blocks from structured output responsestoolslist from requests (MiniMax API rejects empty arrays)Test Plan
pytest tests/strands/models/test_minimax.py)pytest tests_integ/models/test_model_minimax.py)Related