Skip to content

feat: add MiniMax as first-class LLM provider (M3 default)#300

Open
octo-patch wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as first-class LLM provider (M3 default)#300
octo-patch wants to merge 2 commits into
algorithmicsuperintelligence:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Mar 26, 2026

Summary

  • Add MiniMax AI as a first-class LLM provider alongside OpenAI, Cerebras, and Azure OpenAI
  • MiniMax is detected via MINIMAX_API_KEY env var and uses its OpenAI-compatible API at https://api.minimax.io/v1
  • Default model is MiniMax-M3 (512K context, max output 128K, image input support); MiniMax-M2.7 and MiniMax-M2.7-highspeed remain available as alternatives
  • Temperature values are auto-clamped to MiniMax's valid range (0, 1] to prevent API errors

Changes

Provider Detection (optillm/server.py)

  • Added MINIMAX_API_KEY check in get_config() between Cerebras and OpenAI in priority order
  • Creates an OpenAI client with MiniMax base URL (https://api.minimax.io/v1) by default
  • Supports custom base_url override via --base-url flag
  • Properly passes SSL/httpx configuration to the client

Temperature Clamping (optillm/server.py)

  • Clamps temperature to 0.01 when <= 0 (MiniMax requires strictly positive temperature)
  • Clamps temperature to 1.0 when > 1.0
  • Only applies when MINIMAX_API_KEY is set; other providers are unaffected

Documentation (README.md)

  • Added MiniMax row to the provider table with API key, link, and notes (M3 listed as default; M2.7 and M2.7-highspeed as alternatives)

Tests

  • 17 unit tests (tests/test_minimax_provider.py): provider detection, base URL, SSL, priority ordering, temperature clamping
  • 3 integration tests (tests/test_minimax_integration.py): basic completion, temperature boundary, streaming (requires live API key; default model is MiniMax-M3)

Provider Priority Order

  1. OPTILLM_API_KEY - Local inference
  2. CEREBRAS_API_KEY - Cerebras
  3. MINIMAX_API_KEY - MiniMax (new)
  4. OPENAI_API_KEY - OpenAI
  5. AZURE_OPENAI_API_KEY - Azure OpenAI
  6. LiteLLM fallback

Usage

export MINIMAX_API_KEY="your-key"
optillm

# Then use with any approach:
# model="moa-MiniMax-M3" or model="bon-MiniMax-M3"
# Older variants still work: model="moa-MiniMax-M2.7"

Supported Models

Model Notes
MiniMax-M3 (default) 512K context, up to 128K output, image input
MiniMax-M2.7 Previous generation
MiniMax-M2.7-highspeed Previous generation, low-latency variant

Test plan

  • All 17 unit tests pass
  • All 3 integration tests pass with live MiniMax API (M3)
  • Verify no regressions in existing provider detection (OpenAI, Cerebras, Azure)

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

octo-patch and others added 2 commits March 26, 2026 12:00
Add MiniMax AI (https://www.minimax.io/) as a directly supported LLM provider
alongside OpenAI, Cerebras, and Azure OpenAI. MiniMax's API is OpenAI-compatible,
so this uses the OpenAI SDK with MiniMax's base URL for seamless integration.

Changes:
- Add MINIMAX_API_KEY detection in get_config() with auto base URL
- Add temperature clamping for MiniMax: values are clamped to (0, 1]
- Update README provider table with MiniMax documentation
- Add 17 unit tests covering provider detection, priority, and temp clamping
- Add 3 integration tests for live API verification
- Update README to list MiniMax-M3 as default (512K context, max output 128K)
- Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed as alternatives
- Update integration tests to use MiniMax-M3
@octo-patch octo-patch changed the title feat: add MiniMax as first-class LLM provider feat: add MiniMax as first-class LLM provider (M3 default) Jun 7, 2026
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.

2 participants