Skip to content

feat: add MiniMax as alternative LLM provider#5

Open
octo-patch wants to merge 1 commit into
liyupi:masterfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as alternative LLM provider#5
octo-patch wants to merge 1 commit into
liyupi:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

Add MiniMax (M2.7 / M2.7-highspeed, 204K context) as an alternative LLM provider alongside the existing Qwen (DashScope) integration.

  • Uses MiniMax OpenAI-compatible API via langchain4j-open-ai, so no custom SDK needed
  • Provider selection via ai.provider property in application.yml (qwen default, minimax available)
  • @ConditionalOnProperty + @primary beans ensure clean provider switching without conflicts
  • Existing Qwen behavior is 100% unchanged when ai.provider=qwen (default)

Files changed (9 files, 352 additions)

File Change
pom.xml Add langchain4j-open-ai 1.1.0 dependency
MiniMaxChatModelConfig.java New config: ChatModel + StreamingChatModel via OpenAI-compat API
QwenChatModelConfig.java Add @ConditionalOnProperty + @primary
AiCodeHelperServiceFactory.java Switch to type-based @Autowired injection
AiCodeHelper.java Switch to type-based @Autowired injection
application.yml Add ai.provider property + MiniMax config section
README.md Add MiniMax in docs, architecture diagram, and credits
MiniMaxChatModelConfigTest.java 9 unit tests
MiniMaxIntegrationTest.java 3 integration tests (require MINIMAX_API_KEY)

How to use

# application.yml
ai:
  provider: minimax
minimax:
  api-key: your-minimax-api-key
  model-name: MiniMax-M2.7        # or MiniMax-M2.7-highspeed
  base-url: https://api.minimax.io/v1

Test plan

  • 9 unit tests pass (MiniMaxChatModelConfigTest)
  • 3 integration tests pass with live MiniMax API (MiniMaxIntegrationTest)
  • Project compiles successfully with Java 21 + Maven
  • Verify default ai.provider=qwen still works unchanged
  • Verify ai.provider=minimax routes to MiniMax API

Add MiniMax M2.7/M2.7-highspeed as an alternative LLM provider alongside
the existing Qwen (DashScope) integration. MiniMax is accessed via its
OpenAI-compatible API using langchain4j-open-ai.

Changes:
- Add langchain4j-open-ai dependency for OpenAI-compat API access
- Create MiniMaxChatModelConfig with @ConditionalOnProperty selection
- Add provider selection via ai.provider property (qwen/minimax)
- Update bean injection to type-based for provider-agnostic wiring
- Update application.yml with MiniMax configuration section
- Update README with multi-provider docs and MiniMax references
- Add 9 unit tests + 3 integration tests for MiniMax provider
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