Skip to content
/

Tensorlake

tensorlake · tensorlakeai/tensorlake · ★ 926 · last commit 2026-05-26

Primitive shape
No installable primitives
00

Summary

Tensorlake — Summary

Tensorlake is a serverless compute infrastructure platform combining two products: (1) Sandbox API — Firecracker MicroVM sandboxes with sub-second cold starts, snapshot/clone capabilities, auto-suspend/resume, and near-SSD storage performance; and (2) Orchestrate — a serverless function runtime with @application/@function decorators for deploying distributed agent pipelines with fan-out/fan-in. Both surfaces are cloud-hosted (cloud.tensorlake.ai) with a tensorlake CLI and Python SDK. Performance benchmarks in the README place Tensorlake at 2.45s SQLite completion vs. E2B (3.92s, 1.6x slower) and Daytona (5.51s, 2.2x slower), positioning it as the fastest MicroVM sandbox.

Tensorlake is most similar to e2b from the canonical Phase B Batch 18/33 sandbox seeds (both Firecracker MicroVM, cloud-hosted, sub-second startup), but differentiates via: fastest storage I/O benchmarks, snapshot/clone during runtime (not just at creation), auto-suspend with memory+filesystem preservation, live migration between machines, support for up to 5 million sandboxes per project, and an integrated serverless orchestration runtime.

01

Overview

Tensorlake — Overview

Origin

Tensorlake is a compute infrastructure company. The open-source repo contains the Python/TypeScript SDKs and Rust crates for the Tensorlake cloud service. The CLAUDE.md and AGENTS.md files indicate the team uses Claude Code and OpenAI Codex for internal development.

Philosophy

From the README:

"Tensorlake is a compute infrastructure platform for building agentic applications with sandboxes."

"The Sandbox API creates MicroVM sandboxes which you can use to run agents, or use them as an isolated environment for running tools or LLM generated code."

The explicit performance positioning:

"Fastest Filesystem I/O — Block-based storage achieving near-SSD speeds inside virtual machines. In SQLite benchmarks (2 vCPUs, 4 GB RAM), Tensorlake completes in 2.45s vs Vercel 3.00s (1.2×), E2B 3.92s (1.6×), Modal 4.66s (1.9×), and Daytona 5.51s (2.2×)."

The orchestration philosophy:

"Decorate your entrypoint with @application() and functions with @function(). Each function runs in its own isolated sandbox."

Each function in the serverless runtime runs in its own sandbox — this is the key architectural opinion: isolation-by-default at the function level.

Key Technical Claims

  1. Sub-second cold starts via Lattice (dynamic cluster scheduler)
  2. Snapshot at any point (not just at creation) with clone-from-snapshot
  3. Auto suspend/resume — preserves full memory + filesystem state
  4. Live migration between machines with only seconds of pause
  5. Up to 5 million sandboxes per project
  6. Block-based storage (near-SSD I/O, not network filesystem)
02

Architecture

Tensorlake — Architecture

Distribution

  • Python: pip install tensorlake
  • TypeScript: npm install tensorlake (from typescript/ dir)
  • CLI: tensorlake (installed with pip install tensorlake)

Directory Structure

src/
  tensorlake/
    applications/   # @application/@function decorator runtime
    sandbox/        # SandboxClient
    cli/            # tensorlake CLI (Click-based)
    documentai/     # DocumentAI SDK (separate product)
    function_executor/  # gRPC server for function execution
    cloud_client.py
    builder/
    image.py
    utils/
crates/
  cli/              # Rust CLI components
  cloud-sdk/        # Rust cloud SDK
  rust-cloud-sdk-node/  # Node.js bindings
  rust-cloud-sdk-py/    # Python bindings for Rust SDK
typescript/         # TypeScript SDK
examples/           # Reference application examples
reference_app/      # Reference implementation
tests/

Required Runtime

  • Python >= 3.10
  • Poetry 2.0.0
  • TENSORLAKE_API_KEY env var
  • uv (optional, for CLI install)
  • Go 1.25+ (optional, for building from source)

Install Complexity

Multi-step (pip + API key). CLI: pip install tensorlake or uv tool install tensorlake.

Sandbox Architecture

  • Compute: Firecracker MicroVM
  • Scheduler: Lattice (dynamic cluster scheduler)
  • Storage: Block-based (near-SSD speeds)
  • Snapshots: Point-in-time filesystem + memory state
  • Network: Per-sandbox isolation

CLI Commands

tensorlake sbx create --image <image>
tensorlake sbx exec <id> -- <cmd>
tensorlake sbx cp <local> <id>:<remote>
tensorlake sbx ssh <id>
tensorlake sbx terminate <id>
tensorlake login
tensorlake deploy <app.py>
tensorlake secrets set <KEY> <value>
tensorlake parse  # DocumentAI
03

Components

Tensorlake — Components

Sandbox SDK (tensorlake.sandbox)

SandboxClient

  • SandboxClient.for_cloud(api_key) — Create client
  • client.create_and_connect(image) — Context-managed sandbox
  • client.create(image, name) — Named sandbox (reconnectable)
  • client.connect(sandbox_id_or_name) — Reconnect to existing
  • client.snapshot_and_wait(sandbox_id) — Create snapshot
  • client.create(snapshot_id=...) — Restore from snapshot
  • client.create_pool(image, warm_containers) — Pre-warm pool
  • client.claim(pool_id) — Instant sandbox from pool

Sandbox Instance

  • sandbox.run(cmd, args) — Execute command, returns stdout/stderr
  • sandbox.write_file(path, content) — Write file to sandbox
  • sandbox.read_file(path) — Read file from sandbox
  • sandbox.start_process(cmd, args) — Start long-running process

Orchestration SDK (tensorlake.applications)

Decorators

  • @application(tags=...) — Mark Python function as orchestration entrypoint
  • @function(description, secrets, image) — Mark function for isolated sandbox execution

Image Definition

  • Image(base_image, name).run("pip install ...") — Custom sandbox image

Execution

  • tl deploy <app.py> — Deploy application
  • curl https://api.tensorlake.ai/applications/<name> — HTTP invocation
  • SSE streaming support

CLI (tensorlake / tl)

  • tensorlake sbx create — Create sandbox
  • tensorlake sbx exec — Execute command
  • tensorlake sbx cp — Copy file
  • tensorlake sbx ssh — Interactive terminal
  • tensorlake sbx terminate — Destroy sandbox
  • tensorlake login — Authenticate
  • tensorlake deploy — Deploy application
  • tensorlake secrets set/get — Manage secrets

DocumentAI SDK (separate product)

  • Document parsing, extraction, classification
  • Separate from sandbox/orchestration products
05

Prompts

Tensorlake — Prompts

Verbatim Excerpt 1: Orchestrate with OpenAI Agents (from README)

from agents import Agent, Runner
from agents.tool import WebSearchTool, function_tool
from tensorlake.applications import application, function, Image

FUNCTION_CONTAINER_IMAGE = Image(base_image="python:3.11-slim", name="city_guide_image").run(
    "pip install openai openai-agents"
)

@function_tool
@function(
    description="Gets the weather for a city using an OpenAI Agent with web search",
    secrets=["OPENAI_API_KEY"],
    image=FUNCTION_CONTAINER_IMAGE,
)
def get_weather_tool(city: str) -> str:
    """Uses an OpenAI Agent with WebSearchTool to find current weather."""
    agent = Agent(
        name="Weather Reporter",
        instructions="Use web search to find current weather in Fahrenheit for the city.",
        tools=[WebSearchTool()],
    )
    result = Runner.run_sync(agent, f"City: {city}")
    return result.final_output.strip()

Technique: Infrastructure-as-code pattern for agent deployment. @function decorator marks execution units as isolated sandbox functions. The docstring becomes the function description. Agent instructions follow the "role + task" system prompt pattern.


Verbatim Excerpt 2: Sandbox Programmatic Usage (from README)

from tensorlake.sandbox import SandboxClient

client = SandboxClient.for_cloud(api_key="your-api-key")

with client.create_and_connect(image="tensorlake/ubuntu-minimal") as sandbox:
    # Run a command
    result = sandbox.run("sh", ["-lc", "printf 'Hello from the sandbox!\\n'"])
    print(result.stdout)

    # Write and read files
    sandbox.write_file("/tmp/data.txt", b"some data")
    content = sandbox.read_file("/tmp/data.txt")

    # Start a long-running process
    proc = sandbox.start_process("sleep", ["300"])
    print(proc.pid)
# Sandbox auto-terminates on context exit

Technique: Context-manager-based sandbox lifecycle. Standard Python idiom — auto-cleanup on exit.


Observations

Tensorlake ships no pre-authored agent behavior prompts. It is a compute infrastructure platform. The CLAUDE.md and AGENTS.md files provide instructions for contributors working on the framework itself, not behavior shipped to end users.

09

Uniqueness

Tensorlake — Uniqueness

Differs From Seeds

Tensorlake is most similar to e2b from the Phase B Batch 18/33 canonical sandbox seeds (both Firecracker MicroVM, cloud-hosted, SDK-first). Key differentiators: (1) Fastest I/O: block-based storage achieving near-SSD speeds — benchmarked 1.6x faster than E2B in SQLite workloads; (2) Snapshot/clone at runtime (not just at creation) with full memory preservation; (3) Auto-suspend/resume transparent to the SDK; (4) 5 million sandbox scale; (5) Integrated serverless orchestration (@application/@function) that co-deploys the agent pipeline alongside the sandbox infrastructure — not just a sandbox API. The Orchestrate product is the most distinctive differentiator: automatic fan-out with each decorated function running in its own isolated MicroVM is not available in any seed framework.

Positioning

The highest-performance Firecracker MicroVM sandbox platform with an integrated serverless orchestration runtime. Explicitly benchmarks against E2B, Modal, Vercel, and Daytona — positioned as the performance leader in the cloud sandbox space.

Observable Failure Modes

  1. Cloud-only: No local deployment or self-hosting — full API dependency
  2. Python-primary: The orchestration SDK is Python-only; no JS/Go serverless functions
  3. Proprietary image format: tensorlake/ubuntu-minimal — not arbitrary Docker images
  4. No pre-built behaviors: Pure infrastructure, zero behavioral opinions
  5. gRPC complexity: Function executor uses gRPC with pinned grpcio-tools version (1.60.0) — regenerating stubs is fragile

What Makes It Interesting

The combination of fastest-in-class storage I/O benchmarks + runtime snapshots + serverless fan-out in one platform is not seen in any seed or batch-30 framework. The AGENTS.md reveals the team uses AI agents to build their own product.

04

Workflow

Tensorlake — Workflow

Sandbox Workflow

Phase Artifact Description
Setup API key tensorlake login
Create Sandbox (MicroVM) tensorlake sbx create --image tensorlake/ubuntu-minimal
Use Command results, files tensorlake sbx exec <id> or SDK
Snapshot Snapshot ID client.snapshot_and_wait(id) — point-in-time state
Resume Restored sandbox client.create(snapshot_id=...)
Pool (optional) Pre-warm 3+ VMs client.create_pool(image, warm_containers=3)
Terminate (resources freed) tensorlake sbx terminate <id> or context manager exit

Orchestrate Workflow

Phase Artifact Description
Define Decorated Python functions @application, @function decorators
Build Container image Image(base_image=...).run("pip install ...")
Set Secrets Env vars in cloud tl secrets set KEY val
Deploy Live HTTP endpoint tl deploy app.py
Invoke {"request_id": ...} curl .../applications/<name>
Collect Result JSON curl .../requests/<id>/output
Stream SSE events curl -H "Accept: text/event-stream"

Fan-Out Pattern

Each @function runs in its own isolated sandbox. Multiple function calls from one @application invocation run in parallel in separate MicroVMs — implicit parallelism via decorator composition.

Auto Suspend/Resume

Sandboxes auto-suspend when idle and resume (with full state) in under a second — no explicit user action needed.

Live Migration

Sandboxes migrate between machines automatically during cluster updates. Only a brief (few second) pause.

06

Memory Context

Tensorlake — Memory & Context

State Storage

  • Sandbox filesystem: Ephemeral by default, but preserved on auto-suspend
  • Snapshots: Point-in-time memory + filesystem checkpoints — the primary persistence mechanism
  • Named sandboxes: Reconnectable by name (client.connect("stable-name"))

Memory Type

File-based (sandbox filesystem via block storage). Snapshots are the closest to persistent memory.

Snapshots as Memory

# Save state at any point
snapshot = client.snapshot_and_wait(sandbox_id)

# Later, restore exact state (memory + filesystem)
with client.create_and_connect(snapshot_id=snapshot.snapshot_id) as sandbox:
    # Picks up right where you left off
    result = sandbox.run("ls", ["/tmp"])

Snapshots preserve the full VM state including in-flight processes, open files, and memory contents. This is a stronger form of persistence than file-based save/restore.

Cross-Session Handoff

Yes — via snapshots or named sandboxes. A snapshot created after an agent run can be resumed in a new session, preserving all agent state.

Auto-Suspend State

Sandboxes automatically suspend (preserving full memory + filesystem) when idle and resume in under a second. This is transparent to the SDK caller — resume is implicit on next operation.

Context Compaction

Not handled. Delegated to the consuming agent's LLM context management.

State Files

None at the SDK level. Application state lives inside sandbox filesystem.

07

Orchestration

Tensorlake — Orchestration

Multi-Agent Support

Yes — the Orchestrate product supports fan-out: one @application call can spawn multiple @function calls, each in its own isolated sandbox, running in parallel.

Orchestration Pattern

Parallel-fan-out — the @application / @function decorator composition enables implicit parallelism. Each decorated function becomes an independently-scheduled sandbox execution.

Isolation Mechanism

MicroVM (Firecracker). Each @function call = separate MicroVM. The Lattice scheduler handles allocation across the cluster.

Subagent Definition Format

code-class — Python decorated functions serve as the unit of parallelism. Not a persona-md or YAML definition.

Multi-Model Usage

Not built-in. Each @function can call any LLM API if secrets are injected.

Execution Mode

Serverless (event-driven via HTTP invocation). Async or synchronous HTTP calls; SSE for streaming.

Max Concurrent Sandboxes

Up to 5 million per project (documented claim).

Startup Time

Sub-second cold start (Lattice scheduler + pre-allocated resources).

Auto-Suspend

Sandboxes suspend on idle and resume automatically — no explicit state management needed.

Crash Recovery

Yes — via snapshots. If a sandbox crashes, restore from a previous snapshot.

Live Migration

Yes — sandboxes migrate between host machines automatically during cluster updates. Brief pause only.

Streaming Output

Yes — SSE streaming for @application HTTP endpoints.

08

Ui Cli Surface

Tensorlake — UI / CLI Surface

CLI Binary

  • Name: tensorlake (also aliased as tl)
  • Installed via: pip install tensorlake
  • Not a wrapper — own runtime, manages cloud resources directly

CLI Subcommands

tensorlake login              # Authenticate with API key
tensorlake sbx create         # Create sandbox
tensorlake sbx exec <id>      # Execute command in sandbox
tensorlake sbx cp <src> <dst> # Copy file into/out of sandbox
tensorlake sbx ssh <id>       # Interactive SSH terminal
tensorlake sbx terminate <id> # Destroy sandbox
tensorlake deploy <app.py>    # Deploy orchestration application
tensorlake secrets set/get    # Manage secrets
tensorlake parse              # DocumentAI parsing

Local Web UI

None — no local dashboard. Cloud console at cloud.tensorlake.ai (external managed service, not open-source).

Observability

  • Logs: unknown (not documented in README)
  • Traces: not documented
  • Cloud console visibility (external)

IDE Integration

None. SDK + CLI only.

Cross-Tool Portability

High — works with any Python agent framework (OpenAI Agents SDK, LangChain, custom). Not tied to any AI client or IDE.

AGENTS.md / CLAUDE.md

The repo ships both AGENTS.md and CLAUDE.md — instruction files for Claude Code and Codex agents contributing to the framework itself. Not shipped-to-users behavioral content.

Related frameworks

same archetype · same primary tool · same memory type

Daytona ★ 72k

Provide secure, elastic, sub-90ms sandbox compute infrastructure for running AI-generated code, accessible via multi-language…

CUA ★ 17k

Unified SDK for building, benchmarking, and deploying agents that interact with full OS GUIs via isolated VMs.

E2B ★ 12k

Run AI-generated code safely in cloud-hosted isolated sandboxes via a 3-line SDK integration.

OpenSandbox ★ 11k

Protocol-first general-purpose sandbox platform for AI applications with multi-language SDKs and pluggable isolation backends.

Microsandbox ★ 6.3k

Spawn hardware-isolated microVMs as child processes directly from application code, with no server setup, in under 100ms.

CubeSandbox ★ 5.9k

Sub-60ms KVM microVM sandboxes for AI agents with E2B drop-in compatibility and <5MB memory overhead.