mirror of
https://github.com/csunny/DB-GPT.git
synced 2026-07-17 10:16:49 +00:00
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
This commit is contained in:
committed by
copilot-swe-agent[bot]
parent
9def9feb43
commit
1915b332ed
@@ -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,
|
||||
|
||||
@@ -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
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user