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: Add AtlasCloud model integration (#3683)

Yanxi Chen1939775c8d65
diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml
index 7f5ff2e93..efb7814f3 100644
--- a/.github/workflows/build_package.yml
+++ b/.github/workflows/build_package.yml
@@ -153,6 +153,7 @@ jobs:
ACI_API_KEY: "${{ secrets.ACI_API_KEY }}"
BOHRIUM_API_KEY: "${{ secrets.BOHRIUM_API_KEY }}"
MINIMAX_API_KEY: "${{ secrets.MINIMAX_API_KEY}}"
+ ATLASCLOUD_API_KEY: "${{ secrets.ATLASCLOUD_API_KEY }}"
CRYNUX_API_KEY: "${{ secrets.CRYNUX_API_KEY }}"
NEBIUS_API_KEY: "${{ secrets.NEBIUS_API_KEY }}"
COMETAPI_KEY: "${{ secrets.COMETAPI_KEY }}"
diff --git a/.github/workflows/pytest_package.yml b/.github/workflows/pytest_package.yml
index 7ceb9f46c..b3b105d43 100644
--- a/.github/workflows/pytest_package.yml
+++ b/.github/workflows/pytest_package.yml
@@ -92,6 +92,7 @@ jobs:
QIANFAN_API_KEY: "${{ secrets.QIANFAN_API_KEY }}"
ACI_API_KEY: "${{ secrets.ACI_API_KEY }}"
BOHRIUM_API_KEY: "${{ secrets.BOHRIUM_API_KEY }}"
+ ATLASCLOUD_API_KEY: "${{ secrets.ATLASCLOUD_API_KEY }}"
CRYNUX_API_KEY: "${{ secrets.CRYNUX_API_KEY }}"
NEBIUS_API_KEY: "${{ secrets.NEBIUS_API_KEY }}"
COMETAPI_KEY: "${{ secrets.COMETAPI_KEY }}"
@@ -183,6 +184,7 @@ jobs:
WATSONX_API_KEY: "${{ secrets.WATSONX_API_KEY }}"
WATSONX_PROJECT_ID: "${{ secrets.WATSONX_PROJECT_ID }}"
QIANFAN_API_KEY: "${{ secrets.QIANFAN_API_KEY }}"
+ ATLASCLOUD_API_KEY: "${{ secrets.ATLASCLOUD_API_KEY }}"
ACI_API_KEY: "${{ secrets.ACI_API_KEY }}"
BOHRIUM_API_KEY: "${{ secrets.BOHRIUM_API_KEY }}"
CRYNUX_API_KEY: "${{ secrets.CRYNUX_API_KEY }}"
@@ -232,6 +234,7 @@ jobs:
GROQ_API_KEY: "${{ secrets.GROQ_API_KEY }}"
COHERE_API_KEY: "${{ secrets.COHERE_API_KEY }}"
NVIDIA_API_BASE_URL: "${{ secrets.NVIDIA_API_BASE_URL }}"
+ ATLASCLOUD_API_KEY: "${{ secrets.ATLASCLOUD_API_KEY }}"
NVIDIA_API_KEY: "${{ secrets.NVIDIA_API_KEY }}"
ZHIPUAI_API_BASE_URL: "${{ secrets.ZHIPUAI_API_BASE_URL }}"
ZHIPUAI_API_KEY: "${{ secrets.ZHIPUAI_API_KEY }}"
diff --git a/camel/configs/__init__.py b/camel/configs/__init__.py
index 53711263b..a9547754c 100644
--- a/camel/configs/__init__.py
+++ b/camel/configs/__init__.py
@@ -15,6 +15,7 @@ from .aihubmix_config import AIHUBMIX_API_PARAMS, AihubMixConfig
from .aiml_config import AIML_API_PARAMS, AIMLConfig
from .amd_config import AMD_API_PARAMS, AMDConfig
from .anthropic_config import ANTHROPIC_API_PARAMS, AnthropicConfig
+from .atlascloud_config import ATLASCLOUD_API_PARAMS, AtlasCloudConfig
from .base_config import BaseConfig
from .bedrock_config import BEDROCK_API_PARAMS, BedrockConfig
from .cerebras_config import CEREBRAS_API_PARAMS, CerebrasConfig
@@ -130,6 +131,8 @@ __all__ = [
'AMD_API_PARAMS',
'OpenRouterConfig',
'OPENROUTER_API_PARAMS',
+ 'AtlasCloudConfig',
+ 'ATLASCLOUD_API_PARAMS',
'LMSTUDIO_API_PARAMS',
'LMStudioConfig',
'MINIMAX_API_PARAMS',
diff --git a/camel/configs/atlascloud_config.py b/camel/configs/atlascloud_config.py
new file mode 100644
index 000000000..907e3d2ec
--- /dev/null
+++ b/camel/configs/atlascloud_config.py
@@ -0,0 +1,57 @@
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+from __future__ import annotations
+
+from typing import Optional
+
+from camel.configs.base_config import BaseConfig
+
+
+class AtlasCloudConfig(BaseConfig):
+ r"""Defines the parameters for generating chat completions using OpenAI
+ compatibility.
+
+ Reference: https://www.atlascloud.ai/docs/en/createChatCompletion
+
+ Args:
+ temperature (float, optional): Sampling temperature to use, between
+ :obj:`0` and :obj:`2`. Higher values make the output more random,
+ while lower values make it more focused and deterministic.
+ (default: :obj:`None`)
+ top_p (float, optional): An alternative to sampling with temperature,
+ called nucleus sampling, where the model considers the results of
+ the tokens with top_p probability mass. So :obj:`0.1` means only
+ the tokens comprising the top 10% probability mass are considered.
+ (default: :obj:`None`)
+ stream (bool, optional): If True, partial message deltas will be sent
+ as data-only server-sent events as they become available.
+ (default: :obj:`None`)
+ max_tokens (int, optional): The maximum number of tokens to generate
+ in the chat completion. The total length of input tokens and
+ generated tokens is limited by the model's context length.
+ (default: :obj:`None`)
+ repetition_penalty (float, optional): Penalty for repeated tokens to
+ prevent redundancy. (default: :obj:`None`)
+ """
+
+ temperature: Optional[float] = None
+ top_p: Optional[float] = None
+ stream: Optional[bool] = None
+ max_tokens: Optional[int] = None
+ repetition_penalty: Optional[float] = None
+
+
+ATLASCLOUD_API_PARAMS = {
+ param for param in AtlasCloudConfig.model_fields.keys()
+}
diff --git a/camel/models/__init__.py b/camel/models/__init__.py
index 2088faac9..a26b7f2ca 100644
--- a/camel/models/__init__.py
+++ b/camel/models/__init__.py
@@ -15,6 +15,7 @@ from .aihubmix_model import AihubMixModel
from .aiml_model import AIMLModel
from .amd_model import AMDModel
from .anthropic_model import AnthropicModel
+from .atlascloud_model import AtlasCloudModel
from .aws_bedrock_model import AWSBedrockModel
from .azure_openai_model import AzureOpenAIModel
from .base_audio_model import BaseAudioModel
@@ -66,6 +67,7 @@ __all__ = [
'BaseModelBackend',
'OpenAIModel',
'OpenRouterModel',
+ 'AtlasCloudModel',
'AzureOpenAIModel',
'AnthropicModel',
'AMDModel',
diff --git a/camel/models/atlascloud_model.py b/camel/models/atlascloud_model.py
new file mode 100644
index 000000000..179f7f983
--- /dev/null
+++ b/camel/models/atlascloud_model.py
@@ -0,0 +1,83 @@
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+import os
+from typing import Any, Dict, Optional, Union
+
+from camel.configs import AtlasCloudConfig
+from camel.models.openai_compatible_model import OpenAICompatibleModel
+from camel.types import ModelType
+from camel.utils import (
+ BaseTokenCounter,
+ api_keys_required,
+)
+
+
+class AtlasCloudModel(OpenAICompatibleModel):
+ r"""LLM API served by AtlasCloud in a unified OpenAICompatibleModel
+ interface.
+
+ Args:
+ model_type (Union[ModelType, str]): Model for which a backend is
+ created.
+ model_config_dict (Optional[Dict[str, Any]], optional): A dictionary
+ that will be fed into:obj:`openai.ChatCompletion.create()`.
+ If:obj:`None`, :obj:`AtlasCloudConfig().as_dict()` will be used.
+ (default: :obj:`None`)
+ api_key (Optional[str], optional): The API key for authenticating
+ with the AtlasCloud service. (default: :obj:`None`).
+ url (Optional[str], optional): The url to the AtlasCloud service.
+ (default: :obj:`None`)
+ token_counter (Optional[BaseTokenCounter], optional): Token counter to
+ use for the model. If not provided, :obj:`OpenAITokenCounter(
+ ModelType.GPT_4O_MINI)` will be used.
+ (default: :obj:`None`)
+ timeout (Optional[float], optional): The timeout value in seconds for
+ API calls. If not provided, will fall back to the MODEL_TIMEOUT
+ environment variable or default to 180 seconds.
+ (default: :obj:`None`)
+ max_retries (int, optional): Maximum number of retries for API calls.
+ (default: :obj:`3`)
+ **kwargs (Any): Additional arguments to pass to the client
+ initialization.
+ """
+
+ @api_keys_required([("api_key", "ATLASCLOUD_API_KEY")])
+ def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any,
+ ) -> None:
+ if model_config_dict is None:
+ model_config_dict = AtlasCloudConfig().as_dict()
+ api_key = api_key or os.environ.get("ATLASCLOUD_API_KEY")
+ url = url or os.environ.get(
+ "ATLASCLOUD_API_BASE_URL", "https://api.atlascloud.ai/v1"
+ )
+ timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
+ super().__init__(
+ model_type=model_type,
+ model_config_dict=model_config_dict,
+ api_key=api_key,
+ url=url,
+ token_counter=token_counter,
+ timeout=timeout,
+ max_retries=max_retries,
+ **kwargs,
+ )
diff --git a/camel/models/model_factory.py b/camel/models/model_factory.py
index c7bceaef0..dd08254ed 100644
--- a/camel/models/model_factory.py
+++ b/camel/models/model_factory.py
@@ -19,6 +19,7 @@ from camel.models.aihubmix_model import AihubMixModel
from camel.models.aiml_model import AIMLModel
from camel.models.amd_model import AMDModel
from camel.models.anthropic_model import AnthropicModel
+from camel.models.atlascloud_model import AtlasCloudModel
from camel.models.aws_bedrock_model import AWSBedrockModel
from camel.models.azure_openai_model import AzureOpenAIModel
from camel.models.base_model import BaseModelBackend
@@ -97,6 +98,7 @@ class ModelFactory:
ModelPlatformType.LMSTUDIO: LMStudioModel,
ModelPlatformType.MINIMAX: MinimaxModel,
ModelPlatformType.OPENROUTER: OpenRouterModel,
+ ModelPlatformType.ATLASCLOUD: AtlasCloudModel,
ModelPlatformType.ZHIPU: ZhipuAIModel,
ModelPlatformType.GEMINI: GeminiModel,
ModelPlatformType.MISTRAL: MistralModel,
diff --git a/camel/types/enums.py b/camel/types/enums.py
index cc742591b..6956b861c 100644
--- a/camel/types/enums.py
+++ b/camel/types/enums.py
@@ -515,6 +515,10 @@ class ModelType(UnifiedModelType, Enum):
MINIMAX_M2 = "MiniMax-M2"
MINIMAX_M2_STABLE = "MiniMax-M2-Stable"
+ # AtlasCloud models
+ ATLASCLOUD_GPT_OSS_120B = "openai/gpt-oss-120b"
+ ATLASCLOUD_GLM_4_7 = "zai-org/glm-4.7"
+
def __str__(self):
return self.value
@@ -1428,6 +1432,7 @@ class ModelType(UnifiedModelType, Enum):
ModelType.NEBIUS_DEEPSEEK_V3,
ModelType.NEBIUS_DEEPSEEK_R1,
ModelType.NEBIUS_GPT_OSS_120B,
+ ModelType.ATLASCLOUD_GPT_OSS_120B,
ModelType.NEBIUS_GPT_OSS_20B,
ModelType.COMETAPI_GPT_5_CHAT_LATEST,
ModelType.COMETAPI_CHATGPT_4O_LATEST,
@@ -1521,6 +1526,7 @@ class ModelType(UnifiedModelType, Enum):
ModelType.CLAUDE_SONNET_4,
ModelType.CLAUDE_OPUS_4,
ModelType.CLAUDE_OPUS_4_1,
+ ModelType.ATLASCLOUD_GLM_4_7,
ModelType.YI_MEDIUM_200K,
ModelType.AWS_CLAUDE_3_5_SONNET,
ModelType.AWS_CLAUDE_3_HAIKU,
@@ -1828,6 +1834,7 @@ class ModelPlatformType(Enum):
MINIMAX = "minimax"
CEREBRAS = "cerebras"
FUNCTION_GEMMA = "function-gemma"
+ ATLASCLOUD = "atlascloud"
@classmethod
def from_name(cls, name):
@@ -2023,6 +2030,11 @@ class ModelPlatformType(Enum):
r"""Returns whether this platform is Cerebras."""
return self is ModelPlatformType.CEREBRAS
+ @property
+ def is_atlascloud(self) -> bool:
+ r"""Returns whether this platform is AtlasCloud."""
+ return self is ModelPlatformType.ATLASCLOUD
+
class AudioModelType(Enum):
TTS_1 = "tts-1"
diff --git a/camel/types/unified_model_type.py b/camel/types/unified_model_type.py
index 1d79b6417..ca34fb679 100644
--- a/camel/types/unified_model_type.py
+++ b/camel/types/unified_model_type.py
@@ -109,6 +109,11 @@ class UnifiedModelType(str):
r"""Returns whether the model is a OpenRouter served model."""
return True
+ @property
+ def is_atlascloud(self) -> bool:
+ r"""Returns whether the model is a AtlasCloud served model."""
+ return True
+
@property
def is_lmstudio(self) -> bool:
r"""Returns whether the model is a LMStudio served model."""
diff --git a/docs/mintlify/key_modules/models.mdx b/docs/mintlify/key_modules/models.mdx
index da7018a8c..65348e239 100644
--- a/docs/mintlify/key_modules/models.mdx
+++ b/docs/mintlify/key_modules/models.mdx
@@ -53,6 +53,7 @@ CAMEL supports a wide range of models, including [OpenAI’s GPT series](https:/
| **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/>deepseek-v3, deepseek-r1, qwen3-235b-a22b |
| **MiniMax** | MiniMax-M2, MiniMax-M2-Stable |
+| **AtlasCloud** | openai/gpt-oss-120b, zai-org/glm-4-7 |
### API & Connector Platforms
diff --git a/examples/models/atlascloud_model_example.py b/examples/models/atlascloud_model_example.py
new file mode 100644
index 000000000..599b69bb9
--- /dev/null
+++ b/examples/models/atlascloud_model_example.py
@@ -0,0 +1,37 @@
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+
+from camel.agents import ChatAgent
+from camel.configs import AtlasCloudConfig
+from camel.models import ModelFactory
+from camel.types import ModelPlatformType, ModelType
+
+model = ModelFactory.create(
+ model_platform=ModelPlatformType.ATLASCLOUD,
+ model_type=ModelType.ATLASCLOUD_GPT_OSS_120B,
+ model_config_dict=AtlasCloudConfig(temperature=0.2).as_dict(),
+)
+
+# Define system message
+sys_msg = "You are a helpful assistant."
+
+# Set agent
+camel_agent = ChatAgent(system_message=sys_msg, model=model)
+
+user_msg = """Say hi to CAMEL AI, one open-source community
+ dedicated to the study of autonomous and communicative agents."""
+
+# Get response information
+response = camel_agent.step(user_msg)
+print(response.msgs[0].content)
diff --git a/test/models/test_atlascloud_model.py b/test/models/test_atlascloud_model.py
new file mode 100644
index 000000000..c3b43c1ff
--- /dev/null
+++ b/test/models/test_atlascloud_model.py
@@ -0,0 +1,43 @@
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2026 @ CAMEL-AI.org. All Rights Reserved. =========
+
+import pytest
+
+from camel.configs import AtlasCloudConfig
+from camel.models import AtlasCloudModel
+from camel.types import ModelType
+from camel.utils import OpenAITokenCounter
+
+
+ "model_type",
+ [
+ ModelType.ATLASCLOUD_GPT_OSS_120B,
+ ModelType.ATLASCLOUD_GLM_4_7,
+ ],
+)
+def test_atlascloud_model(model_type: ModelType):
+ model = AtlasCloudModel(model_type)
+ assert model.model_type == model_type
+ assert model.model_config_dict == AtlasCloudConfig().as_dict()
+ assert isinstance(model.token_counter, OpenAITokenCounter)
+ assert isinstance(model.model_type.value_for_tiktoken, str)
+ assert isinstance(model.model_type.token_limit, int)
+
+
+def test_atlascloud_model_stream_property():
+ model = AtlasCloudModel(ModelType.ATLASCLOUD_GPT_OSS_120B)
+ assert model.stream is False