Merge pull request #450 from octo-patch/feature/upgrade-minimax-m27

feat: upgrade MiniMax default model to M2.7
This commit is contained in:
Martin
2026-04-05 11:55:47 +02:00
committed by GitHub
4 changed files with 42 additions and 4 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ provider_server_address = # Typically ignored or can be left blank when is_local
| Hugging Face | `huggingface` | No | Use models from Hugging Face Inference API. | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
| TogetherAI | `togetherAI` | No | Use various open-source models via TogetherAI API.| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
| OpenRouter | `openrouter` | No | Use OpenRouter Models| [https://openrouter.ai/](https://openrouter.ai/) |
| MiniMax | `minimax` | No | Use MiniMax M2.5 series models (e.g., MiniMax-M2.5).| [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
| MiniMax | `minimax` | No | Use MiniMax models (e.g., MiniMax-M2.7, MiniMax-M2.5).| [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
*Note:*
* We advise against using `gpt-4o` or other OpenAI models for complex web browsing and task planning as current prompt optimizations are geared towards models like Deepseek.
+1 -1
View File
@@ -230,7 +230,7 @@ provider_server_address = # 当 is_local = False 时,对于大多数 API 通
| Hugging Face | `huggingface` | 否 | 使用 Hugging Face Inference API 中的模型。 | [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) |
| TogetherAI | `togetherAI` | 否 | 通过 TogetherAI API 使用各种开源模型。| [api.together.ai/settings/api-keys](https://api.together.ai/settings/api-keys) |
| OpenRouter | `openrouter` | No | 通过 OpenRouter 使用各种开源模型| [https://openrouter.ai/](https://openrouter.ai/) |
| MiniMax | `minimax` | 否 | 使用 MiniMax 的 M2.5 系列模型(如 MiniMax-M2.5)。 | [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
| MiniMax | `minimax` | 否 | 使用 MiniMax 模型(如 MiniMax-M2.7、MiniMax-M2.5)。 | [platform.minimax.io](https://platform.minimax.io/user-center/basic-information) |
*注意:*
* 我们不建议将 `gpt-4o` 或其他 OpenAI 模型用于复杂的网页浏览和任务规划,因为当前的提示优化针对 Deepseek 等模型。
+4 -2
View File
@@ -416,11 +416,13 @@ class Provider:
def minimax_fn(self, history, verbose=False):
"""
Use MiniMax API to generate text via OpenAI-compatible interface.
Supported models:
- MiniMax-M2.7: Latest flagship model with enhanced reasoning and coding
- MiniMax-M2.7-highspeed: High-speed version of M2.7 for low-latency scenarios
- MiniMax-M2.5: Peak performance model (~60 tps), 204,800 context window
- MiniMax-M2.5-highspeed: Same performance, faster (~100 tps)
Note: temperature must be in range (0.0, 1.0], default is 1.0
"""
load_dotenv()
+36
View File
@@ -155,6 +155,42 @@ class TestMiniMaxProvider(unittest.TestCase):
class TestMiniMaxProviderModels(unittest.TestCase):
"""Test cases for MiniMax provider model configurations."""
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m27_model(self, mock_openai_class):
"""Test MiniMax-M2.7 model."""
mock_client = MagicMock()
mock_openai_class.return_value = mock_client
mock_response = MagicMock()
mock_response.choices = [MagicMock(message=MagicMock(content="Response"))]
mock_client.chat.completions.create.return_value = mock_response
with patch.object(Provider, 'get_api_key', return_value='test-key'):
provider = Provider("minimax", "MiniMax-M2.7", is_local=False)
history = [{"role": "user", "content": "Hello"}]
provider.minimax_fn(history)
call_kwargs = mock_client.chat.completions.create.call_args[1]
self.assertEqual(call_kwargs['model'], "MiniMax-M2.7")
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m27_highspeed_model(self, mock_openai_class):
"""Test MiniMax-M2.7-highspeed model."""
mock_client = MagicMock()
mock_openai_class.return_value = mock_client
mock_response = MagicMock()
mock_response.choices = [MagicMock(message=MagicMock(content="Response"))]
mock_client.chat.completions.create.return_value = mock_response
with patch.object(Provider, 'get_api_key', return_value='test-key'):
provider = Provider("minimax", "MiniMax-M2.7-highspeed", is_local=False)
history = [{"role": "user", "content": "Hello"}]
provider.minimax_fn(history)
call_kwargs = mock_client.chat.completions.create.call_args[1]
self.assertEqual(call_kwargs['model'], "MiniMax-M2.7-highspeed")
@patch('sources.llm_provider.OpenAI')
@patch.dict(os.environ, {'MINIMAX_API_KEY': 'test-key'})
def test_minimax_m25_model(self, mock_openai_class):