Skip to content

feat(model): add MiniMax OpenAI-compatible provider - #2299

Merged
jujn merged 9 commits into
agentscope-ai:mainfrom
Sparkle6979:fix/2214-minimax-model-adaptation
Jul 28, 2026
Merged

feat(model): add MiniMax OpenAI-compatible provider#2299
jujn merged 9 commits into
agentscope-ai:mainfrom
Sparkle6979:fix/2214-minimax-model-adaptation

Conversation

@Sparkle6979

@Sparkle6979 Sparkle6979 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Closes #2214.

This PR adds MiniMax support to the OpenAI-compatible model extension.

  • Registers a minimax: ModelProvider through Java SPI.
  • Adds MiniMax chat and multi-agent formatters.
  • Sets MiniMax's default base URL to https://api.minimaxi.com/v1.
  • Resolves API keys from ModelCreationContext.apiKey or MINIMAX_API_KEY.
  • Maps deprecated max_tokens usage to max_completion_tokens.
  • Enables reasoning_split by default so MiniMax reasoning fields can be parsed as ThinkingBlock.
  • Disables native structured output by default so AgentScope uses the synthetic-tool fallback path.

Why?

MiniMax provides an OpenAI-compatible Chat Completions endpoint:

https://platform.minimaxi.com/docs/api-reference/text-chat-openai

The MiniMax formatter keeps provider-specific behavior small and explicit. reasoning_split is enabled before the base formatter applies options so users can still override it with GenerateOptions.additionalBodyParam.

nativeStructuredOutput is disabled by default because local real-API probing showed that MiniMax accepts OpenAI-compatible requests, but response_format=json_schema strict=true does not behave as a reliable native structured-output contract across MiniMax-M3 and M2.x models. Users can still opt in through ModelCreationContext.option("nativeStructuredOutput", true) for experimentation.

Tests

  • mvn -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-openai test

Additional local real-API smoke/probe coverage was run against:

  • MiniMax-M3
  • MiniMax-M2.7-highspeed
  • MiniMax-M2
  • MiniMax-M2.7
  • MiniMax-M2.5-highspeed
  • MiniMax-M2.5
  • MiniMax-M2.1-highspeed
  • MiniMax-M2.1

@Sparkle6979
Sparkle6979 force-pushed the fix/2214-minimax-model-adaptation branch from a65d483 to db7ab23 Compare July 19, 2026 06:26
@Sparkle6979 Sparkle6979 changed the title Add MiniMax OpenAI-compatible model provider feat(model): add MiniMax OpenAI-compatible provider Jul 19, 2026
@Sparkle6979
Sparkle6979 marked this pull request as ready for review July 19, 2026 06:27
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/extensions agentscope-extensions (general) labels Jul 19, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

This PR adds MiniMax as an OpenAI-compatible provider with two well-designed formatters (MiniMaxFormatter for single-agent, MiniMaxMultiAgentFormatter for multi-agent) and a ModelProvider SPI implementation. The formatters correctly override applyOptions (for reasoning_split), applyMaxTokens (for MiniMax's max_tokens deprecation), and supportsStrict. The MiniMaxModelProvider follows the established OpenAIModelProvider pattern with proper ModelCreationContext integration and advanced option support. Test coverage is comprehensive — unit tests for both formatters and the provider, plus an E2E smoke test gated by MINIMAX_API_KEY. No logic bugs, concurrency issues, or architectural violations were found.

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

This PR adds MiniMax as an OpenAI-compatible provider with two well-designed formatters (MiniMaxFormatter for single-agent, MiniMaxMultiAgentFormatter for multi-agent) and a ModelProvider SPI implementation. The formatters correctly override applyOptions (for reasoning_split), applyMaxTokens (for MiniMax's max_tokens deprecation), and supportsStrict. The MiniMaxModelProvider follows the established OpenAIModelProvider pattern with proper ModelCreationContext integration and advanced option support. Test coverage is comprehensive — unit tests for both formatters and the provider, plus an E2E smoke test gated by MINIMAX_API_KEY. No logic bugs, concurrency issues, or architectural violations were found.

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR contains 867 lines of changes. Review in progress.


Automated review by github-manager-bot

@AgentScopeJavaBot AgentScopeJavaBot added area/ext/integration External protocols & middleware integrations area/examples agentscope-examples labels Jul 20, 2026
@jujn
jujn merged commit 48a77f1 into agentscope-ai:main Jul 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples agentscope-examples area/ext/integration External protocols & middleware integrations area/extensions agentscope-extensions (general) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: MiniMax Model Adaptation

4 participants