feat: add MiniMax M3 as default LLM provider, keep M2.7 - #1191
Open
octo-patch wants to merge 5 commits into
Open
feat: add MiniMax M3 as default LLM provider, keep M2.7#1191octo-patch wants to merge 5 commits into
octo-patch wants to merge 5 commits into
Conversation
- Add MiniMax-M2.5 and MiniMax-M2.5-highspeed to model list (204K context) - Route M2.5 models through OpenAI-compatible client (api.minimax.io/v1) - Add MiniMaxM25 model type enum for proper routing - Add model metadata with API host, token limits, and descriptions - Preserve backward compatibility with existing minimax-abab5-chat - Add 22 unit tests and 5 integration tests - Update README with M2.5 model info
There was a problem hiding this comment.
Pull request overview
Adds support for MiniMax M2.5 models using MiniMax’s OpenAI-compatible /v1/chat/completions endpoint, integrating them into the existing model metadata/routing system.
Changes:
- Added
MiniMax-M2.5andMiniMax-M2.5-highspeedtoONLINE_MODELSandMODEL_METADATA(204,800 token context). - Introduced
ModelType.MiniMaxM25and routed these models throughOpenAIVisionClientusinghttps://api.minimax.io. - Added unit/integration tests plus a README update describing the new MiniMax models.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
modules/presets.py |
Registers the new MiniMax M2.5 models and their metadata (host, token limits, descriptions, model_type). |
modules/models/base_model.py |
Adds MiniMaxM25 to ModelType for metadata-based routing. |
modules/models/models.py |
Routes MiniMaxM25 models through OpenAIVisionClient and reads MINIMAX_API_KEY. |
tests/test_minimax_m25.py |
Adds unit tests for enum presence, metadata entries, host formatting, and routing assertions. |
tests/test_minimax_m25_integration.py |
Adds integration tests that call the MiniMax OpenAI-compatible endpoint directly. |
README.md |
Documents MiniMax M2.5 support in the supported-models table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Integration tests for MiniMax M2.5 provider - requires MINIMAX_API_KEY.""" | ||
|
|
||
| import os | ||
| import json |
Comment on lines
+131
to
+147
| def test_m25_env_key_name(self): | ||
| """MiniMax M2.5 routing should use MINIMAX_API_KEY env variable.""" | ||
| # Verify the env var name used in models.py routing | ||
| import inspect | ||
| from modules.models import models | ||
| source = inspect.getsource(models.get_model) | ||
| assert 'os.environ.get("MINIMAX_API_KEY"' in source | ||
|
|
||
| def test_old_minimax_routing_preserved(self): | ||
| """Old minimax routing code should still exist.""" | ||
| import inspect | ||
| from modules.models import models | ||
| source = inspect.getsource(models.get_model) | ||
| assert "ModelType.Minimax" in source | ||
| assert "MiniMax_Client" in source | ||
|
|
||
|
|
| elif model_type == ModelType.MiniMaxM25: | ||
| logging.info(f"正在加载 MiniMax M2.5 模型: {model_name}") | ||
| from .OpenAIVision import OpenAIVisionClient | ||
| access_key = os.environ.get("MINIMAX_API_KEY", access_key) |
| assert DEFAULT_METADATA["temperature"] == 1.0 | ||
|
|
||
| def test_m25_uses_default_temperature(self): | ||
| """M2.5 models should use default temperature of 1.0.""" |
| """MiniMaxM25 enum value should exist in ModelType.""" | ||
| from modules.models.base_model import ModelType | ||
| assert hasattr(ModelType, "MiniMaxM25") | ||
| assert ModelType.MiniMaxM25.value == 24 |
Comment on lines
+127
to
+130
| from modules.models.base_model import ModelType | ||
| model_type = ModelType.get_type("MiniMax-M2.5") | ||
| assert model_type == ModelType.MiniMaxM25 | ||
|
|
Comment on lines
+4
to
+6
| import json | ||
| import pytest | ||
| from unittest.mock import patch, MagicMock |
- Remove unused imports (json, MagicMock, os, patch) from test files - Replace hard-coded enum value assertion with isinstance check - Replace brittle inspect.getsource() tests with behavioral routing tests - Fix env var override: use os.environ.get(MINIMAX_API_KEY) or access_key to prevent empty string from overriding a valid access_key - Fix temperature test to handle config.py DEFAULT_METADATA merge correctly
Contributor
Author
|
Thanks for the thorough review! Addressed all feedback:
Please take another look! |
Add MiniMax's latest M2.7 flagship models alongside existing M2.5 models. M2.7 offers enhanced reasoning capabilities via the same OpenAI-compatible API. Listed before M2.5 as the recommended default. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
Add MiniMax's latest M2.7 flagship models alongside existing M2.5 models. M2.7 offers enhanced reasoning capabilities via the same OpenAI-compatible API. Listed before M2.5 as the recommended default. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://api.minimax.io/v1viaOpenAIVisionClientminimax-abab5-chatare removedChanges
modules/presets.py:MiniMax-M2.5/MiniMax-M2.5-highspeedwithMiniMax-M3/MiniMax-M3-highspeedat the top ofONLINE_MODELSminimax-abab5-chatentry fromMODEL_METADATAtests/test_minimax_provider.py: 23 unit tests for type detection, metadata, API host, defaults, and removal of M2.5/abab5tests/test_minimax_integration.py: 10 integration tests for M2.7 and M3 chat completions, streaming, system messages, and usage infoTest Plan
api.minimax.iominimax-abab5-chatandMiniMax-M2.5removedAPI Reference