feat: add MiniMax (MiniMax) provider#626
Conversation
Greptile SummaryThis PR adds MiniMax as a new OpenAI-compatible LLM provider. The main changes are:
Confidence Score: 4/5The MiniMax provider wiring is mostly localized, but the global environment key path needs attention before merge. The changed provider implementation and tests are focused, and the main remaining risk is a concrete configuration validation gap for MiniMax users who rely on the documented environment variable. codebase_rag/constants.py and the configuration validation path that handles provider-level API key environment variables.
What T-Rex did
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
codebase_rag/constants.py:145
**Wire global key validation**
`MINIMAX_API_KEY` is added as a supported fallback here and in `MINIMAX_NO_KEY`, but `ModelConfig.validate_api_key()` only checks provider-level env keys for Anthropic and Azure before rejecting configs with no role-specific `api_key`. When a user sets only `MINIMAX_API_KEY`, CLI startup fails in `validate_models_early()` before `MiniMaxProvider` can resolve the key.
### Agentic Framework
-... ([source](https://app.greptile.com/graph-code/github/vitali87/code-graph-rag/-/custom-context?memory=d4240b05-b763-467a-a6bf-94f73e8b6859))
Reviews (1): Last reviewed commit: "feat: add MiniMax (MiniMax) provider" | Re-trigger Greptile |
| ENV_AZURE_API_KEY = "AZURE_API_KEY" | ||
| ENV_AZURE_ENDPOINT = "AZURE_OPENAI_ENDPOINT" | ||
| ENV_AZURE_API_VERSION = "AZURE_API_VERSION" | ||
| ENV_MINIMAX_API_KEY = "MINIMAX_API_KEY" |
There was a problem hiding this comment.
Wire global key validation
MINIMAX_API_KEY is added as a supported fallback here and in MINIMAX_NO_KEY, but ModelConfig.validate_api_key() only checks provider-level env keys for Anthropic and Azure before rejecting configs with no role-specific api_key. When a user sets only MINIMAX_API_KEY, CLI startup fails in validate_models_early() before MiniMaxProvider can resolve the key.
Rule Used: ## Technical Requirements
Agentic Framework
-... (source)
Artifacts
Repro: focused MiniMax global API key validation harness
- Contains supporting evidence from the run (text/x-python; charset=utf-8).
Stack trace captured during the T-Rex run
- Keeps the raw stack trace available without making the summary code-heavy.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: codebase_rag/constants.py
Line: 145
Comment:
**Wire global key validation**
`MINIMAX_API_KEY` is added as a supported fallback here and in `MINIMAX_NO_KEY`, but `ModelConfig.validate_api_key()` only checks provider-level env keys for Anthropic and Azure before rejecting configs with no role-specific `api_key`. When a user sets only `MINIMAX_API_KEY`, CLI startup fails in `validate_models_early()` before `MiniMaxProvider` can resolve the key.
**Rule Used:** ## Technical Requirements
### Agentic Framework
-... ([source](https://app.greptile.com/graph-code/github/vitali87/code-graph-rag/-/custom-context?memory=d4240b05-b763-467a-a6bf-94f73e8b6859))
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Code Review
This pull request introduces support for MiniMax as a new model provider. It adds the MiniMax provider class, registers it in the provider registry, defines necessary constants and exceptions, includes comprehensive unit tests, and updates the configuration documentation. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
hey @octo-patch thanks for the PR. Please clear the Greptile comment and re-trigger it. I will review only when it reaches 5/5. Thanks. |
Summary
Add MiniMax as a new LLM provider, compatible with the existing provider architecture.
Changes
MiniMaxProviderclass inproviders/base.py(modeled afterOllamaProvider, usesOpenAIChatModel+PydanticOpenAIProviderwith MiniMax OpenAI-compatible endpoint)Provider.MINIMAXenum value inconstants.pyMINIMAX_DEFAULT_ENDPOINTandENV_MINIMAX_API_KEYconstantsMINIMAX_NO_KEYerror message inexceptions.pyMiniMaxProviderinPROVIDER_REGISTRYtest_provider_classes.py(configuration, validation, model creation, env key resolution, registry integration)docs/getting-started/configuration.mdTesting