Skip to main content
A volume is named storage. Create it once, mount it wherever you need it, and it stays alive regardless of what gets deployed or deleted around it.
Inside the container, /data is the volume. Files written there survive calls, instances and redeploys, and any other deployment mounting training-data sees the same files.

The mental model

A volume is shared files, not a database. Reads and writes are ordinary filesystem operations, which has two consequences worth knowing up front:
  • Concurrent writes to the same file are last write wins. There is no locking. Give concurrent writers distinct paths, such as one file per user or per run, and the problem disappears.
  • A file written by one deployment becomes visible to others within seconds, not instantly.

Creating and attaching

Referencing a volume creates it. The first deploy that mentions training-data brings it into existence and says so in the deploy output, so a typo shows up as a new volume rather than a silent empty one. To be explicit first:
volumes= maps mount paths to volumes on any decorator:

The workspace convention

/workspace is where apps and agents keep state: chats, per-user files, credentials and the key-value store. Agents require a volume there and the decorator raises without one. Apps need one only if they use workspace or DB.
Nothing is created implicitly. Storage is exactly what your source declares, and renaming a deployment changes nothing about its data, because the volume reference is the identity.
cycls run ignores volumes. Locally your code sees the local filesystem, which keeps the development loop fast and offline.

Moving data in and out

The CLI talks to storage directly, so transfers do not proxy through the API and file size is effectively unlimited.
This is how you seed a dataset before anything is deployed, and how you pull results out without writing an endpoint.

Sharing across deployments

Attachment is by name, so a family of deployments can work on one dataset.
One volume, three deployments, no copying. Put a schedule on the producer and the pipeline runs itself. For a worked version of this with Parquet and DuckDB, see Build a data warehouse.

Lifecycle

  • cycls rm <deployment> detaches volumes and leaves the data alone. Redeploying the same name reattaches them with files intact.
  • cycls volume delete <name> is the only way to delete data. It refuses while any deployment has the volume attached, and names them in the error.
  • Deleted volumes stay recoverable for seven days.

Structured state on a volume

For per-user JSON rather than files, cycls.DB is a small key-value store that writes to the workspace volume.

Next

Cron

Fire a deployed function on a schedule.