Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions storage/managing-files.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Managing Files"
description: "Store model weights and files on regional and global persistent storage volumes"
title: "Manage files on persistent storage volumes"
description: "Upload, list, download, and remove files on Cerebrium's regional and global persistent storage volumes, and transfer files between them."
---

Cerebrium offers file management through a persistent volume that's available to all apps in a project. This storage mounts at `/persistent-storage` and helps store model weights and files efficiently across deployments.
Expand Down Expand Up @@ -147,6 +147,38 @@ Use the global volume for data that must be available everywhere, such as model
cannot be resized.
</Note>

### Accessing Both Volumes at Runtime

Apps deployed with `region = "global"` have both volumes mounted at the same time, at separate paths:

- `/persistent-storage` — the region-local volume for the region the container is running in.
- `/global-persistent-storage` — the shared global volume.

They are separate mount points, not a unified bucket. Code can read from and write to both paths concurrently:

```python
# Region-local cache
with open("/persistent-storage/cache/last_run.json", "w") as f:
json.dump(state, f)

# Model weights shared across all regions
model = torch.load("/global-persistent-storage/models/mymodel.pt")
```

### Transferring Files Between Regional and Global Volumes

There is no CLI command to copy files directly between a regional volume and the global volume, or between two regional volumes. To move a file, download it locally and re-upload it to the destination:

```bash
# Download from the regional volume (uses the default region, or pass --region)
cerebrium download model.bin

# Re-upload to the global volume
cerebrium cp model.bin --region global
```

The same pattern moves files between two regions by passing `--region <source>` to `download` and `--region <destination>` to `cp`. From inside a running global app, code can also read from one mount and write to the other directly, since both `/persistent-storage` and `/global-persistent-storage` are available at runtime.

## Increasing Storage Capacity

Persistent volumes can be resized up to 1TB through self-service. Storage costs are listed on the [pricing page](https://www.cerebrium.ai/pricing).
Expand Down
Loading