feat: upgrade MiniMax default model to M3
- Add MiniMax-M3 to model list and set as default - Keep MiniMax-M2.7 and MiniMax-M2.7-highspeed - Remove older models (M2.5/M2.5-highspeed) - Update related tests
This commit is contained in:
parent
d681cfc317
commit
fbfcc1ef80
|
|
@ -6,11 +6,11 @@ LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||||
LLM_MODEL_NAME=qwen-plus
|
LLM_MODEL_NAME=qwen-plus
|
||||||
|
|
||||||
# ===== 使用 MiniMax 模型(可选)=====
|
# ===== 使用 MiniMax 模型(可选)=====
|
||||||
# MiniMax M2.7: 最新旗舰模型,增强推理与编码能力
|
# MiniMax M3: 最新旗舰模型,512K 上下文,128K 最大输出,支持图片输入
|
||||||
# 获取 API Key: https://platform.minimax.io/
|
# 获取 API Key: https://platform.minimax.io/
|
||||||
# LLM_API_KEY=your_minimax_api_key_here
|
# LLM_API_KEY=your_minimax_api_key_here
|
||||||
# LLM_BASE_URL=https://api.minimax.io/v1
|
# LLM_BASE_URL=https://api.minimax.io/v1
|
||||||
# LLM_MODEL_NAME=MiniMax-M2.7
|
# LLM_MODEL_NAME=MiniMax-M3
|
||||||
# 国内用户可使用: LLM_BASE_URL=https://api.minimaxi.com/v1
|
# 国内用户可使用: LLM_BASE_URL=https://api.minimaxi.com/v1
|
||||||
|
|
||||||
# ===== ZEP记忆图谱配置 =====
|
# ===== ZEP记忆图谱配置 =====
|
||||||
|
|
|
||||||
|
|
@ -135,15 +135,14 @@ ZEP_API_KEY=your_zep_api_key
|
||||||
```env
|
```env
|
||||||
LLM_API_KEY=your_minimax_api_key
|
LLM_API_KEY=your_minimax_api_key
|
||||||
LLM_BASE_URL=https://api.minimax.io/v1
|
LLM_BASE_URL=https://api.minimax.io/v1
|
||||||
LLM_MODEL_NAME=MiniMax-M2.7
|
LLM_MODEL_NAME=MiniMax-M3
|
||||||
```
|
```
|
||||||
|
|
||||||
| Model | Description |
|
| Model | Description |
|
||||||
|-------|-------------|
|
|-------|-------------|
|
||||||
| `MiniMax-M2.7` | Latest flagship model with enhanced reasoning and coding |
|
| `MiniMax-M3` | Latest flagship model, 512K context window, up to 128K output, image input support |
|
||||||
|
| `MiniMax-M2.7` | Previous-generation flagship model |
|
||||||
| `MiniMax-M2.7-highspeed` | High-speed version of M2.7 for low-latency scenarios |
|
| `MiniMax-M2.7-highspeed` | High-speed version of M2.7 for low-latency scenarios |
|
||||||
| `MiniMax-M2.5` | Flagship model, 204K context window |
|
|
||||||
| `MiniMax-M2.5-highspeed` | Same performance, faster and more agile |
|
|
||||||
|
|
||||||
For users in China: `LLM_BASE_URL=https://api.minimaxi.com/v1`
|
For users in China: `LLM_BASE_URL=https://api.minimaxi.com/v1`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,15 +135,14 @@ ZEP_API_KEY=your_zep_api_key
|
||||||
```env
|
```env
|
||||||
LLM_API_KEY=your_minimax_api_key
|
LLM_API_KEY=your_minimax_api_key
|
||||||
LLM_BASE_URL=https://api.minimax.io/v1
|
LLM_BASE_URL=https://api.minimax.io/v1
|
||||||
LLM_MODEL_NAME=MiniMax-M2.7
|
LLM_MODEL_NAME=MiniMax-M3
|
||||||
```
|
```
|
||||||
|
|
||||||
| 模型 | 说明 |
|
| 模型 | 说明 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| `MiniMax-M2.7` | 最新旗舰模型,增强推理与编码能力 |
|
| `MiniMax-M3` | 最新旗舰模型,512K 上下文窗口,128K 最大输出,支持图片输入 |
|
||||||
|
| `MiniMax-M2.7` | 上一代旗舰模型 |
|
||||||
| `MiniMax-M2.7-highspeed` | M2.7 高速版,低延迟场景适用 |
|
| `MiniMax-M2.7-highspeed` | M2.7 高速版,低延迟场景适用 |
|
||||||
| `MiniMax-M2.5` | 旗舰模型,204K 上下文窗口 |
|
|
||||||
| `MiniMax-M2.5-highspeed` | 同等性能,更快更敏捷 |
|
|
||||||
|
|
||||||
国内用户可使用:`LLM_BASE_URL=https://api.minimaxi.com/v1`
|
国内用户可使用:`LLM_BASE_URL=https://api.minimaxi.com/v1`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ class LLMClient:
|
||||||
|
|
||||||
response = self.client.chat.completions.create(**kwargs)
|
response = self.client.chat.completions.create(**kwargs)
|
||||||
content = response.choices[0].message.content
|
content = response.choices[0].message.content
|
||||||
# 部分模型(如MiniMax M2.5)会在content中包含<think>思考内容,需要移除
|
# 部分模型(如MiniMax M3 等推理型模型)会在content中包含<think>思考内容,需要移除
|
||||||
content = re.sub(r'<think>[\s\S]*?</think>', '', content).strip()
|
content = re.sub(r'<think>[\s\S]*?</think>', '', content).strip()
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,10 +61,10 @@ def _inject_json_instruction(messages):
|
||||||
|
|
||||||
class TestIsMinimax:
|
class TestIsMinimax:
|
||||||
def test_minimax_model_name(self):
|
def test_minimax_model_name(self):
|
||||||
assert _is_minimax("MiniMax-M2.5", "https://api.openai.com/v1") is True
|
assert _is_minimax("MiniMax-M3", "https://api.openai.com/v1") is True
|
||||||
|
|
||||||
def test_minimax_model_name_lowercase(self):
|
def test_minimax_model_name_lowercase(self):
|
||||||
assert _is_minimax("minimax-m2.5", "https://api.openai.com/v1") is True
|
assert _is_minimax("minimax-m3", "https://api.openai.com/v1") is True
|
||||||
|
|
||||||
def test_minimax_base_url(self):
|
def test_minimax_base_url(self):
|
||||||
assert _is_minimax("some-model", "https://api.minimax.io/v1") is True
|
assert _is_minimax("some-model", "https://api.minimax.io/v1") is True
|
||||||
|
|
@ -81,8 +81,8 @@ class TestIsMinimax:
|
||||||
def test_none_values(self):
|
def test_none_values(self):
|
||||||
assert _is_minimax(None, None) is False
|
assert _is_minimax(None, None) is False
|
||||||
|
|
||||||
def test_minimax_highspeed(self):
|
def test_minimax_m3(self):
|
||||||
assert _is_minimax("MiniMax-M2.5-highspeed", "https://api.minimax.io/v1") is True
|
assert _is_minimax("MiniMax-M3", "https://api.minimax.io/v1") is True
|
||||||
|
|
||||||
def test_minimax_m27(self):
|
def test_minimax_m27(self):
|
||||||
assert _is_minimax("MiniMax-M2.7", "https://api.minimax.io/v1") is True
|
assert _is_minimax("MiniMax-M2.7", "https://api.minimax.io/v1") is True
|
||||||
|
|
@ -93,15 +93,15 @@ class TestIsMinimax:
|
||||||
|
|
||||||
class TestClampTemperature:
|
class TestClampTemperature:
|
||||||
def test_zero_temperature_minimax(self):
|
def test_zero_temperature_minimax(self):
|
||||||
result = _clamp_temperature(0.0, "MiniMax-M2.5", "https://api.minimax.io/v1")
|
result = _clamp_temperature(0.0, "MiniMax-M3", "https://api.minimax.io/v1")
|
||||||
assert result == 0.01
|
assert result == 0.01
|
||||||
|
|
||||||
def test_negative_temperature_minimax(self):
|
def test_negative_temperature_minimax(self):
|
||||||
result = _clamp_temperature(-0.1, "MiniMax-M2.5", "https://api.minimax.io/v1")
|
result = _clamp_temperature(-0.1, "MiniMax-M3", "https://api.minimax.io/v1")
|
||||||
assert result == 0.01
|
assert result == 0.01
|
||||||
|
|
||||||
def test_valid_temperature_minimax(self):
|
def test_valid_temperature_minimax(self):
|
||||||
result = _clamp_temperature(0.7, "MiniMax-M2.5", "https://api.minimax.io/v1")
|
result = _clamp_temperature(0.7, "MiniMax-M3", "https://api.minimax.io/v1")
|
||||||
assert result == 0.7
|
assert result == 0.7
|
||||||
|
|
||||||
def test_zero_temperature_non_minimax(self):
|
def test_zero_temperature_non_minimax(self):
|
||||||
|
|
@ -109,7 +109,7 @@ class TestClampTemperature:
|
||||||
assert result == 0.0
|
assert result == 0.0
|
||||||
|
|
||||||
def test_max_temperature_minimax(self):
|
def test_max_temperature_minimax(self):
|
||||||
result = _clamp_temperature(1.0, "MiniMax-M2.5", "https://api.minimax.io/v1")
|
result = _clamp_temperature(1.0, "MiniMax-M3", "https://api.minimax.io/v1")
|
||||||
assert result == 1.0
|
assert result == 1.0
|
||||||
|
|
||||||
def test_zero_temperature_minimax_m27(self):
|
def test_zero_temperature_minimax_m27(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue