Skip to content

feat: add MiniMax as first-class LLM provider - #49

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

feat: add MiniMax as first-class LLM provider#49
octo-patch wants to merge 1 commit into
ricklamers:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

Adds MiniMax AI as a new first-class LLM provider alongside OpenAI, Azure, Groq, Ollama, and Mistral.

MiniMax offers OpenAI-compatible API endpoints, so this integration reuses LangChain's ChatOpenAI with a custom base URL (https://api.minimax.io/v1), following the same pattern as the existing Ollama provider.

Changes

  • shell_ai/main.py: Add minimax to APIProvider enum, MiniMax config variables (MINIMAX_API_KEY, MINIMAX_MODEL, MINIMAX_API_BASE), API key validation, and provider initialization with temperature clamping (min 0.01)
  • README.md: Add MiniMax environment variables, config example, and usage instructions
  • tests/test_minimax_provider.py: 21 unit tests covering enum registration, config defaults, temperature clamping, provider validation, and API key detection
  • tests/test_minimax_integration.py: 3 integration tests verifying live API calls with MiniMax-M2.5 and MiniMax-M2.5-highspeed models

Configuration

export SHAI_API_PROVIDER=minimax
export MINIMAX_API_KEY=your_api_key_here

Or via ~/.config/shell-ai/config.json:

{
   "SHAI_API_PROVIDER": "minimax",
   "MINIMAX_API_KEY": "your_api_key_here",
   "MINIMAX_MODEL": "MiniMax-M2.5"
}

Available models: MiniMax-M2.5 (default, 1M context), MiniMax-M2.5-highspeed (204K context).

Test plan

  • 21 unit tests pass (pytest tests/test_minimax_provider.py)
  • 3 integration tests pass with live MiniMax API (MINIMAX_API_KEY=... pytest tests/test_minimax_integration.py)
  • Manual: SHAI_API_PROVIDER=minimax MINIMAX_API_KEY=... shai list files in current directory

No new dependencies required — MiniMax uses the existing langchain-openai package.

Add MiniMax AI as a new API provider option alongside OpenAI, Azure,
Groq, Ollama, and Mistral. MiniMax uses the OpenAI-compatible API
via LangChain's ChatOpenAI with custom base URL.

Changes:
- Add 'minimax' to APIProvider enum
- Add MINIMAX_API_KEY, MINIMAX_MODEL, MINIMAX_API_BASE config vars
- Add temperature clamping (min 0.01) for MiniMax compatibility
- Add API key validation for minimax provider
- Update README with MiniMax config docs and usage examples
- Add 21 unit tests and 3 integration tests

Default model: MiniMax-M2.5 (1M context)
Also available: MiniMax-M2.5-highspeed (204K context)
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