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.

Diagram

🧵 compute= / run_on=
string

🔀 resolve_compute

📦 Wrapper-delegated
e2b · modal · daytona · docker

🧰 Sandbox-adapted
novita · sandlock · ssh

🔑 Credential-only
flyio · tenki

Quick Start

  1. 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.")
  2. 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.

NameFamilyInstall / requirementExtra env var
e2bwrapper-delegatedpip install 'praisonai[e2b]'E2B_API_KEY
modalwrapper-delegatedpip install 'praisonai[modal]'Modal auth
daytonawrapper-delegatedpip install 'praisonai[daytona]'DAYTONA_API_KEY
dockerwrapper-delegatedpip install 'praisonai[docker]'(local daemon)
novitasandbox-adaptedpip install 'praisonai-sandbox[novita]'NOVITA_API_KEY
sandlocksandbox-adaptedpip install 'praisonai-sandbox[sandlock]'Linux ≥ 6.12 with landlock
sshsandbox-adaptedpip install 'praisonai-sandbox[ssh]'SSH access
flyiocredential-only(no pip install)FLY_API_TOKEN
tenkicredential-only(no pip install)TENKI_API_KEY / TENKI_AUTH_TOKEN

Why three families?

The install shape follows what each provider needs at runtime.

Diagram

Wrapper module + vendor SDK

Only the sandbox package

Just a credential

What does the provider need?

pip install ‘praisonai[vendor]’

pip install ‘praisonai-sandbox[vendor]’

export TOKEN=…

FamilyMembersWhy
Wrapper-delegatede2b, modal, daytona, dockerNeed 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-adaptednovita, sandlock, sshLive only in praisonai-sandbox and reach the compute path via SandboxComputeAdapter — the wrapper isn’t needed.
Credential-onlyflyio, tenkiSpeak 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.

Diagram
ProviderResolverAgentUserProviderResolverAgentUseralt[import succeeds][import fails]tools_run_on=”e2b”resolve_compute(“e2b”)import praisonai.integrations.compute.e2bE2BCompute()ImportError + “pip install ‘praisonai[e2b]'”

Common Patterns

Switch provider from an env var

Read the target from configuration so the agent code never changes.

python
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.

python
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.


Related