Compute Providers
Every name compute= / run_on= / tools_run_on= accepts, and the exact command to install it
Pass a string like compute="e2b" and PraisonAI resolves it to a provider; if the provider isn’t installed, the SDK raises ImportError with the exact command to fix it.
graph LR
S[🧵 compute= / run_on=<br/>string] --> R[🔀 resolve_compute]
R --> W[📦 Wrapper-delegated<br/>e2b · modal · daytona · docker]
R --> A[🧰 Sandbox-adapted<br/>novita · sandlock · ssh]
R --> C[🔑 Credential-only<br/>flyio · tenki]
classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
classDef output fill:#10B981,stroke:#7C90A0,color:#fff
class S input
class R process
class W,A,C outputQuick Start
- Pick a provider by name
python from praisonaiagents import Agent agent = Agent(name="runner", tools_run_on="e2b") # or docker, modal, daytona, novita, ssh, flyio, tenki agent.start("Print the Python version.") - Not installed? Follow the hint
text ImportError: compute='e2b' requires praisonai.integrations.compute.e2b. pip install 'praisonai[e2b]'
Provider matrix
Every name resolves to one of three families, each with its own install shape.
| Name | Family | Install / requirement | Extra env var |
|---|---|---|---|
e2b | wrapper-delegated | pip install 'praisonai[e2b]' | E2B_API_KEY |
modal | wrapper-delegated | pip install 'praisonai[modal]' | Modal auth |
daytona | wrapper-delegated | pip install 'praisonai[daytona]' | DAYTONA_API_KEY |
docker | wrapper-delegated | pip install 'praisonai[docker]' | (local daemon) |
novita | sandbox-adapted | pip install 'praisonai-sandbox[novita]' | NOVITA_API_KEY |
sandlock | sandbox-adapted | pip install 'praisonai-sandbox[sandlock]' | Linux ≥ 6.12 with landlock |
ssh | sandbox-adapted | pip install 'praisonai-sandbox[ssh]' | SSH access |
flyio | credential-only | (no pip install) | FLY_API_TOKEN |
tenki | credential-only | (no pip install) | TENKI_API_KEY / TENKI_AUTH_TOKEN |
Why three families?
The install shape follows what each provider needs at runtime.
graph TB
Q{What does the provider need?}
Q -->|Wrapper module + vendor SDK| W["pip install 'praisonai[vendor]'"]
Q -->|Only the sandbox package| A["pip install 'praisonai-sandbox[vendor]'"]
Q -->|Just a credential| C["export TOKEN=..."]
classDef question fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef answer fill:#10B981,stroke:#7C90A0,color:#fff
class Q question
class W,A,C answer| Family | Members | Why |
|---|---|---|
| Wrapper-delegated | e2b, modal, daytona, docker | Need both the praisonai.integrations.compute.* module and the vendor SDK. praisonai[<vendor>] pulls the wrapper and delegates to praisonai-sandbox[<vendor>] for the SDK — the sandbox package alone would leave the module import failing. |
| Sandbox-adapted | novita, sandlock, ssh | Live only in praisonai-sandbox and reach the compute path via SandboxComputeAdapter — the wrapper isn’t needed. |
| Credential-only | flyio, tenki | Speak plain HTTP through aiohttp (already required by praisonaiagents). No vendor SDK, so exporting the credential is the whole install step. |
How resolution works
resolve_compute() maps the string to a provider, then imports it lazily so a missing SDK only fails when you actually use that name.
sequenceDiagram
participant User
participant Agent
participant Resolver
participant Provider
User->>Agent: tools_run_on="e2b"
Agent->>Resolver: resolve_compute("e2b")
Resolver->>Provider: import praisonai.integrations.compute.e2b
alt import succeeds
Provider-->>Agent: E2BCompute()
else import fails
Provider-->>User: ImportError + "pip install 'praisonai[e2b]'"
endCommon Patterns
Switch provider from an env var
Read the target from configuration so the agent code never changes.
import os
from praisonaiagents import Agent
agent = Agent(name="runner", tools_run_on=os.environ.get("RUN_ON", "docker"))
agent.start("Run the test suite.")Credential-only providers need no install
Fly.io and Tenki resolve with just a token exported.
import os
from praisonaiagents import Agent
os.environ["TENKI_API_KEY"] = "your-tenki-api-key" # or FLY_API_TOKEN for flyio
agent = Agent(name="runner", tools_run_on="tenki")
agent.start("Print the kernel version.")Best Practices
Single-quote every install command
Shells like zsh treat praisonai[e2b] as a glob. Copy-paste pip install 'praisonai[e2b]' exactly as the SDK prints it to avoid no matches found.
Upgrade before trusting cached advice
If pip warns does not provide the extra 'e2b', you are on a pre-PR #4073 release where the extra was absent or empty. Upgrade praisonai — the fix makes the extra real.
Use praisonai-sandbox for sandbox-adapted names
novita, sandlock, and ssh resolve through SandboxComputeAdapter, so the sandbox package alone is enough — pip install 'praisonai-sandbox[<vendor>]'.
Pass an SSH object, not the bare name
ssh needs connection details a plain string cannot carry. Pass SSHSandbox(host='...', user='...') to compute= so it can carry the host.