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.
Quick 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.
| 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.
Common 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.