-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: add Atlas Cloud provider integration guide #2145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
|
Comment on lines
+24
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # 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) | ||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPENAI_API_KEYto hold an Atlas Cloud key is confusing and dangerous: a developer who already hasOPENAI_API_KEYset 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.