Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ POE_API_KEY=your-poe-api-key-here
#QWEN API KEY
QWEN_API_KEY=your-qwen-key-here

# Atlas Cloud API Key
ATLASCLOUD_API_KEY=your-atlascloud-key-here

# Exa API Key (for Exa AI-powered web search MCP server)
EXA_API_KEY=your-exa-api-key-here

#Azure OpenAI Configuration
AZURE_OPENAI_API_KEY=your-azure-openai-key-here
AZURE_OPENAI_ENDPOINT=your-azure-openai-endpoint-here
AZURE_OPENAI_API_VERSION=your-azure-openai-api-version-here
AZURE_OPENAI_API_VERSION=your-azure-openai-api-version-here
6 changes: 5 additions & 1 deletion docs/source/reference/supported_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ The ``chatcompletion`` backend provides a generic way to connect to any OpenAI-c
* - **Backend Type**
- ``chatcompletion``
* - **Compatible Providers**
- Cerebras AI, Together AI, Fireworks AI, Groq, OpenRouter, POE, and any OpenAI-compatible API
- Cerebras AI, Together AI, Fireworks AI, Groq, OpenRouter, Atlas Cloud, POE, and any OpenAI-compatible API
* - **Required Config**
- ``base_url`` pointing to the provider's API endpoint
* - **API Key**
Expand Down Expand Up @@ -216,13 +216,17 @@ The ``chatcompletion`` backend provides a generic way to connect to any OpenAI-c
* - **POE**
- Platform-specific
- Platform credentials
* - **Atlas Cloud**
- ``https://api.atlascloud.ai/v1``
- ``ATLASCLOUD_API_KEY``

**Common Models:**

* **Cerebras**: ``gpt-oss-120b``, ``gpt-oss-70b``
* **Together AI**: ``meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo``, ``mistralai/Mixtral-8x7B-Instruct-v0.1``
* **Fireworks AI**: ``accounts/fireworks/models/llama-v3p1-405b-instruct``
* **Groq**: ``llama-3.1-70b-versatile``, ``mixtral-8x7b-32768``
* **Atlas Cloud**: use a model ID available to your Atlas Cloud account

Tool Enablement Reference
--------------------------
Expand Down
3 changes: 3 additions & 0 deletions massgen/backend/chat_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- ZAI: ZAI_API_KEY
- POE: POE_API_KEY
- Qwen: QWEN_API_KEY
- Atlas Cloud: ATLASCLOUD_API_KEY
"""

from __future__ import annotations
Expand Down Expand Up @@ -1145,6 +1146,8 @@ def get_provider_name(self) -> str:
return "POE"
elif "aliyuncs.com" in base_url:
return "Qwen"
elif "atlascloud.ai" in base_url:
return "Atlas Cloud"
else:
return "ChatCompletion"

Expand Down
10 changes: 10 additions & 0 deletions massgen/cli/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def create_backend(backend_type: str, **kwargs) -> Any:
- Nvidia NIM (nvidia.com) -> NGC_API_KEY
- POE (poe.com) -> POE_API_KEY
- Qwen (dashscope.aliyuncs.com) -> QWEN_API_KEY
- Atlas Cloud (atlascloud.ai) -> ATLASCLOUD_API_KEY

External agent frameworks are supported via the adapter registry.
"""
Expand Down Expand Up @@ -238,6 +239,15 @@ def create_backend(backend_type: str, **kwargs) -> Any:
raise ConfigurationError(
"Qwen API key not found. Set QWEN_API_KEY environment variable.\n" "You can add it to a .env file in:\n" " - Current directory: .env\n" " - Global config: ~/.massgen/.env",
)
elif base_url and "atlascloud.ai" in base_url:
api_key = os.getenv("ATLASCLOUD_API_KEY")
if not api_key:
raise ConfigurationError(
"Atlas Cloud API key not found. Set ATLASCLOUD_API_KEY environment variable.\n"
"You can add it to a .env file in:\n"
" - Current directory: .env\n"
" - Global config: ~/.massgen/.env",
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

return ChatCompletionsBackend(api_key=api_key, **kwargs)

Expand Down
5 changes: 3 additions & 2 deletions massgen/configs/BACKEND_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ backend:

Generic backend supporting multiple providers (v0.0.18+ with MCP).

Supports: Cerebras AI, Together AI, Fireworks AI, Groq, Nebius AI Studio, OpenRouter, Kimi/Moonshot, and any OpenAI-compatible API.
Supports: Cerebras AI, Together AI, Fireworks AI, Groq, Nebius AI Studio, OpenRouter, Kimi/Moonshot, Atlas Cloud, and any OpenAI-compatible API.

```yaml
backend:
Expand Down Expand Up @@ -365,6 +365,7 @@ backend:
- **OpenRouter**: `https://openrouter.ai/api/v1`
- **Nvidia NIM**: `https://integrate.api.nvidia.com/v1`
- **Kimi/Moonshot**: `https://api.moonshot.cn/v1`
- **Atlas Cloud**: `https://api.atlascloud.ai/v1`

---

Expand Down Expand Up @@ -464,4 +465,4 @@ NOTION_API_KEY=your-notion-key

- [Join our Discord](https://discord.massgen.ai)
- [Report Issues](https://github.com/Leezekun/MassGen/issues)
- [View Documentation](https://github.com/Leezekun/MassGen)
- [View Documentation](https://github.com/Leezekun/MassGen)
12 changes: 12 additions & 0 deletions massgen/configs/basic/single/single_atlascloud.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# MassGen Atlas Cloud Configuration
# uv run massgen --automation --config massgen/configs/basic/single/single_atlascloud.yaml "Hello"
agents:
- id: "atlascloud_agent"
backend:
type: "chatcompletion"
model: "qwen/qwen3.8-max"
base_url: "https://api.atlascloud.ai/v1"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

ui:
display_type: "textual_terminal"
logging_enabled: true
37 changes: 37 additions & 0 deletions massgen/tests/test_chat_completions_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
BACKGROUND_TOOL_STATUS_NAME,
BACKGROUND_TOOL_WAIT_NAME,
)
from massgen.cli.backends import create_backend
from massgen.cli.config_loading import ConfigurationError


def test_openai_backend_defaults():
Expand Down Expand Up @@ -47,6 +49,41 @@ def test_cerebras_backend():
assert backend.config["base_url"] == "https://api.cerebras.ai/v1"


def test_atlascloud_backend():
"""Provider should be inferred from the Atlas Cloud base URL."""
backend = ChatCompletionsBackend(
base_url="https://api.atlascloud.ai/v1",
api_key="test-key",
)
assert backend.get_provider_name() == "Atlas Cloud"
assert backend.config["base_url"] == "https://api.atlascloud.ai/v1"


def test_atlascloud_api_key_is_detected(monkeypatch: pytest.MonkeyPatch):
"""Atlas Cloud configs should use ATLASCLOUD_API_KEY automatically."""
monkeypatch.setenv("ATLASCLOUD_API_KEY", "test-atlas-key")

backend = create_backend(
"chatcompletion",
base_url="https://api.atlascloud.ai/v1",
model="qwen/qwen3.8-max",
)

assert backend.api_key == "test-atlas-key"


def test_atlascloud_api_key_error_is_actionable(monkeypatch: pytest.MonkeyPatch):
"""Missing Atlas Cloud credentials should name the expected variable."""
monkeypatch.delenv("ATLASCLOUD_API_KEY", raising=False)

with pytest.raises(ConfigurationError, match="ATLASCLOUD_API_KEY"):
create_backend(
"chatcompletion",
base_url="https://api.atlascloud.ai/v1",
model="qwen/qwen3.8-max",
)


@pytest.mark.asyncio
async def test_tool_conversion_via_api_params_handler():
"""Response-style function tools are converted via ChatCompletionsAPIParamsHandler."""
Expand Down