From de791e03e4cecacfca255069b00372db24fb8198 Mon Sep 17 00:00:00 2001 From: PR Bot Date: Thu, 12 Mar 2026 20:36:46 +0800 Subject: [PATCH 1/3] feat: add MiniMax provider support (MiniMax-M2.5 & M2.5-highspeed) Add MiniMax as a recognized LLM provider with OpenAI-compatible API support. MiniMax M2.5 models offer 204K context windows with competitive pricing. Changes: - Register MiniMax in provider model examples and env key mapping - Add MiniMax detection in provider inference helpers - Include MiniMax-M2.5 and MiniMax-M2.5-highspeed in model lists - Add usage examples in LiteLLM integration docs and setup guide - Add unit tests for MiniMax provider detection --- README.md | 2 ++ ace/llm_providers/litellm_client.py | 7 ++++++- ace_next/providers/litellm.py | 7 ++++++- ace_next/providers/registry.py | 2 ++ docs/getting-started/setup.md | 1 + docs/integrations/litellm.md | 32 +++++++++++++++++++++++++++++ tests/test_litellm_client.py | 24 ++++++++++++++++++++++ 7 files changed, 73 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dde1d3a1..7d77733a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ pip install ace-framework ```bash export OPENAI_API_KEY="your-api-key" +# Or use other providers: +# export MINIMAX_API_KEY="your-minimax-api-key" ``` ### 3. Run diff --git a/ace/llm_providers/litellm_client.py b/ace/llm_providers/litellm_client.py index b2a07b19..1c571dba 100644 --- a/ace/llm_providers/litellm_client.py +++ b/ace/llm_providers/litellm_client.py @@ -652,7 +652,9 @@ def _get_provider_from_model(self, model: str) -> str: """Infer provider from model name.""" model_lower = model.lower() - if "gpt" in model_lower or "openai" in model_lower: + if "minimax" in model_lower: + return "minimax" + elif "gpt" in model_lower or "openai" in model_lower: return "openai" elif "claude" in model_lower or "anthropic" in model_lower: return "anthropic" @@ -703,6 +705,9 @@ def list_models(cls) -> List[str]: "mistral-7b", "mistral-medium", "mixtral-8x7b", + # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M2.5", + "openai/MiniMax-M2.5-highspeed", # Note: Many more models are supported # See: https://docs.litellm.ai/docs/providers ] diff --git a/ace_next/providers/litellm.py b/ace_next/providers/litellm.py index d017539b..82898d84 100644 --- a/ace_next/providers/litellm.py +++ b/ace_next/providers/litellm.py @@ -537,7 +537,9 @@ def complete_with_stream(self, prompt: str, **kwargs: Any): def _get_provider_from_model(self, model: str) -> str: """Infer provider from model name.""" model_lower = model.lower() - if "gpt" in model_lower or "openai" in model_lower: + if "minimax" in model_lower: + return "minimax" + elif "gpt" in model_lower or "openai" in model_lower: return "openai" elif "claude" in model_lower or "anthropic" in model_lower: return "anthropic" @@ -569,4 +571,7 @@ def list_models(cls) -> List[str]: "llama-2-70b", "mistral-7b", "mixtral-8x7b", + # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M2.5", + "openai/MiniMax-M2.5-highspeed", ] diff --git a/ace_next/providers/registry.py b/ace_next/providers/registry.py index e3832982..6c9e6dce 100644 --- a/ace_next/providers/registry.py +++ b/ace_next/providers/registry.py @@ -43,6 +43,7 @@ def _litellm(): "ollama": "ollama/llama2", "azure": "azure/gpt-4", "openrouter": "openrouter/anthropic/claude-3.5-sonnet", + "minimax": "openai/MiniMax-M2.5", } @@ -208,6 +209,7 @@ def validate_connection(model: str, api_key: str | None = None) -> ValidationRes "huggingface": "HUGGINGFACE_API_KEY", "perplexity": "PERPLEXITYAI_API_KEY", "anyscale": "ANYSCALE_API_KEY", + "minimax": "MINIMAX_API_KEY", } diff --git a/docs/getting-started/setup.md b/docs/getting-started/setup.md index de3382ff..ebc3fb67 100644 --- a/docs/getting-started/setup.md +++ b/docs/getting-started/setup.md @@ -176,6 +176,7 @@ ACE uses [LiteLLM](https://docs.litellm.ai/) for model access. Any model string | Ollama (local) | `ollama/llama2` | --- | | Azure OpenAI | `azure/gpt-4` | `AZURE_API_KEY` | | OpenRouter | `openrouter/anthropic/claude-3.5-sonnet` | `OPENROUTER_API_KEY` | +| MiniMax | `openai/MiniMax-M2.5` | `MINIMAX_API_KEY` | 100+ providers supported. Run `ace models` to search the full catalog. diff --git a/docs/integrations/litellm.md b/docs/integrations/litellm.md index f148b8f1..eefaeb29 100644 --- a/docs/integrations/litellm.md +++ b/docs/integrations/litellm.md @@ -137,6 +137,13 @@ agent = ACELiteLLM.from_model("claude-sonnet-4-5-20250929") # Google agent = ACELiteLLM.from_model("gemini-pro") +# MiniMax +agent = ACELiteLLM.from_model( + "openai/MiniMax-M2.5", + base_url="https://api.minimax.io/v1", + api_key=os.environ["MINIMAX_API_KEY"], +) + # Local (Ollama) agent = ACELiteLLM.from_model("ollama/llama2") @@ -144,6 +151,31 @@ agent = ACELiteLLM.from_model("ollama/llama2") agent = ACELiteLLM.from_model("gpt-4o-mini", base_url="https://your-endpoint.com") ``` +### MiniMax Models + +[MiniMax](https://platform.minimax.io/) provides high-performance models via an OpenAI-compatible API: + +| Model | Description | +|-------|-------------| +| `MiniMax-M2.5` | Peak performance with 204K context window | +| `MiniMax-M2.5-highspeed` | Same performance, faster and more agile | + +```bash +export MINIMAX_API_KEY="your-minimax-api-key" +``` + +```python +from ace_next import ACELiteLLM + +# Using MiniMax as the agent model +agent = ACELiteLLM.from_model( + "openai/MiniMax-M2.5", + base_url="https://api.minimax.io/v1", +) + +answer = agent.ask("Explain quantum computing in simple terms") +``` + ## Opik Observability Enable tracing and cost tracking with a single flag: diff --git a/tests/test_litellm_client.py b/tests/test_litellm_client.py index 891a86c5..c3684b81 100644 --- a/tests/test_litellm_client.py +++ b/tests/test_litellm_client.py @@ -524,5 +524,29 @@ def test_complete_messages_uses_same_config(self, mock_completion): self.assertEqual(call_kwargs["extra_headers"], {"X-Custom": "val"}) +@pytest.mark.unit +class TestProviderDetection(unittest.TestCase): + """Test _get_provider_from_model provider detection.""" + + def test_minimax_provider_detected(self): + """Test that MiniMax models are detected correctly.""" + from ace.llm_providers import LiteLLMClient + + client = LiteLLMClient.__new__(LiteLLMClient) + self.assertEqual(client._get_provider_from_model("MiniMax-M2.5"), "minimax") + self.assertEqual( + client._get_provider_from_model("openai/MiniMax-M2.5-highspeed"), + "minimax", + ) + + def test_minimax_in_model_list(self): + """Test that MiniMax models appear in list_models.""" + from ace.llm_providers import LiteLLMClient + + models = LiteLLMClient.list_models() + minimax_models = [m for m in models if "MiniMax" in m] + self.assertGreaterEqual(len(minimax_models), 2) + + if __name__ == "__main__": unittest.main() From 521af8a8b98210a09e9bc44b8cd6b6151a38d33d Mon Sep 17 00:00:00 2001 From: PR Bot Date: Wed, 18 Mar 2026 18:46:46 +0800 Subject: [PATCH 2/3] 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 as alternatives - Update related tests and docs --- ace/llm_providers/litellm_client.py | 2 ++ ace_next/providers/litellm.py | 2 ++ ace_next/providers/registry.py | 2 +- docs/getting-started/setup.md | 2 +- docs/integrations/litellm.md | 6 ++++-- tests/test_litellm_client.py | 15 ++++++++++++--- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ace/llm_providers/litellm_client.py b/ace/llm_providers/litellm_client.py index 1c571dba..a3e9def6 100644 --- a/ace/llm_providers/litellm_client.py +++ b/ace/llm_providers/litellm_client.py @@ -706,6 +706,8 @@ def list_models(cls) -> List[str]: "mistral-medium", "mixtral-8x7b", # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M2.7", + "openai/MiniMax-M2.7-highspeed", "openai/MiniMax-M2.5", "openai/MiniMax-M2.5-highspeed", # Note: Many more models are supported diff --git a/ace_next/providers/litellm.py b/ace_next/providers/litellm.py index 82898d84..00a93ff4 100644 --- a/ace_next/providers/litellm.py +++ b/ace_next/providers/litellm.py @@ -572,6 +572,8 @@ def list_models(cls) -> List[str]: "mistral-7b", "mixtral-8x7b", # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M2.7", + "openai/MiniMax-M2.7-highspeed", "openai/MiniMax-M2.5", "openai/MiniMax-M2.5-highspeed", ] diff --git a/ace_next/providers/registry.py b/ace_next/providers/registry.py index 6c9e6dce..c4be1cbe 100644 --- a/ace_next/providers/registry.py +++ b/ace_next/providers/registry.py @@ -43,7 +43,7 @@ def _litellm(): "ollama": "ollama/llama2", "azure": "azure/gpt-4", "openrouter": "openrouter/anthropic/claude-3.5-sonnet", - "minimax": "openai/MiniMax-M2.5", + "minimax": "openai/MiniMax-M2.7", } diff --git a/docs/getting-started/setup.md b/docs/getting-started/setup.md index ebc3fb67..690e0a79 100644 --- a/docs/getting-started/setup.md +++ b/docs/getting-started/setup.md @@ -176,7 +176,7 @@ ACE uses [LiteLLM](https://docs.litellm.ai/) for model access. Any model string | Ollama (local) | `ollama/llama2` | --- | | Azure OpenAI | `azure/gpt-4` | `AZURE_API_KEY` | | OpenRouter | `openrouter/anthropic/claude-3.5-sonnet` | `OPENROUTER_API_KEY` | -| MiniMax | `openai/MiniMax-M2.5` | `MINIMAX_API_KEY` | +| MiniMax | `openai/MiniMax-M2.7` | `MINIMAX_API_KEY` | 100+ providers supported. Run `ace models` to search the full catalog. diff --git a/docs/integrations/litellm.md b/docs/integrations/litellm.md index eefaeb29..57897b75 100644 --- a/docs/integrations/litellm.md +++ b/docs/integrations/litellm.md @@ -139,7 +139,7 @@ agent = ACELiteLLM.from_model("gemini-pro") # MiniMax agent = ACELiteLLM.from_model( - "openai/MiniMax-M2.5", + "openai/MiniMax-M2.7", base_url="https://api.minimax.io/v1", api_key=os.environ["MINIMAX_API_KEY"], ) @@ -157,6 +157,8 @@ agent = ACELiteLLM.from_model("gpt-4o-mini", base_url="https://your-endpoint.com | Model | Description | |-------|-------------| +| `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 with 204K context window | | `MiniMax-M2.5-highspeed` | Same performance, faster and more agile | @@ -169,7 +171,7 @@ from ace_next import ACELiteLLM # Using MiniMax as the agent model agent = ACELiteLLM.from_model( - "openai/MiniMax-M2.5", + "openai/MiniMax-M2.7", base_url="https://api.minimax.io/v1", ) diff --git a/tests/test_litellm_client.py b/tests/test_litellm_client.py index c3684b81..d7e58bb4 100644 --- a/tests/test_litellm_client.py +++ b/tests/test_litellm_client.py @@ -533,11 +533,12 @@ def test_minimax_provider_detected(self): from ace.llm_providers import LiteLLMClient client = LiteLLMClient.__new__(LiteLLMClient) - self.assertEqual(client._get_provider_from_model("MiniMax-M2.5"), "minimax") + self.assertEqual(client._get_provider_from_model("MiniMax-M2.7"), "minimax") self.assertEqual( - client._get_provider_from_model("openai/MiniMax-M2.5-highspeed"), + client._get_provider_from_model("openai/MiniMax-M2.7-highspeed"), "minimax", ) + self.assertEqual(client._get_provider_from_model("MiniMax-M2.5"), "minimax") def test_minimax_in_model_list(self): """Test that MiniMax models appear in list_models.""" @@ -545,7 +546,15 @@ def test_minimax_in_model_list(self): models = LiteLLMClient.list_models() minimax_models = [m for m in models if "MiniMax" in m] - self.assertGreaterEqual(len(minimax_models), 2) + self.assertGreaterEqual(len(minimax_models), 4) + + def test_minimax_m27_is_default(self): + """Test that MiniMax-M2.7 is the default MiniMax model.""" + from ace.llm_providers import LiteLLMClient + + models = LiteLLMClient.list_models() + minimax_models = [m for m in models if "MiniMax" in m] + self.assertEqual(minimax_models[0], "openai/MiniMax-M2.7") if __name__ == "__main__": From 50cf6bf75f13c18c3fbcd4a3f8c97a40fbc8190c Mon Sep 17 00:00:00 2001 From: octo-patch Date: Wed, 3 Jun 2026 03:21:42 +0800 Subject: [PATCH 3/3] 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 and docs --- ace/llm_providers/litellm_client.py | 3 +-- ace_next/providers/litellm.py | 3 +-- ace_next/providers/registry.py | 2 +- docs/getting-started/setup.md | 2 +- docs/integrations/litellm.md | 9 ++++----- tests/test_litellm_client.py | 10 +++++----- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ace/llm_providers/litellm_client.py b/ace/llm_providers/litellm_client.py index a3e9def6..e296942d 100644 --- a/ace/llm_providers/litellm_client.py +++ b/ace/llm_providers/litellm_client.py @@ -706,10 +706,9 @@ def list_models(cls) -> List[str]: "mistral-medium", "mixtral-8x7b", # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M3", "openai/MiniMax-M2.7", "openai/MiniMax-M2.7-highspeed", - "openai/MiniMax-M2.5", - "openai/MiniMax-M2.5-highspeed", # Note: Many more models are supported # See: https://docs.litellm.ai/docs/providers ] diff --git a/ace_next/providers/litellm.py b/ace_next/providers/litellm.py index 00a93ff4..3cc2f956 100644 --- a/ace_next/providers/litellm.py +++ b/ace_next/providers/litellm.py @@ -572,8 +572,7 @@ def list_models(cls) -> List[str]: "mistral-7b", "mixtral-8x7b", # MiniMax (via OpenAI-compatible endpoint) + "openai/MiniMax-M3", "openai/MiniMax-M2.7", "openai/MiniMax-M2.7-highspeed", - "openai/MiniMax-M2.5", - "openai/MiniMax-M2.5-highspeed", ] diff --git a/ace_next/providers/registry.py b/ace_next/providers/registry.py index c4be1cbe..a8573e8a 100644 --- a/ace_next/providers/registry.py +++ b/ace_next/providers/registry.py @@ -43,7 +43,7 @@ def _litellm(): "ollama": "ollama/llama2", "azure": "azure/gpt-4", "openrouter": "openrouter/anthropic/claude-3.5-sonnet", - "minimax": "openai/MiniMax-M2.7", + "minimax": "openai/MiniMax-M3", } diff --git a/docs/getting-started/setup.md b/docs/getting-started/setup.md index 690e0a79..1622fb95 100644 --- a/docs/getting-started/setup.md +++ b/docs/getting-started/setup.md @@ -176,7 +176,7 @@ ACE uses [LiteLLM](https://docs.litellm.ai/) for model access. Any model string | Ollama (local) | `ollama/llama2` | --- | | Azure OpenAI | `azure/gpt-4` | `AZURE_API_KEY` | | OpenRouter | `openrouter/anthropic/claude-3.5-sonnet` | `OPENROUTER_API_KEY` | -| MiniMax | `openai/MiniMax-M2.7` | `MINIMAX_API_KEY` | +| MiniMax | `openai/MiniMax-M3` | `MINIMAX_API_KEY` | 100+ providers supported. Run `ace models` to search the full catalog. diff --git a/docs/integrations/litellm.md b/docs/integrations/litellm.md index 57897b75..9b5094ce 100644 --- a/docs/integrations/litellm.md +++ b/docs/integrations/litellm.md @@ -139,7 +139,7 @@ agent = ACELiteLLM.from_model("gemini-pro") # MiniMax agent = ACELiteLLM.from_model( - "openai/MiniMax-M2.7", + "openai/MiniMax-M3", base_url="https://api.minimax.io/v1", api_key=os.environ["MINIMAX_API_KEY"], ) @@ -157,10 +157,9 @@ agent = ACELiteLLM.from_model("gpt-4o-mini", base_url="https://your-endpoint.com | Model | Description | |-------|-------------| -| `MiniMax-M2.7` | Latest flagship model with enhanced reasoning and coding | +| `MiniMax-M3` | Latest flagship model with 512K context window, up to 128K output, and image input support (default) | +| `MiniMax-M2.7` | Previous-generation 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 with 204K context window | -| `MiniMax-M2.5-highspeed` | Same performance, faster and more agile | ```bash export MINIMAX_API_KEY="your-minimax-api-key" @@ -171,7 +170,7 @@ from ace_next import ACELiteLLM # Using MiniMax as the agent model agent = ACELiteLLM.from_model( - "openai/MiniMax-M2.7", + "openai/MiniMax-M3", base_url="https://api.minimax.io/v1", ) diff --git a/tests/test_litellm_client.py b/tests/test_litellm_client.py index d7e58bb4..38e23eec 100644 --- a/tests/test_litellm_client.py +++ b/tests/test_litellm_client.py @@ -533,12 +533,12 @@ def test_minimax_provider_detected(self): from ace.llm_providers import LiteLLMClient client = LiteLLMClient.__new__(LiteLLMClient) + self.assertEqual(client._get_provider_from_model("MiniMax-M3"), "minimax") self.assertEqual(client._get_provider_from_model("MiniMax-M2.7"), "minimax") self.assertEqual( client._get_provider_from_model("openai/MiniMax-M2.7-highspeed"), "minimax", ) - self.assertEqual(client._get_provider_from_model("MiniMax-M2.5"), "minimax") def test_minimax_in_model_list(self): """Test that MiniMax models appear in list_models.""" @@ -546,15 +546,15 @@ def test_minimax_in_model_list(self): models = LiteLLMClient.list_models() minimax_models = [m for m in models if "MiniMax" in m] - self.assertGreaterEqual(len(minimax_models), 4) + self.assertGreaterEqual(len(minimax_models), 3) - def test_minimax_m27_is_default(self): - """Test that MiniMax-M2.7 is the default MiniMax model.""" + def test_minimax_m3_is_default(self): + """Test that MiniMax-M3 is the default MiniMax model.""" from ace.llm_providers import LiteLLMClient models = LiteLLMClient.list_models() minimax_models = [m for m in models if "MiniMax" in m] - self.assertEqual(minimax_models[0], "openai/MiniMax-M2.7") + self.assertEqual(minimax_models[0], "openai/MiniMax-M3") if __name__ == "__main__":