Create a snapshot
- Python
- TypeScript
SnapshotInfo model
Restore from a snapshot
Pass asnapshot_id to Sandbox.create() to start a new sandbox that resumes from that state.
- Python
- TypeScript
List snapshots
- Python
Lifecycle during snapshot
Whencreate_snapshot() is called, the sandbox briefly pauses to capture a consistent memory image and then resumes automatically. The sandbox continues running after the snapshot completes.
The snapshotting pause is typically under one second for sandboxes with 256 MB of RAM.
Use cases
Warm-start sandboxes
Warm-start sandboxes
Install heavy ML libraries once, snapshot the result, then create new sandboxes from that snapshot for every request. Eliminates the
pip install torch overhead from every run.Checkpoint long-running tasks
Checkpoint long-running tasks
Snapshot a sandbox mid-computation so you can restore it if the run fails.
Branch sandbox state
Branch sandbox state
Create multiple independent sandboxes from the same snapshot to explore different execution paths.