Mount a volume
from klio_compute import function, Volume
weights = Volume(name="weights", mount_path="./weights")
@function(volumes=[weights], gpu="L40S")
def load():
with open("./weights/model.bin", "rb") as f:
return len(f.read())A volume is created the first time it is used and keeps its files between runs.
Move files from the command line
klio volume create weights
klio volume put weights ./model.bin
klio volume ls weights
klio volume get weights model.bin ./model.bin
klio volume listklio volume cp copies within a volume, and klio volume delete removes one. With the Modal-compatible API, Volume.reload() right after a commit in another container waits until the data is readable there, which can take a moment.