feat: upgrade MiniMax default model to M2.7 (#2993)

This commit is contained in:
Octopus
2026-03-19 10:45:14 -05:00
committed by GitHub
parent 9def9feb43
commit 91048cae6f
4 changed files with 119 additions and 2 deletions

View File

@@ -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,

View File

@@ -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 (
_DEFAULT_MODEL,
MiniMaxDeployModelParameters,
MiniMaxLLMClient,
)
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.adapter.base import get_model_adapter
from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811
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.adapter.base import get_model_adapter
from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811
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.adapter.base import get_model_adapter
from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811
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.adapter.base import get_model_adapter
from dbgpt.model.proxy.llms.minimax import MiniMaxLLMClient # noqa: F811
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

View File

@@ -38,7 +38,7 @@ export const MODEL_ICON_INFO: Record<string, ModelIconInfo> = {
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',