Sandbox volumes (
prime sandbox volumes) are separate from Hosted Training volumes, which back Model Factory training runs.How a volume works
- A sandbox that attaches a volume gets a private copy of the volume’s latest published version. The copy is made when the sandbox is created.
- Volumes attach read-write (the default) or read-only (
:ro). A read-only attachment cannot write or publish. - Publishing adds one sandbox’s changes to the volume as a new version. Sandboxes created after the publish completes see the new version. A running sandbox sees it after a sync. A volume that was never published is empty.
- Syncing updates the volume in a running sandbox to the latest published version. See Sync.
- Each publish is stored as a checkpoint. The publish command shows the checkpoint ID. Use this ID to check the status of the publish.
- A volume is mounted with
noatime, so reading a file does not update its access time. - Published data survives sandbox termination; unpublished writes do not. Publish before deleting a sandbox whose writes you want to keep.
- A volume is a separate disk: it doesn’t count against the sandbox’s
disk_size_gb, and a sandbox checkpoint captures the root filesystem only, never a mounted volume. A volume’s capacity is 100 GiB by default, set at creation, and can grow up to 10 TiB — see Size and growth.
Checkpoints, fork and restore
A checkpoint holds only the sandbox’s root disk. A fork or restore attaches no volume unless you pass--volume. The mount path is then an empty directory.
--volume attaches the volume at its latest published content. It does not attach the state of the volume at the time of the checkpoint.
--memory) does not accept --volume. A sandbox with an attached volume cannot be paused, so it cannot be snapshotted or memory-forked.
Quickstart
--volume NAME:/mount/path[:ro] up to 8 times per sandbox. :ro mounts the volume read-only; writable mounts have no suffix.
Publish
publish saves the sandbox’s copy and adds its changes to the volume. By default, it waits until the publish is complete. After that, new sandboxes that attach the volume see the changes.
- Each publish includes all changes since the sandbox’s last successful publish, or since it attached the volume.
- The publishes of one volume complete one at a time. There is no fixed completion time.
- The CLI and the SDK wait up to 300 seconds. Use
--wait-timeout <seconds>to change this in the CLI. When the wait ends, the CLI exits with status 1 and the SDK raisesTimeoutError, but the publish continues. --no-wait(CLI) orwait=False(SDK) returns at once. To check a publish, runprime sandbox checkpoint get <checkpoint-id>or callclient.get_checkpoint(...). The publish is complete when the state isDURABLEand the merge status ismerged.DURABLEalone does not mean that the changes are in the volume.- If a publish fails, the CLI prints the reason and exits with status 1. The SDK raises
RuntimeErrorwith the reason. The volume keeps its earlier version, and the sandbox keeps its writes. If the cause stays, a new publish from the same sandbox also fails. - Read-only attachments cannot publish.
Multiple writers
Many sandboxes can attach the same volume read-write at the same time. Use CLIprime 0.20.4 or later, or SDK prime-sandboxes 0.5.11 or later: earlier versions can return before the changes are in the volume. Each sandbox changes only its own copy. Each publish adds its changes to the volume’s current version, which can already include publishes from other sandboxes.
In this example, sandboxes A and B attach the same version, and both write the same file. A publishes first, then B. A new sandbox reads B’s version.
How changes combine
The last writer wins per file: the last publish replaces the whole file, with its permissions, owner, and extended attributes. “Last” is the order in which the publishes complete, not the order in which the sandboxes write.- Changes to different files all stay.
- Deletes follow the same rule. If the last publish deletes a directory, or puts a file at its path, the directory is removed with all of its contents, including files that other sandboxes added.
- A moved or renamed item keeps the changes that other sandboxes publish to it.
- If moves from two sandboxes would put a directory inside itself, the later publish fails.
Sync
A volume in a running sandbox shows the content from when the sandbox started, or from its last sync.sync updates the volume in the sandbox to the latest published version.
- Read-write mount:
syncfirst publishes the sandbox’s unpublished changes. The platform adds them to the volume as in How changes combine. Thensyncupdates the volume in the sandbox. After the sync, the sandbox shows its own changes and the changes that other sandboxes published. - Read-only mount:
syncupdates the volume in the sandbox. --discard(CLI) ordiscard=True(SDK):syncdoes not publish the sandbox’s unpublished changes. It deletes them. The volume in the sandbox then shows the latest published version.
Sync failures
When a sync fails, the platform restores the volume in the sandbox to its state before the sync. The unpublished changes stay in the sandbox. The exceptions areDEADLINE and ROLLBACK_FAILED: the volume can be missing from the sandbox. In that case, run the sync again.
Import a local directory
--from with --size-gb to size the new volume in the same step.
--from needs rsync on your machine. The CLI copies the directory through a short-lived helper sandbox and publishes from it; the helper is deleted once the publish is complete. If the volume already exists, the import publishes like any other sandbox: its files are added to the volume’s current version.
Size and growth
A volume’s capacity is the maximum it can hold, set at creation in whole GiB: 100 (the default) up to 10240 (10 TiB).volumes list and volumes get show it as Capacity; the SDK exposes it as Volume.size_gb.
- Growth is one-way: a size at or below the volume’s current size returns 409. Volumes cannot shrink.
- A grow applies to sandboxes created after it; running sandboxes keep their current size. The filesystem is grown when a sandbox attaches the volume read-write, and publishing from that sandbox records the larger size. Until then, a read-only attachment shows the last published size.
- Large grows add a few seconds to sandbox startup. Pick the size you need at creation.
- Capacity is a ceiling, not a quota: billing stays based on stored data, as documented at the bottom of this page.
Manage volumes
listpaginates with--page/--num(max 100 per page);--jsonprints raw fields.deletefails with 409 while any active sandbox has the volume attached, and removes the volume and all of its published data. Deleting a team volume requires a team admin.
Scopes and permissions
- Volumes are personal by default. Pass
--team-id(CLI) orteam_id(SDK) to work in a team; without it, the CLI uses the team from your config, if any. - Team members can create, attach, publish, and sync team volumes; only team admins can delete them.
- API tokens need the
sandbox:readscope to list or get volumes andsandbox:writeto create, delete, publish, or sync.
Names and mount paths
- Volume names: 1–40 characters, lowercase letters, digits, and hyphens; must start and end with a letter or digit; unique within their scope.
- Mount paths: absolute, not
/, unique per sandbox, and not nested inside each other.
Common errors
Published volume data is billed as checkpoint storage.