Skip to content

feat: add direct MiniMax provider support#472

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

feat: add direct MiniMax provider support#472
octo-patch wants to merge 1 commit intoCodebuffAI:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link

Summary

Add MiniMax as a direct LLM provider with native API integration, supporting both streaming and non-streaming requests through MiniMax's OpenAI-compatible API.

Supported Models

  • MiniMax-M2.5 - Peak Performance. Ultimate Value. Master the Complex
  • MiniMax-M2.5-highspeed - Same performance, faster and more agile

Both models support 204,800 tokens context window.

Changes

  • New file: web/src/llm-api/minimax.ts - Direct MiniMax API handler (follows existing Fireworks/SiliconFlow pattern)
  • Model config: Add minimax prefix to ALLOWED_MODEL_PREFIXES and MiniMax models to openrouterModels
  • Env schema: Add optional MINIMAX_API_KEY environment variable
  • Request routing: Route minimax/* models directly to MiniMax API (takes priority over Fireworks routing)
  • Error handling: Add MiniMaxError class with proper error propagation
  • Billing: Accurate per-token pricing ($0.30/M input, $1.20/M output, $0.03/M cached input)

Implementation Details

  • Uses MiniMax's OpenAI-compatible endpoint (https://api.minimax.io/v1)
  • Handles MiniMax's temperature constraint: range (0.0, 1.0], defaults to 1.0 (cannot be 0)
  • Follows the exact same architecture as existing direct provider handlers (Fireworks, SiliconFlow, CanopyWave)
  • MiniMax models are checked before Fireworks in the routing chain to avoid conflicts with Fireworks' existing MiniMax model map

API Documentation

- Add MiniMax LLM handler with direct API integration (api.minimax.io/v1)
- Support models: MiniMax-M2.5, MiniMax-M2.5-highspeed
- Add MINIMAX_API_KEY environment variable support
- Add 'minimax' to allowed model prefixes
- Add MiniMax models to openrouter model config
- Add streaming and non-streaming request handling
- Add MiniMax per-token pricing for accurate billing
- Handle MiniMax temperature constraint (0.0, 1.0], default 1.0
- Route minimax/* models directly to MiniMax API before Fireworks fallback
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