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.
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
$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
Clones the source VM's state into a new VM. Returns a new vm_id and session_id. Source VM is not affected.
Every clone boots from the same snapshot of the source. Installed packages, file state, environment variables — all copied.
Pass snapshot_name to label each clone's baseline. Makes it easy to trace which eval branch produced which result.
Call vms.clone() in a for-loop to create N parallel branches. Each gets its own isolated Firecracker VM.
SDK reference
1from instavm import InstaVM23client = InstaVM(api_key="sk_instavm_...")45# Prepare source VM with eval framework6source = client.vms.create(wait=True)7client.execute("pip install eval-harness && download-model")89# Clone into 3 parallel branches10branches = []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)1819# Each branch has identical state — run different prompts20for branch in branches:21 print(branch["vm_id"]) # Independent VM
How it works
vms.create() with your dependencies, data, and configuration. Run setup commands. Get it to the state you want to branch from.
vms.clone(vm_id=..., snapshot_name='baseline') creates a snapshot and boots a new VM from it. Source VM keeps running.
Loop vms.clone() to create parallel VMs. Each runs independently with identical starting state for fair comparison.
Free tier available. No credit card required. VMs provision in under 200ms.
By clicking Accept, you agree to our use of cookies.
Learn more