Tenki Cloud Agents

Run managed agents in Tenki Cloud disposable Linux microVMs

Tenki Cloud agents run in disposable Linux microVMs — provisioned in seconds, torn down when done.

Diagram

Tenki Cloud Flow

📝 Request

⚡ microVM

🐍 Stock Image

🔧 exec / files

🧠 LLM

✅ Result

Quick Start

  1. Set the API key
    bash
    export TENKI_API_KEY="your-tenki-api-key"

    TENKI_AUTH_TOKEN works too. No extra pip install is required for the compute path — the credential is enough. The Tenki runtime speaks plain HTTP through aiohttp, which praisonaiagents already requires.

  2. Simplest agent
    python
    from praisonaiagents import Agent
    from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig
    
    managed = ManagedAgent(
        provider="local",
        config=ManagedConfig(model="gpt-4o-mini", name="TenkiAgent"),
        compute="tenki",  # requires TENKI_API_KEY
    )
    agent = Agent(name="tenki-agent", backend=managed)
    
    agent.start("Run `python3 -c 'print(2**10)'` and tell me the answer.")
  3. With pip packages pre-installed
    python
    import asyncio
    from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig
    
    managed = ManagedAgent(
        provider="local",
        config=ManagedConfig(model="gpt-4o-mini"),
        compute="tenki",
        compute_config={"packages": {"pip": ["pandas"]}},
    )
    
    info = asyncio.run(managed.provision_compute())
    result = asyncio.run(managed.execute_in_compute(
        "python3 -c 'import pandas; print(pandas.__version__)'"
    ))
    print(result["stdout"])
    asyncio.run(managed.shutdown_compute())

How It Works

Diagram
microVMTenkiManagedAgentAgentUsermicroVMTenkiManagedAgentAgentUserRequestExecutecreate()Boot stock imageReady (seconds)Sandbox handleexec / file I/OResultsResponseOutput

Tenki boots a fresh Linux microVM per sandbox. Commands run through ephemeral exec; files move as base64 over the same channel. The stock image ships python3 — everything else installs on demand.


Configuration Options

Authenticate with an API key. One of the two token variables is required.

Env varPurposeRequired
TENKI_API_KEY or TENKI_AUTH_TOKENAuth against Tenki CloudYes (one of)
TENKI_WORKSPACE_IDPin sandboxes to a specific workspaceNo (auto-picks first)

ComputeConfig fields honoured by Tenki:

FieldTypeDefaultEffect on Tenki
cpufloat1.0microVM CPU cores (cpu_cores)
memory_mbint512microVM RAM
env`dict \None`NoneEnvironment variables inside the VM
networkingdict{"type": "unrestricted"}Only "unrestricted" allows outbound; anything else (e.g. "limited") disables it entirely
imagestr(SDK default)Used only if you override the default. Tenki’s registry is a snapshot store (no Docker pull-through) — an unchanged default means “boot Tenki’s stock image.”
metadata["tenki_image"]str—Takes precedence over image. Boots a prebaked Tenki snapshot.
auto_shutdownboolTrueEnables idle timeout
idle_timeout_sint300Converted to idle_timeout_minutes (min 1)
packages["pip"]list[str][]Installed at provision (pip3 bootstrapped if missing)
packages["npm"]list[str][]Installed at provision (npm bootstrapped if missing)

Common Patterns

Data analysis with pandas

python
import asyncio
from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig

managed = ManagedAgent(
    provider="local",
    config=ManagedConfig(model="gpt-4o-mini"),
    compute="tenki",
    compute_config={"packages": {"pip": ["pandas"]}},
)

info = asyncio.run(managed.provision_compute())
result = asyncio.run(managed.execute_in_compute(
    "python3 -c 'import pandas as pd; print(pd.Series([1,2,3,4,5]).mean())'"
))
print(result["stdout"])
asyncio.run(managed.shutdown_compute())

Web scraping

python
import asyncio
from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig

managed = ManagedAgent(
    provider="local",
    config=ManagedConfig(model="gpt-4o-mini"),
    compute="tenki",
    compute_config={"packages": {"pip": ["requests", "beautifulsoup4"]}},
)

info = asyncio.run(managed.provision_compute())
result = asyncio.run(managed.execute_in_compute(
    "python3 -c \"import requests; print(requests.get('https://httpbin.org/get').status_code)\""
))
print(result["stdout"])
asyncio.run(managed.shutdown_compute())

Custom Tenki image

python
import asyncio
from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig

managed = ManagedAgent(
    provider="local",
    config=ManagedConfig(model="gpt-4o-mini"),
    compute="tenki",
    compute_config={"metadata": {"tenki_image": "my-prebaked-snapshot"}},
)

info = asyncio.run(managed.provision_compute())
result = asyncio.run(managed.execute_in_compute("python3 --version"))
print(result["stdout"])
asyncio.run(managed.shutdown_compute())

Disable outbound networking

python
import asyncio
from praisonai.integrations.managed_agents import ManagedAgent, ManagedConfig

managed = ManagedAgent(
    provider="local",
    config=ManagedConfig(model="gpt-4o-mini"),
    compute="tenki",
    compute_config={"networking": {"type": "limited"}},  # any non-"unrestricted" turns outbound OFF
)

info = asyncio.run(managed.provision_compute())
result = asyncio.run(managed.execute_in_compute("python3 -c 'print(1 + 1)'"))
print(result["stdout"])
asyncio.run(managed.shutdown_compute())

Best Practices

Pick the right provider

Tenki gives ephemeral microVMs with no template registry — ideal for short, disposable runs. Use E2B for instant pre-built templates, or Docker for local, reproducible containers.

Package installs happen at provision

A failed install tears the sandbox down. Don’t rely on the pip field for large dependency sets — bake them into a prebaked snapshot and boot it via metadata["tenki_image"] instead.

Sandboxes bill while alive

Always call shutdown_compute() when done, and set idle_timeout_s so an idle microVM self-terminates.

Network policy is boolean

Tenki cannot express per-host allowlists. networking={"type": "unrestricted"} allows outbound; anything else (including "limited") disables it entirely.


Use across a whole team

Give a whole team or workflow one shared Tenki microVM by setting run_on="tenki" on the flow or team.

python
from praisonaiagents import AgentFlow

flow = AgentFlow(run_on="tenki", steps=[...])

See Shared Sandbox and Placement for the full run_on= behaviour.


Related