Skip to content

Upgrade MiniMax provider to M2.5/M2.7 with OpenAI-compatible API#373

Open
octo-patch wants to merge 1 commit intoTaskingAI:masterfrom
octo-patch:feature/upgrade-minimax-m2.5-m2.7
Open

Upgrade MiniMax provider to M2.5/M2.7 with OpenAI-compatible API#373
octo-patch wants to merge 1 commit intoTaskingAI:masterfrom
octo-patch:feature/upgrade-minimax-m2.5-m2.7

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Upgrade the MiniMax provider from legacy ABAB models and the deprecated api.minimax.chat/v1/text/chatcompletion_v2 endpoint to the modern OpenAI-compatible api.minimax.io/v1/chat/completions endpoint, adding support for the latest M2.5 and M2.7 model series.

Changes

  • API Endpoint Migration: Updated from legacy api.minimax.chat/v1/text/chatcompletion_v2 to OpenAI-compatible api.minimax.io/v1/chat/completions
  • New Models: Added MiniMax-M2.5 (204K context), MiniMax-M2.5-highspeed, MiniMax-M2.7 (1M context), MiniMax-M2.7-highspeed with full model definitions, pricing, and config schemas
  • Temperature Clamping: MiniMax requires temperature in (0, 1]; added clamping to prevent API errors
  • Token Usage: Added extract_usage_data() and stream_extract_usage_data() for proper token counting; enabled return_token_usage and return_stream_token_usage in provider config
  • Function Call Index: Fixed streaming function call index parsing to use tool_call.index (OpenAI format) instead of hardcoded 0
  • Legacy Models: Marked all ABAB 5.5/6/6.5 models as deprecated (kept for backward compatibility)
  • i18n: Updated English translations for all new models and deprecated model descriptions
  • Tests: Added 75 tests (72 unit + 3 integration) covering endpoint URL, temperature clamping, payload construction, response parsing, streaming, YAML validation, and live API calls

Model Specifications

Model Context Window Output Limit Vision Function Call
MiniMax-M2.7 1,048,576 131,072
MiniMax-M2.7-highspeed 1,048,576 131,072
MiniMax-M2.5 204,800 131,072
MiniMax-M2.5-highspeed 204,800 131,072

Test Plan

  • All 75 unit tests pass locally
  • Integration tests verified against live MiniMax API (M2.5 + M2.7, both streaming and non-streaming)
  • Verify backward compatibility with existing ABAB model configurations
  • Test through the TaskingAI web UI with MiniMax API key

Files Changed (14)

  • inference/providers/minimax/chat_completion.py - Upgraded endpoint, added temp clamping + usage extraction
  • inference/providers/minimax/resources/provider.yml - Updated default model + token usage config
  • inference/providers/minimax/resources/i18n/en.yml - New model translations
  • inference/providers/minimax/resources/models/MiniMax-M2.5.yml - New model definition
  • inference/providers/minimax/resources/models/MiniMax-M2.5-highspeed.yml - New model definition
  • inference/providers/minimax/resources/models/MiniMax-M2.7.yml - New model definition
  • inference/providers/minimax/resources/models/MiniMax-M2.7-highspeed.yml - New model definition
  • inference/providers/minimax/resources/models/abab*.yml (6 files) - Marked deprecated
  • inference/test/test_minimax_provider.py - 75 new tests

- Migrate API endpoint from legacy api.minimax.chat/v1/text/chatcompletion_v2
  to OpenAI-compatible api.minimax.io/v1/chat/completions
- Add MiniMax-M2.5 (204K context), MiniMax-M2.5-highspeed,
  MiniMax-M2.7 (1M context), MiniMax-M2.7-highspeed model definitions
- Add temperature clamping to (0, 1] range per MiniMax API requirements
- Add token usage extraction (both streaming and non-streaming)
- Fix streaming function call index parsing (use tool_call.index)
- Mark legacy ABAB 5.5/6/6.5 models as deprecated
- Enable return_token_usage and return_stream_token_usage in provider config
- Add 75 tests (72 unit + 3 integration) covering all changes
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