Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ Powered by 100+ LLMs (OpenAI, Anthropic, Gemini & local models).
<img src="https://img.shields.io/badge/Databricks-FF3621?style=flat&logo=databricks&logoColor=white" alt="Databricks" />
<img src="https://img.shields.io/badge/Replicate-262626?style=flat" alt="Replicate" />
<img src="https://img.shields.io/badge/Cloudflare-F38020?style=flat&logo=cloudflare&logoColor=white" alt="Cloudflare" />
<img src="https://img.shields.io/badge/Atlas_Cloud-4F46E5?style=flat" alt="Atlas Cloud" />
</p>

<details>
<summary><strong>View all 24 providers with examples</strong></summary>
<summary><strong>View all 25 providers with examples</strong></summary>

| Provider | Example |
|----------|:-------:|
Expand Down Expand Up @@ -179,6 +180,7 @@ Powered by 100+ LLMs (OpenAI, Anthropic, Gemini & local models).
| SageMaker | [Example](examples/python/providers/sagemaker/sagemaker_example.py) |
| Moonshot | [Example](examples/python/providers/moonshot/moonshot_example.py) |
| vLLM | [Example](examples/python/providers/vllm/vllm_example.py) |
| Atlas Cloud | [Example](examples/python/providers/atlascloud/atlascloud_example.py) |

</details>

Expand Down
56 changes: 56 additions & 0 deletions examples/python/providers/atlascloud/atlascloud_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
Basic example of using Atlas Cloud with PraisonAI

Atlas Cloud (https://atlascloud.ai) is an OpenAI-compatible API gateway that
exposes 300+ models (DeepSeek, Llama, Qwen, and more) behind a single endpoint.

Because the endpoint is OpenAI-compatible, you can use it with PraisonAI by
passing an ``llm`` dict that points ``api_base`` at the Atlas Cloud endpoint.

Setup:
export OPENAI_API_KEY=<your-atlas-cloud-key> # e.g. apikey-xxxxxxxx
# or pass api_key="..." directly in the llm dict below
Comment on lines +10 to +12

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Using OPENAI_API_KEY to hold an Atlas Cloud key is confusing and dangerous: a developer who already has OPENAI_API_KEY set to a real OpenAI credential will silently send that key to Atlas Cloud (or, if they follow the setup instruction literally, they'll overwrite their OpenAI key). A dedicated env var avoids the collision entirely.

Suggested change
Setup:
export OPENAI_API_KEY=<your-atlas-cloud-key> # e.g. apikey-xxxxxxxx
# or pass api_key="..." directly in the llm dict below
Setup:
export ATLAS_CLOUD_API_KEY=<your-atlas-cloud-key> # e.g. apikey-xxxxxxxx
# or pass api_key="..." directly in the llm dict below


Find available model ids at https://api.atlascloud.ai/v1/models
"""

import os

from praisonaiagents import Agent

# Initialize Agent with Atlas Cloud (OpenAI-compatible endpoint)
agent = Agent(
instructions="You are a helpful assistant",
llm={
# Prefix with "openai/" so LiteLLM routes through the OpenAI-compatible path
"model": "openai/deepseek-ai/deepseek-v4-pro",
"api_base": "https://api.atlascloud.ai/v1",
"api_key": os.environ.get("OPENAI_API_KEY"), # your Atlas Cloud key

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The api_key lookup should use the dedicated ATLAS_CLOUD_API_KEY env var to match the updated setup instruction and avoid silently picking up a real OpenAI key from the environment.

Suggested change
"api_key": os.environ.get("OPENAI_API_KEY"), # your Atlas Cloud key
"api_key": os.environ.get("ATLAS_CLOUD_API_KEY"), # your Atlas Cloud key

},
Comment on lines +24 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The llm parameter is deprecated in praisonaiagents in favor of model. To align with the modern API and avoid deprecation warnings, use the model parameter to pass the configuration dictionary.

Suggested change
llm={
# Prefix with "openai/" so LiteLLM routes through the OpenAI-compatible path
"model": "openai/deepseek-ai/deepseek-v4-pro",
"api_base": "https://api.atlascloud.ai/v1",
"api_key": os.environ.get("OPENAI_API_KEY"), # your Atlas Cloud key
},
model={
# Prefix with "openai/" so LiteLLM routes through the OpenAI-compatible path
"model": "openai/deepseek-ai/deepseek-v4-pro",
"api_base": "https://api.atlascloud.ai/v1",
"api_key": os.environ.get("OPENAI_API_KEY"), # your Atlas Cloud key
},

)

# Example conversation
response = agent.start("Hello! Can you help me with a mathematical problem?")

# Example with mathematical reasoning
math_task = """
Solve this calculus problem step by step:
Find the derivative of f(x) = x^3 * e^(2x) using the product rule.
"""

response = agent.start(math_task)

# Example with code optimization
code_task = """
Optimize this Python function for better performance:

def find_duplicates(arr):
duplicates = []
for i in range(len(arr)):
for j in range(i+1, len(arr)):
if arr[i] == arr[j] and arr[i] not in duplicates:
duplicates.append(arr[i])
return duplicates
"""

response = agent.start(code_task)