Add MiniMax as first-class chat model provider#1529
Open
octo-patch wants to merge 1 commit intomicrosoft:mainfrom
Open
Add MiniMax as first-class chat model provider#1529octo-patch wants to merge 1 commit intomicrosoft:mainfrom
octo-patch wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add MiniMaxChatTarget for MiniMax AI's OpenAI-compatible chat completions API, supporting M2.7, M2.7-highspeed, M2.5, and M2.5-highspeed models with temperature clamping [0,1], thinking tag stripping, JSON mode, and token usage tracking. - New prompt target: pyrit/prompt_target/minimax/ (MiniMaxChatTarget) - 40 unit tests + 3 integration tests - Environment config in .env_example - Documentation in prompt targets overview
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
MiniMaxChatTargetas a new prompt target for MiniMax AI chat models via OpenAI-compatible API<think>tag stripping for reasoning models, JSON mode, and token usage tracking.env_exampleand documentation in prompt targets overviewDetails
New Files
pyrit/prompt_target/minimax/__init__.py- Package initpyrit/prompt_target/minimax/minimax_chat_target.py- Main implementation (~250 lines)tests/unit/target/test_minimax_chat_target.py- 40 unit teststests/integration/targets/test_minimax_chat_target_integration.py- 3 integration testsModified Files
pyrit/prompt_target/__init__.py- Register MiniMaxChatTarget.env_example- Add MINIMAX_API_KEY, MINIMAX_CHAT_ENDPOINT, MINIMAX_CHAT_MODELdoc/code/targets/0_prompt_targets.md- Add MiniMax to targets tableImplementation Approach
MiniMaxChatTargetextendsPromptChatTargetdirectly (rather thanOpenAITarget) to provide a clean, focused implementation:https://api.minimax.io/v1(OpenAI-compatible)<think>...</think>reasoning tags; these are automatically strippedjson_objectresponse format (falls back fromjson_schemasince MiniMax does not support structured output schemas)MINIMAX_API_KEY(required),MINIMAX_CHAT_ENDPOINT(optional),MINIMAX_CHAT_MODEL(optional)Usage Example
Test Plan