Skip to main content

synapserun

The E2B-compatible sandbox that runs your code on Wasm. 200× faster cold start. Canadian sovereign. Cryptographic execution receipts.

PyPI npm Python 3.9+ License: Proprietary

Install

pip install synapserun

The install bundles real CPython 3.12 and QuickJS 0.14 compiled to Wasm. Local execution works with zero configuration — no Docker, no gateway, no API key needed for the api_url="local" path.

For Node.js:

npm install synapserun

Quick Start — 5 seconds to first execution

from synapse.cell import Cell

cell = Cell(api_url="local")
result = cell.run("print(2 + 2)")
print(result.stdout)      # '4\n'
print(result.latency_ms)  # ~0.5ms (simple path) / ~63ms (full CPython)
cell.kill()

Full CPython — decorators, generators, async, any stdlib import

with Cell(api_url="local") as cell:
    result = cell.run("""
import hashlib, json
def sign(data: bytes) -> str:
    return hashlib.sha256(data).hexdigest()
print(json.dumps({"sig": sign(b'hello')}))
""")
    print(result.stdout)
    # {"sig": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"}

JavaScript via QuickJS-WASI

cell = Cell(api_url="local", template="javascript")
result = cell.run("console.log([1,2,3].reduce((a,b) => a+b))")
print(result.stdout)  # '6'
cell.kill()

E2B drop-in replacement

Already using E2B? Change one import:

# Before:
# from e2b_code_interpreter import Sandbox

# After:
from synapse.e2b_compat import Sandbox

sbx = Sandbox(api_url="local")
result = sbx.run_code("print('hello')")
print(result.stdout)

Every major E2B method is supported: run_code, files.read/write/list, commands.run, kill, connect, pause/resume, get_info, and more.

What's in the box

  • Real Python 3.12 (CPython-WASI) — decorators, generators, async, eval, open, arbitrary import, full stdlib
  • Real JavaScript (QuickJS-WASI) — ES2023, await, closures, typed arrays
  • Sub-millisecond .syn transpile path for simple arithmetic
  • Filesystem API — cell.files.write/read/list/exists/get_info/make_dir
  • Git namespace — cell.git.clone/commit/push/pull/checkout/... (21 methods)
  • PTY terminal — cell.pty.create(on_data=...) (needs pip install websocket-client)
  • Dockerfile transpiler — synapse template build -f Dockerfile
  • Framework integrations (soft imports — install frameworks separately):
    • LangChain: from synapse.langchain_tool import SynapseCellExecuteTool
    • CrewAI: from synapse.crewai_tool import SynapseCellCrewTool
    • AutoGen: from synapse.autogen_tool import SynapseCellExecutor
    • LlamaIndex: from synapse.llamaindex_tool import SynapseCellTool
    • OpenAI Agents SDK: from synapse.openai_agents_tool import synapse_cell_execute
  • Persistent Volumes — cell.volumes.write/read/delete/list_all (Pro license)
  • Async SDK — from synapse.async_cell import AsyncCell

Performance (measured 2026-04-15 vs live E2B)

Metric Cell E2B Delta
Simple eval (.syn transpile) 0.44 ms 91 ms 205× faster
Warm Python (CPython-WASI) 63 ms ~500 ms 8× faster
JavaScript execution 1.2 ms — —
Memory per sandbox ~1 MB ~133 MB 133× density
Execution receipts ✅ SHA-256 ❌ —
Jurisdiction 🇨🇦 / 🇪🇺 🇺🇸 —

Reproduce: python3 cell/benchmarks/e2b_apples_to_apples.py --runs 100

Deployment modes

Mode How When
Local (zero-config) Cell(api_url="local") Dev, CI, small workloads, bundled into your app
Self-hosted gateway Run the Rust gateway via Docker or native binary Production, custom hardware, fleet management

Dockerfile → Wasm template (the E2B replacement bridge)

synapse template build -f Dockerfile --install-packages

Handles 80% of AI-agent Dockerfiles:

  • FROM python:* / node:* → runtime selection
  • RUN pip install / npm install → package bundles
  • COPY, WORKDIR, ENV, USER, CMD, ENTRYPOINT → all mapped
  • RUN apt-get install git → warning + "Use cell.git.*"
  • Custom base images → clear error + migration hint

Examples: dockerfile_examples/

CLI

synapse auth --api-key cell_sk_...
synapse sandbox create --template python3 --persistent
synapse sandbox run <id> "print(42)"
synapse template build -f Dockerfile
synapse template list

Framework integrations

Tool classes are bundled in the wheel; frameworks are opt-in extras:

pip install synapserun[langchain]   # pulls langchain-core + pydantic
pip install synapserun[crewai]      # pulls crewai + pydantic
pip install synapserun[all]         # everything

Correctness guardrails

The SDK auto-selects between:

  1. Fast path (.syn transpile, sub-ms) — simple arithmetic, basic control flow
  2. Full path (real CPython-WASI, ~63ms) — anything with import of non-trivial modules, bytes literals, sys.exit, f-strings with format specs, string multiplication, etc.

You never have to pick. The fast path has strict correctness gates; anything it can't faithfully execute falls through to real CPython automatically.

License

Proprietary. Free tier for self-hosted use. Pro features require a license key. Contact hello@synapserun.dev for pricing.


Built by Freshfield AI, Canada 🇨🇦 — Wasm-native, sovereign, self-hosted.

Metadata

Release files for synapserun 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synapserun 0.5.2
File Size Uploaded Provenance Actions
synapserun-0.5.2.tar.gz 16.1 MB Without provenance Details for synapserun-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synapserun 0.5.2
File Interpreter ABI Platform Actions
synapserun-0.5.2-py3-none-any.whl Python 3 none any Details for synapserun-0.5.2-py3-none-any.whl

Total release size: 32.1 MB

Release files / synapserun-0.5.2.tar.gz

Download URL synapserun-0.5.2.tar.gz
Size 16.1 MB
Tags Source
SHA-256 checksum
How to use checksums
6707b7925735d2bac9991f88cf6abe3552d6e4095bba8c29581c79ce665d524c
BLAKE2b-256 checksum
How to use checksums
6b74f93e37ef879db20f29da5181ac587a76214739180e83216fa0e31737b6d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / synapserun-0.5.2-py3-none-any.whl

Download URL synapserun-0.5.2-py3-none-any.whl
Size 16.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e8a2e5ede71e11a897208a5b6ace0d18021df4fb3045ee418e54dbb220c4d43e
BLAKE2b-256 checksum
How to use checksums
61ee0589d9c7454cde4dad0f960e0047f52469d30c2a8c1b21171b24801574b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for synapserun 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page