Articles » Storage guide

How to Use Persistent Storage on Vast.ai

GPU instances are disposable. If a checkpoint exists only on a container disk, destroying the instance may destroy the file. A local volume separates important data from the compute lifecycle.

Know the constraints

Vast.ai local volumes are tied to the physical host where they were created. They can attach only to instances on that same machine, and their size cannot currently be changed after creation. Persistent does not mean off-site backup.

Create a volume

In the console, choose a compatible template and use Add volume before renting. Allow space for weights, datasets, caches, checkpoints, and outputs. Standard configurations commonly mount the volume at /data.

vastai search volumes
vastai create volume OFFER_ID -s 100 -n ml_data
vastai show volumes

An existing volume can be mounted during CLI instance creation with a value such as -v V.VOLUME_ID:/data.

Use a clear directory layout

mkdir -p /data/models /data/datasets /data/checkpoints /data/outputs /data/cache
export HF_HOME=/data/cache/huggingface
export TORCH_HOME=/data/cache/torch

Keep source code in version control, reproducible downloads in cache directories, and irreplaceable outputs in a backed-up location.

Test persistence early

echo volume-test > /data/persistence-check.txt
sync

Before a long job, stop the test instance, attach the volume to another compatible instance on the same host, and verify the file remains.

Back up and control cost

Copy important checkpoints and results to a second system regularly. Storage charges can continue after compute stops, so review the Storage page when a project ends. Verify downloads before removing any volume.

See the official volume documentation for current constraints and commands. Pair it with our SSH transfer guide.