Clone running VMs for parallel eval fan-out

vms.clone(vm_id=...) snapshots a live VM and boots a copy. The source keeps running. Clone it N times to run evals, prompt variants, or policy experiments in parallel from identical starting state.

Full state

Disk + memory

Source unchanged

Non-destructive

Named snapshots

Per clone

live vm clone

$source = client.vms.create(wait=True)

↳vm_id: vm_base_12f0 | ready in 185ms

$client.execute('pip install eval-harness')

↳installed in 3.2s | state persisted

$client.vms.clone(vm_id='vm_base_12f0', snapshot_name='branch-0')

↳new vm: vm_eval_a | cloned from live state

$# repeat for branch-1, branch-2...

↳3 clones running | source vm unchanged

$

Capabilities

vms.clone(vm_id, snapshot_name)

Clones the source VM's state into a new VM. Returns a new vm_id and session_id. Source VM is not affected.

Identical starting state

Every clone boots from the same snapshot of the source. Installed packages, file state, environment variables — all copied.

Named snapshot per clone

Pass snapshot_name to label each clone's baseline. Makes it easy to trace which eval branch produced which result.

Fan out with a loop

Call vms.clone() in a for-loop to create N parallel branches. Each gets its own isolated Firecracker VM.

SDK reference

live-vm-clone.py
pythonClone + fan-out
1from instavm import InstaVM
2
3client = InstaVM(api_key="sk_instavm_...")
4
5# Prepare source VM with eval framework
6source = client.vms.create(wait=True)
7client.execute("pip install eval-harness && download-model")
8
9# Clone into 3 parallel branches
10branches = []
11for i in range(3):
12 clone = client.vms.clone(
13 vm_id=source["vm_id"],
14 wait=True,
15 snapshot_name=f"eval-branch-{i}",
16 )
17 branches.append(clone)
18
19# Each branch has identical state — run different prompts
20for branch in branches:
21 print(branch["vm_id"]) # Independent VM

How it works

Prepare, clone, fan out

01

Prepare a source VM

vms.create() with your dependencies, data, and configuration. Run setup commands. Get it to the state you want to branch from.

02

Clone the live state

vms.clone(vm_id=..., snapshot_name='baseline') creates a snapshot and boots a new VM from it. Source VM keeps running.

03

Fan out N branches

Loop vms.clone() to create parallel VMs. Each runs independently with identical starting state for fair comparison.

Get started with InstaVM

Free tier available; a card on file, no charge to get started. VMs provision in under 200ms.

We use cookies to improve your experience. See our cookie policy.