From 1915b332ed705498eb2758a619812e2ca9c751ce Mon Sep 17 00:00:00 2001 From: Octopus Date: Wed, 18 Mar 2026 13:14:28 -0500 Subject: [PATCH] feat: upgrade MiniMax default model to M2.7 - Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list - Set MiniMax-M2.7 as default model - Keep all previous models (M2.5, M2.5-highspeed) as alternatives - Add M2.7 pattern to web UI icon matching - Add unit tests for model registration and defaults --- .../src/dbgpt/model/proxy/llms/minimax.py | 24 ++++- .../src/dbgpt/model/proxy/tests/__init__.py | 0 .../dbgpt/model/proxy/tests/test_minimax.py | 95 +++++++++++++++++++ web/utils/constants.ts | 2 +- 4 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 packages/dbgpt-core/src/dbgpt/model/proxy/tests/__init__.py create mode 100644 packages/dbgpt-core/src/dbgpt/model/proxy/tests/test_minimax.py diff --git a/packages/dbgpt-core/src/dbgpt/model/proxy/llms/minimax.py b/packages/dbgpt-core/src/dbgpt/model/proxy/llms/minimax.py index 1537e22c4..c9696aef5 100644 --- a/packages/dbgpt-core/src/dbgpt/model/proxy/llms/minimax.py +++ b/packages/dbgpt-core/src/dbgpt/model/proxy/llms/minimax.py @@ -24,7 +24,7 @@ if TYPE_CHECKING: ClientType = Union[AsyncAzureOpenAI, AsyncOpenAI] -_DEFAULT_MODEL = "MiniMax-M2.5" +_DEFAULT_MODEL = "MiniMax-M2.7" @auto_register_resource( @@ -160,6 +160,28 @@ class MiniMaxLLMClient(OpenAILLMClient): register_proxy_model_adapter( MiniMaxLLMClient, supported_models=[ + ModelMetadata( + model="MiniMax-M2.7", + context_length=204800, + max_output_length=192000, + description=( + "MiniMax-M2.7 by MiniMax. Latest flagship model with enhanced " + "reasoning and coding." + ), + link="https://platform.minimax.io/docs/api-reference/text-openai-api", + function_calling=True, + ), + ModelMetadata( + model="MiniMax-M2.7-highspeed", + context_length=204800, + max_output_length=192000, + description=( + "MiniMax-M2.7-highspeed by MiniMax. High-speed version of M2.7 " + "for low-latency scenarios." + ), + link="https://platform.minimax.io/docs/api-reference/text-openai-api", + function_calling=True, + ), ModelMetadata( model="MiniMax-M2.5", context_length=204800, diff --git a/packages/dbgpt-core/src/dbgpt/model/proxy/tests/__init__.py b/packages/dbgpt-core/src/dbgpt/model/proxy/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/packages/dbgpt-core/src/dbgpt/model/proxy/tests/test_minimax.py b/packages/dbgpt-core/src/dbgpt/model/proxy/tests/test_minimax.py new file mode 100644 index 000000000..8dd5b6ea3 --- /dev/null +++ b/packages/dbgpt-core/src/dbgpt/model/proxy/tests/test_minimax.py @@ -0,0 +1,95 @@ +"""Tests for MiniMax proxy LLM client.""" + +import os +from unittest.mock import patch + +import pytest + +from dbgpt.model.proxy.llms.minimax import ( + MiniMaxDeployModelParameters, + MiniMaxLLMClient, + _DEFAULT_MODEL, +) + + +class TestMiniMaxDefaults: + """Test MiniMax default model configuration.""" + + def test_default_model_is_m27(self): + assert _DEFAULT_MODEL == "MiniMax-M2.7" + + @patch.dict(os.environ, {"MINIMAX_API_KEY": "test-key"}) + def test_client_default_model(self): + client = MiniMaxLLMClient() + assert client.default_model == "MiniMax-M2.7" + + @patch.dict(os.environ, {"MINIMAX_API_KEY": "test-key"}) + def test_client_custom_model(self): + client = MiniMaxLLMClient(model="MiniMax-M2.5") + assert client.default_model == "MiniMax-M2.5" + + def test_deploy_params_provider(self): + assert MiniMaxDeployModelParameters.provider == "proxy/minimax" + + +class TestMiniMaxModelList: + """Test MiniMax model registration.""" + + def test_model_list_contains_m27(self): + # Import triggers registration + from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811 + from dbgpt.model.adapter.base import get_model_adapter + + adapter = get_model_adapter("proxy/minimax", "MiniMax-M2.7") + assert adapter is not None + + def test_model_list_contains_m27_highspeed(self): + from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811 + from dbgpt.model.adapter.base import get_model_adapter + + adapter = get_model_adapter("proxy/minimax", "MiniMax-M2.7-highspeed") + assert adapter is not None + + def test_model_list_contains_m25(self): + from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811 + from dbgpt.model.adapter.base import get_model_adapter + + adapter = get_model_adapter("proxy/minimax", "MiniMax-M2.5") + assert adapter is not None + + def test_model_list_contains_m25_highspeed(self): + from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811 + from dbgpt.model.adapter.base import get_model_adapter + + adapter = get_model_adapter("proxy/minimax", "MiniMax-M2.5-highspeed") + assert adapter is not None + + +class TestMiniMaxTemperatureClamping: + """Test temperature clamping behavior.""" + + @patch.dict(os.environ, {"MINIMAX_API_KEY": "test-key"}) + def test_valid_temperature_passthrough(self): + from dbgpt.core import ModelMessage, ModelRequest + + client = MiniMaxLLMClient() + request = ModelRequest( + model="MiniMax-M2.7", + messages=[ModelMessage(role="user", content="hi")], + temperature=0.5, + ) + payload = client._build_request(request) + assert payload["temperature"] == 0.5 + + @patch.dict(os.environ, {"MINIMAX_API_KEY": "test-key"}) + def test_high_temperature_clamped(self): + from dbgpt.core import ModelMessage, ModelRequest + + client = MiniMaxLLMClient() + request = ModelRequest( + model="MiniMax-M2.7", + messages=[ModelMessage(role="user", content="hi")], + temperature=2.0, + ) + payload = client._build_request(request) + assert payload["temperature"] == 1.0 diff --git a/web/utils/constants.ts b/web/utils/constants.ts index 596660f42..ee0fa9f89 100644 --- a/web/utils/constants.ts +++ b/web/utils/constants.ts @@ -38,7 +38,7 @@ export const MODEL_ICON_INFO: Record = { minimax: { label: 'MiniMax', icon: '/models/minimax.png', - patterns: ['minimax', 'm2.5', 'm2.1', 'm2'], + patterns: ['minimax', 'm2.7', 'm2.5', 'm2.1', 'm2'], }, doubao: { label: 'Doubao',