$BT_CHECKPOINT_DIR to Baseten storage. From there, you can load them into a new job, download them, or deploy them.
Enable checkpointing
To enable checkpointing, add aCheckpointingConfig to the Runtime and set enabled to True:
Use the checkpoint directory
Baseten exports the$BT_CHECKPOINT_DIR environment variable in your job. Write your checkpoints there. Baseten mounts a separate volume at that path, so checkpoints don’t fill the container’s disk, and a background process syncs the directory to cloud storage on a recurring cycle. A checkpoint becomes durable when its sync completes.
If your training script deletes a checkpoint before it syncs, that checkpoint never reaches cloud storage, and no error is raised. Fast checkpoint rotation is the common way to hit this. Two setups can remove a checkpoint within seconds of writing it: rolling checkpoints that keep only the last N, and frameworks that write to a temporary path and then rename it. To keep every checkpoint, confirm that a checkpoint’s SYNC column reads COMPLETE before your script deletes it locally. List the job’s checkpoints to read the column.
Once a checkpoint has synced, deleting it locally is safe. Synced checkpoints persist in cloud storage even after you remove them from $BT_CHECKPOINT_DIR, so you can still reclaim disk space during long runs.
Next steps
- Load a checkpoint into a new job: Continue training from a synced checkpoint.
- List and download checkpoints: Check sync status and keep a local copy.
- Set a checkpoint expiry: Have Baseten delete checkpoints you no longer need.