Skip to content

Add MiniMax as alternative LLM provider for Moirai Agent#254

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

Add MiniMax as alternative LLM provider for Moirai Agent#254
octo-patch wants to merge 1 commit into
SalesforceAIResearch:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as an alternative LLM provider for the ctx_forecast Moirai Agent, alongside the existing OpenAI backend.

What changed

  • New llm_provider.py — provider abstraction that translates between OpenAI Responses API and Chat Completions API. Includes OpenAIResponsesProvider and ChatCompletionsProvider.
  • mcp_client.py — replaced direct OpenAI() client with create_llm_provider(config) factory. Existing OpenAI behavior fully preserved.
  • config.py — added "provider" field documentation and MiniMax config example.
  • README.md — documented MiniMax setup with model table.

Models supported

Model Context Notes
MiniMax-M2.7 1M tokens Latest, recommended
MiniMax-M2.7-highspeed 1M tokens Faster variant
MiniMax-M2.5 204K tokens Previous generation
MiniMax-M2.5-highspeed 204K tokens Fast

Test plan

  • 30 unit tests covering factory, message/tool/response conversion, parameter handling, dataclass behavior
  • 4 integration tests against live MiniMax API (basic completion, output iteration, tool calling, multi-turn with tool results)
  • All 34 tests pass

Introduce a provider abstraction layer (llm_provider.py) that translates
between OpenAI's Responses API and the standard Chat Completions API,
enabling MiniMax (M2.7/M2.5) and other OpenAI-compatible providers to
power the ctx_forecast MCP agent alongside the existing OpenAI backend.

Changes:
- New llm_provider.py with OpenAIResponsesProvider and ChatCompletionsProvider
- MCPClient now uses create_llm_provider() factory instead of direct OpenAI SDK
- config.py updated with provider selection docs and MiniMax config example
- README.md documents MiniMax setup with model table
- 30 unit tests + 4 integration tests (text, tool calling, multi-turn)
@salesforce-cla
Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @Octocat-dev to sign the Salesforce Inc. Contributor License Agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant