Skip to main content
Snapshots support two snapshot types:
  • filesystem: captures filesystem state and restores with a cold boot.
  • memory: captures filesystem, memory, and running process state and restores with a warm start.
When you do not specify a type, Tensorlake uses filesystem by default. Snapshots are independent of sandbox lifecycle: once a snapshot reaches completed, the artifact persists after the source sandbox is terminated. This means you can snapshot an ephemeral sandbox before it ends, then restore that state into a new sandbox much later. If you only need to pause a single sandbox in place rather than produce a reusable artifact, use suspend/resume instead. Before running the examples, install the CLI or SDK and authenticate.

Snapshot Format

Content Addressable Streaming (CAS) is Tensorlake’s format for sandbox images and snapshots. A sandbox created from a CAS image or snapshot starts running before its contents have been downloaded from the underlying blob storage. The missing parts stream in the background at high throughput, while the memory and I/O requests the sandbox makes are served at high priority to keep their latency low. Images and snapshots are deduplicated, so only data that isn’t already cached locally is downloaded. The result is fast and consistent cold starts, with extra disk read latency only for a short time after creation. Users are only billed for unique bytes in their images and snapshots.

Creating a Snapshot

The CLI and checkpoint() wait until the snapshot is resumable (local_ready or completed). local_ready does not mean the snapshot has finished uploading to durable storage. To wait for completed, set wait_until="completed" in Python or waitUntil: "completed" in TypeScript.

Restoring from a Snapshot

Create a new sandbox from a snapshot. If the snapshot is filesystem (default), the new sandbox restores the captured filesystem. You can change sandbox resources (CPU, memory, disk) for the new sandbox. If the snapshot is memory, the new sandbox restores filesystem, memory, and running processes exactly as they were. Image, resources (CPUs, memory), and entrypoint come from the snapshot and cannot be changed at restore time. You can resize resources after restoring. For filesystem snapshots, you can pass --disk_mb in the CLI, disk_mb in Python, diskMb in TypeScript, or resources.disk_mb in HTTP at restore time to grow root disk size (growth-only).

Copy a Sandbox

Cloning a sandbox is done with tl sbx copy or sandbox.copy() in either SDK. It boots one or more new sandboxes from a running, suspended, or resume-failed source, restoring filesystem, memory, and running processes so each copy warm-starts. Use -n in the CLI or times in the SDKs to create several copies from the same source in one call. The source can be running, suspended, or resume_failed. A running source is copied directly from the executor hosting it. A suspended or resume-failed source uses its retained checkpoint, which must still be available and ready to copy. A recoverable resume failure preserves the original snapshot_id; it does not invalidate an otherwise usable checkpoint. Copying or exporting that checkpoint remains available subject to checkpoint readiness. A copy gets a new sandbox ID and does not retry the source. To recover the same sandbox, retry resume explicitly. Copies inherit the source’s image, resources, entrypoint, network policy, and exposed ports. Names are unique per namespace, so copies cannot reuse the source’s name. A copy of a named sandbox is named <source-name>-copy by default, which keeps it suspendable and resumable like its source; an unnamed sandbox terminates at its idle timeout instead. In the HTTP API, pass name to choose the name yourself; with more than one copy it is suffixed -1..-N.
The SDKs return metadata for each copy. Inspect status and reason for partial failures. request_timeout in Python and requestTimeout in TypeScript set the copy request timeout in seconds.

Managing Snapshots

List Snapshots

The CLI and HTTP examples list snapshots in the current namespace. sandbox.list_snapshots() and sandbox.listSnapshots() list snapshots from that sandbox.

Get Snapshot Details

Delete a Snapshot

checkpoint() Parameters

Call checkpoint() on the sandbox handle with these options: With wait=True / wait: true, checkpoint() returns snapshot metadata. With wait=False / wait: false, it requests the snapshot without waiting and returns None in Python or undefined in TypeScript. CheckpointType and SnapshotWaitCondition are exported from tensorlake.sandbox (Python) and @tensorlakeai/tensorlake (TypeScript). TypeScript accepts "memory" / "filesystem" for checkpointType and "local_ready" / "completed" for waitUntil in CheckpointOptions.

Lifecycle

Create, suspend, resume, and terminate sandboxes: the operations snapshots build on.

Build and Import Images

Build reusable images. Pair with snapshots for warm starts on top of pinned dependencies.

Computer Use

Snapshot a warmed-up ubuntu-vnc desktop and fork parallel agent sessions.

Drive Chrome over CDP

Snapshot a Chrome profile so parallel browser agents start with cookies and history already in place.