Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

feat(models): add MiniMax-M3 model support (#4088)

Octopuscc2de7af12bd
diff --git a/camel/types/enums.py b/camel/types/enums.py
index def9045fa..c166ecbf9 100644
--- a/camel/types/enums.py
+++ b/camel/types/enums.py
@@ -545,6 +545,7 @@ class ModelType(UnifiedModelType, Enum):
CRYNUX_NOUS_HERMES_3_LLAMA_3_2_3B = "NousResearch/Hermes-3-Llama-3.2-3B"
# Minimax models
+ MINIMAX_M3 = "MiniMax-M3"
MINIMAX_M2_7 = "MiniMax-M2.7"
MINIMAX_M2_7_HIGHSPEED = "MiniMax-M2.7-highspeed"
MINIMAX_M2_5 = "MiniMax-M2.5"
@@ -1024,6 +1025,7 @@ class ModelType(UnifiedModelType, Enum):
@property
def is_minimax(self) -> bool:
return self in {
+ ModelType.MINIMAX_M3,
ModelType.MINIMAX_M2_7,
ModelType.MINIMAX_M2_7_HIGHSPEED,
ModelType.MINIMAX_M2_5,
@@ -1733,6 +1735,7 @@ class ModelType(UnifiedModelType, Enum):
ModelType.GPT_5_4_PRO,
ModelType.GPT_5_5,
ModelType.GPT_5_5_PRO,
+ ModelType.MINIMAX_M3,
ModelType.ORCAROUTER_CLAUDE_OPUS_4_7,
ModelType.ORCAROUTER_GROK_4_3,
}:
diff --git a/docs/key_modules/models.md b/docs/key_modules/models.md
index 223a81ea0..ccc7b9231 100644
--- a/docs/key_modules/models.md
+++ b/docs/key_modules/models.md
@@ -52,7 +52,7 @@ CAMEL supports a wide range of models, including [OpenAI’s GPT series](https:/
| **Reka** | reka-core, reka-flash, reka-edge |
| **COHERE** | command-r-plus, command-r, command-light, command, command-nightly |
| **ERNIE** | ernie-x1-turbo-32k, ernie-x1-32k, ernie-x1-32k-preview<br/>ernie-4.5-turbo-128k, ernie-4.5-turbo-32k<br/>ernie-5.0-thinking-latest, ernie-4.5-turbo-vl-latest<br/>deepseek-v3, deepseek-r1, qwen3-235b-a22b |
-| **MiniMax** | MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5<br/>MiniMax-M2.1, MiniMax-M2.1-lightning, MiniMax-M2 |
+| **MiniMax** | MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed<br/>MiniMax-M2.5, MiniMax-M2.1, MiniMax-M2.1-lightning, MiniMax-M2 |
| **xAI** | Grok models via the xAI SDK |
diff --git a/docs/mintlify/key_modules/models.mdx b/docs/mintlify/key_modules/models.mdx
index 223a81ea0..ccc7b9231 100644
--- a/docs/mintlify/key_modules/models.mdx
+++ b/docs/mintlify/key_modules/models.mdx
@@ -52,7 +52,7 @@ CAMEL supports a wide range of models, including [OpenAI’s GPT series](https:/
| **Reka** | reka-core, reka-flash, reka-edge |
| **COHERE** | command-r-plus, command-r, command-light, command, command-nightly |
| **ERNIE** | ernie-x1-turbo-32k, ernie-x1-32k, ernie-x1-32k-preview<br/>ernie-4.5-turbo-128k, ernie-4.5-turbo-32k<br/>ernie-5.0-thinking-latest, ernie-4.5-turbo-vl-latest<br/>deepseek-v3, deepseek-r1, qwen3-235b-a22b |
-| **MiniMax** | MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5<br/>MiniMax-M2.1, MiniMax-M2.1-lightning, MiniMax-M2 |
+| **MiniMax** | MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed<br/>MiniMax-M2.5, MiniMax-M2.1, MiniMax-M2.1-lightning, MiniMax-M2 |
| **xAI** | Grok models via the xAI SDK |
diff --git a/examples/models/minimax_interleaved_thinking_example.py b/examples/models/minimax_interleaved_thinking_example.py
index 2c224a3ff..7475f35aa 100644
--- a/examples/models/minimax_interleaved_thinking_example.py
+++ b/examples/models/minimax_interleaved_thinking_example.py
@@ -40,7 +40,7 @@ calculate_total_tool = FunctionTool(calculate_total)
model = ModelFactory.create(
model_platform=ModelPlatformType.MINIMAX,
- model_type=ModelType.MINIMAX_M2,
+ model_type=ModelType.MINIMAX_M3,
model_config_dict=MinimaxConfig(
temperature=0.2,
interleaved_thinking=True,
diff --git a/examples/models/minimax_model_example.py b/examples/models/minimax_model_example.py
index 6d4acd107..e861f12a5 100644
--- a/examples/models/minimax_model_example.py
+++ b/examples/models/minimax_model_example.py
@@ -19,7 +19,7 @@ from camel.types import ModelPlatformType, ModelType
model = ModelFactory.create(
model_platform=ModelPlatformType.MINIMAX,
- model_type=ModelType.MINIMAX_M2,
+ model_type=ModelType.MINIMAX_M3,
# For users in China, please use
# https://api.minimaxi.com/v1 instead.
base_url="https://api.minimaxi.io/v1",
diff --git a/test/models/test_minimax_model.py b/test/models/test_minimax_model.py
index 5d32f5250..31dc9c9d3 100644
--- a/test/models/test_minimax_model.py
+++ b/test/models/test_minimax_model.py
@@ -24,8 +24,10 @@ class TestMinimaxModel:
@pytest.mark.parametrize(
"model_type",
[
+ ModelType.MINIMAX_M3,
ModelType.MINIMAX_M2_7,
ModelType.MINIMAX_M2_7_HIGHSPEED,
+ ModelType.MINIMAX_M2_5,
ModelType.MINIMAX_M2_1,
ModelType.MINIMAX_M2_1_LIGHTNING,
ModelType.MINIMAX_M2,
@@ -36,7 +38,7 @@ class TestMinimaxModel:
model = MinimaxModel(model_type)
assert model.model_type == model_type
- def test_minimax_m2_model_create_with_config(self, monkeypatch):
+ def test_minimax_m3_model_create_with_config(self, monkeypatch):
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
config_dict = MinimaxConfig(
temperature=0.5,
@@ -45,45 +47,45 @@ class TestMinimaxModel:
).as_dict()
model = MinimaxModel(
- model_type=ModelType.MINIMAX_M2,
+ model_type=ModelType.MINIMAX_M3,
model_config_dict=config_dict,
)
- assert model.model_type == ModelType.MINIMAX_M2
+ assert model.model_type == ModelType.MINIMAX_M3
assert model.model_config_dict == config_dict
- def test_minimax_m2_model_api_keys_required(self):
+ def test_minimax_m3_model_api_keys_required(self):
# Test that the api_keys_required decorator is applied
assert hasattr(MinimaxModel.__init__, "__wrapped__")
- def test_minimax_m2_model_default_url(self, monkeypatch):
+ def test_minimax_m3_model_default_url(self, monkeypatch):
# Test default URL when no environment variable is set
monkeypatch.delenv("MINIMAX_API_BASE_URL", raising=False)
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
- model = MinimaxModel(ModelType.MINIMAX_M2)
+ model = MinimaxModel(ModelType.MINIMAX_M3)
assert model._url == "https://api.minimaxi.com/v1"
- def test_minimax_m2_model_custom_url(self, monkeypatch):
+ def test_minimax_m3_model_custom_url(self, monkeypatch):
# Test custom URL from environment variable
custom_url = "https://custom.minimax.endpoint/v1"
monkeypatch.setenv("MINIMAX_API_BASE_URL", custom_url)
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
- model = MinimaxModel(ModelType.MINIMAX_M2)
+ model = MinimaxModel(ModelType.MINIMAX_M3)
assert model._url == custom_url
- def test_minimax_m2_model_extends_openai_compatible(self, monkeypatch):
+ def test_minimax_m3_model_extends_openai_compatible(self, monkeypatch):
# Test that MinimaxModel inherits from OpenAICompatibleModel
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
from camel.models.openai_compatible_model import OpenAICompatibleModel
- model = MinimaxModel(ModelType.MINIMAX_M2)
+ model = MinimaxModel(ModelType.MINIMAX_M3)
assert isinstance(model, OpenAICompatibleModel)
- def test_minimax_m2_model_token_counter(self, monkeypatch):
+ def test_minimax_m3_model_token_counter(self, monkeypatch):
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
- model = MinimaxModel(ModelType.MINIMAX_M2)
+ model = MinimaxModel(ModelType.MINIMAX_M3)
# Should use the default OpenAI token counter
assert model.token_counter is not None
assert hasattr(model.token_counter, "count_tokens_from_messages")
@@ -91,8 +93,10 @@ class TestMinimaxModel:
@pytest.mark.parametrize(
"model_type",
[
+ ModelType.MINIMAX_M3,
ModelType.MINIMAX_M2_7,
ModelType.MINIMAX_M2_7_HIGHSPEED,
+ ModelType.MINIMAX_M2_5,
ModelType.MINIMAX_M2_1,
ModelType.MINIMAX_M2_1_LIGHTNING,
ModelType.MINIMAX_M2,
@@ -107,6 +111,23 @@ class TestMinimaxModel:
model = MinimaxModel(model_type)
assert isinstance(model.model_type, ModelType)
+ @pytest.mark.parametrize(
+ ("model_type", "token_limit"),
+ [
+ (ModelType.MINIMAX_M3, 1_000_000),
+ (ModelType.MINIMAX_M2_7, 204_800),
+ (ModelType.MINIMAX_M2_7_HIGHSPEED, 204_800),
+ (ModelType.MINIMAX_M2_5, 204_800),
+ (ModelType.MINIMAX_M2_1, 204_800),
+ (ModelType.MINIMAX_M2_1_LIGHTNING, 204_800),
+ (ModelType.MINIMAX_M2, 204_800),
+ ],
+ )
+ def test_minimax_model_token_limits(
+ self, model_type: ModelType, token_limit: int
+ ):
+ assert model_type.token_limit == token_limit
+
def test_minimax_model_interleaved_thinking_config(self, monkeypatch):
# Test interleaved thinking configuration
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
@@ -115,7 +136,7 @@ class TestMinimaxModel:
).as_dict()
model = MinimaxModel(
- model_type=ModelType.MINIMAX_M2,
+ model_type=ModelType.MINIMAX_M3,
model_config_dict=config_dict,
)
@@ -131,7 +152,7 @@ class TestMinimaxModel:
# Test that interleaved thinking is disabled by default
monkeypatch.setenv("MINIMAX_API_KEY", "test_key")
- model = MinimaxModel(model_type=ModelType.MINIMAX_M2)
+ model = MinimaxModel(model_type=ModelType.MINIMAX_M3)
assert model._is_thinking_enabled() is False
request_config = model._prepare_request_config()