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.
- Docs: https://docs.podflare.ai
- Dashboard: https://dashboard.podflare.ai — mint an API key in seconds
- GitHub: https://github.com/PodFlare-ai/podflare
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_executiontool —podflare.adapters.anthropic - MCP server (
podflare-mcpnpm 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file podflare-0.0.5.tar.gz.
File metadata
- Download URL: podflare-0.0.5.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add253048f7df1f76a34f7fc1b67253282ae533ac47a8dcfed3b502964613b2d
|
|
| MD5 |
f42f9d4d8542dc2727374801a9e17a83
|
|
| BLAKE2b-256 |
63b86a4f11c9f327f897f1e4d9269e44cc08d0856cd799db408b10dbc15326ed
|
File details
Details for the file podflare-0.0.5-py3-none-any.whl.
File metadata
- Download URL: podflare-0.0.5-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add936e3c34454f9f51a2a59fdde32f0b62eda16c725b8884ae6089fc03ff414
|
|
| MD5 |
d7aa3b020bc12819290c8deec422f75b
|
|
| BLAKE2b-256 |
28d1b6382fcd0388b5c744fe5cea6e1bc339a470616e1a375b8be0fe7ed283c1
|