feat: add MiniMax as first-class LLM provider#421
Open
octo-patch wants to merge 1 commit intoaliasrobotics:mainfrom
Open
feat: add MiniMax as first-class LLM provider#421octo-patch wants to merge 1 commit intoaliasrobotics:mainfrom
octo-patch wants to merge 1 commit intoaliasrobotics:mainfrom
Conversation
Add MiniMaxProvider with built-in support for MiniMax's OpenAI-compatible API (MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.5-highspeed models). Changes: - Add MiniMaxProvider class implementing ModelProvider interface - Add MiniMax model routing in OpenAIChatCompletionsModel for litellm - Export MiniMaxProvider from agents __init__.py - Add provider documentation (docs/providers/minimax.md) - Add usage example (examples/model_providers/minimax_example.py) - Add MiniMax to README provider list - Add 18 unit tests and 3 integration tests
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
This PR adds MiniMax as a built-in LLM provider for CAI, enabling users to leverage MiniMax's large language models (MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.5-highspeed) via an OpenAI-compatible API.
Changes
MiniMaxProvider(src/cai/sdk/agents/models/minimax_provider.py): NewModelProviderimplementation that createsOpenAIChatCompletionsModelinstances configured for MiniMax's API. ReadsMINIMAX_API_KEYfrom environment by default, supports custom API key, base URL, or pre-configuredAsyncOpenAIclient.src/cai/sdk/agents/models/openai_chatcompletions.py): Added MiniMax detection in_fetch_responseto correctly route requests through litellm with properapi_baseandcustom_llm_providersettings.src/cai/sdk/agents/__init__.py):MiniMaxProvideris exported from the agents package.docs/providers/minimax.md): Setup guide with three usage patterns (MiniMaxProvider, environment variables with LiteLLM, direct model on Agent).examples/model_providers/minimax_example.py): Working example demonstrating MiniMax-M2.7 and MiniMax-M2.5-highspeed usage.Tests
tests/core/test_minimax_provider.py): Cover initialization, API key handling, env var detection, model resolution, lazy client loading, ModelProvider interface compliance, and Runner integration.tests/integration/test_minimax_integration.py): Validate real API calls to MiniMax-M2.7, MiniMax-M2.5, and MiniMax-M2.5-highspeed (requireMINIMAX_API_KEY).Available Models
MiniMax-M2.7MiniMax-M2.5MiniMax-M2.5-highspeedUsage
Test Plan