Skip to main content

Podflare Python SDK — cloud sandbox for AI agents with 100ms fork() and persistent REPL.

Project description

Podflare — Python SDK

Cloud sandbox for AI agents. Fork in 100 ms, persistent Python REPL, run_code, upload/download, merge_into.

Install

pip install podflare

Quickstart

from podflare import Sandbox

# Create a sandbox (persistent Python REPL, preloaded libs on python-datasci)
sbx = Sandbox(template="python-datasci")

# Execute code — state persists across calls
sbx.run_code("x = 42")
print(sbx.run_code("print(x * 2)").stdout)  # "84"

# Fork — spawn N copies of the running sandbox
children = sbx.fork(n=5)
children[0].run_code("x = 100")   # isolated per branch

# Merge a branch back into the parent
sbx.merge_into(children[0])

# Upload + download files
sbx.upload("data.csv", open("local.csv", "rb").read())
sbx.run_code("import pandas as pd; df = pd.read_csv('data.csv')")

# Destroy
sbx.close()

Configuration

Env var Default What it does
PODFLARE_API_KEY (none — required) Bearer token from the dashboard (pk_live_...).
PODFLARE_HOSTD_URL https://api.podflare.ai Override for self-hosted or staging deployments.

You can also pass them as constructor arguments:

from podflare import Sandbox

sbx = Sandbox(
    host="https://api.podflare.ai",
    api_key="pk_live_...",
    template="default",
)

Streaming

with Sandbox() as s:
    for ev in s.run_code_stream("for i in range(3): print(i)"):
        if ev.type == "stdout":
            print(ev.data, flush=True)

Framework adapters

First-class integrations:

  • OpenAI Agents SDK — podflare.adapters.openai_agents
  • Anthropic code_execution tool — podflare.adapters.anthropic
  • MCP server (podflare-mcp npm package) for Claude Desktop / Cursor / Cline / Zed

See the integrations docs for copy-paste examples.

Links

License

Proprietary.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

podflare-0.0.6.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

podflare-0.0.6-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file podflare-0.0.6.tar.gz.

File metadata

  • Download URL: podflare-0.0.6.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for podflare-0.0.6.tar.gz
Algorithm Hash digest
SHA256 0a5edf9ad3454d6e9e75e1796445b5b256e040a13e31910d8748911270e7edb5
MD5 f8b6498fd2451cb8390a587f64fa9771
BLAKE2b-256 2bcb15ccc3e6adeeeb73b621d981df8526e2dd655da782bbb3142ecdf2f58fe0

See more details on using hashes here.

File details

Details for the file podflare-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: podflare-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for podflare-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 666515134e4065bb0fb789a9039780cb4f2c780767d289bb5c04cd5087c8abf0
MD5 13d4503b16b93c35a8062cf584f2a076
BLAKE2b-256 e7da2bfd4ad5a65bbbcf15cf42d7063fd27dc962ccb8455426e0cc811af3dc29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page