Skip to content

Live fork

Live fork clones a running sandbox. Not a filesystem snapshot, not a cold-booted copy — a live microVM captured mid-flight and forked into N children, each of which resumes from the parent's exact process memory: running processes, open files, loaded libraries, warmed caches, a browser mid-page. The parent keeps running.

Terminal window
curl https://api.collimate.ai/v1/sandboxes/sbx_9f2a1c7b3e40/fork \
-H "Authorization: Bearer $COLLIMATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "count": 8 }'
{
"parent": "sbx_9f2a1c7b3e40",
"children": [
{ "id": "sbx_1a4f8c" },
{ "id": "sbx_2b5e9d" }
]
}

Each child is a full, independent, hardware-isolated microVM with a fresh id. Writes are private (copy-on-write); reads share the parent's pages until touched, so each child adds only a small amount of memory on top of the parent. Fan out to count children in a single call.

Agentic and RL workloads are branch-heavy. From one prepared state you want to try many next steps:

  • a best-of-N sampler wants K candidates from the same prompt state;
  • a tree search wants to expand many children of one node;
  • an agent wants to try several tool calls from the same workspace and keep the best.

The naive way to give each branch its own isolated environment is to boot a fresh VM and re-run the whole history to reach the branch point. That is the replay tax — and it grows with episode length, so it dominates exactly the long-horizon work you most want to branch.

Because a fork is cheap and the child keeps live state, you can treat a sandbox as a node in a search tree and expand it in place:

prepared state S0
│ fork ×3
┌───────┼───────┐
S1 S2 S3 ← each a live sandbox, forked from S0
│ fork ×2
┌──┴──┐
S1a S1b ← fork the promising branches deeper
  1. Drive a sandbox to an interesting state S0 (install deps, load a model, run the episode to a decision point).
  2. fork(S0, count=k) — get k live children, each at S0.
  3. Take a different action in each child; score them.
  4. Fork the promising children again to go deeper.

No child ever replays S0. A re-fork of an already-forked child carries its accumulated divergence forward correctly, so you can branch as deep as the search needs.

Agents

Prepare a workspace once — clone the repo, install the toolchain, warm the caches — then fork it to try several edits or tool calls in parallel and keep the branch that works. Over REST or the MCP sandbox_fork tool.

RL / post-training

Fork a mid-rollout state for GRPO-group sampling, MCTS-style rollouts, or unbiased straggler backfill — without re-warming the environment or replaying the trajectory. Drive it from collimate-rl.

  • The parent must be running with no in-flight exec — fork a settled state. A fork while an exec is in flight returns 409 busy.
  • count defaults to 1 and is bounded server-side per request; fan out in batches for very wide search.
  • Fork is a distinct capability from suspend/resume: suspend freezes one sandbox to disk to pause it; fork branches a live one into many. Both preserve process memory; only fork multiplies it.