Skip to main content
Use volumes to keep data that outlives a single worker, such as model weights, datasets, and checkpoints, and to share files between resources. The SDK supports two kinds of persistent volume:
  • runpod.NetworkVolume: Storage in a single data center. Resources that mount it run in that data center. Works with GPU and CPU compute.
  • runpod.GlobalVolume (beta): Storage that isn’t tied to a data center. Requires GPU compute.
To compare the two and decide which to use, see Storage overview.

Attach a volume

Declare the volume once, then attach it to resources with mounts, which maps a path on the worker to a volume:
Both tasks mount the same network volume, so evaluate can read the checkpoint that train wrote. The SDK places both tasks in the volume’s data center.

Volume references

Both volume types take a name or an ID:
  • If no volume with that name or ID exists, the SDK creates it the first time it provisions a resource that mounts it. Set create=False to require an existing volume instead.
  • size is the size in GB for a new network volume. Global volumes grow with your data, so they don’t take a size.
  • datacenter pins a new network volume to a data center. If you leave it unset, the SDK picks a data center that supports network storage and has hardware for every resource that shares the volume, respecting any datacenter setting on those resources. If you pin a data center that doesn’t support network storage, provisioning fails before the volume is created.
  • An existing volume keeps its ID and data center. Every resource that mounts it must be able to run in that data center.

Mount rules

Global volumes require GPU compute for both tasks and endpoints.

Read the mount path in your code

Inside a remote function, volume.path returns the path where the volume is mounted on that worker:
Keep these rules in mind:
  • Read .path inside remote functions, not at the top level of a module. The SDK imports your modules locally to discover resources, and the volume isn’t mounted there.
  • Accessing .path raises an error if the volume isn’t mounted on the current worker, or if it’s mounted more than once.
  • fn.local() runs your function on your machine without mounting remote storage.

Cache model weights

To load a Hugging Face model without managing a volume yourself, use the model parameter instead. Runpod stages the weights on the host before the worker starts. See model.

Billing

Volumes keep incurring storage charges after you undeploy an app or delete a dev session. The SDK doesn’t delete volumes for you. To delete a volume, see Network volumes or Global volumes.

Next steps

Last modified on October 15, 2026