Skip to main content
Download a checkpoint’s files to evaluate them locally, load them into your own code, or keep a copy before you delete the checkpoint. The Baseten CLI and the REST API take the checkpoint’s id from List checkpoints. The Python SDK takes that id, or the name you saved the checkpoint under together with the run’s ID. A checkpoint’s files are stored in S3 or in a Baseten volume, and recent checkpoints are usually in volumes. The Python SDK downloads from either. The Baseten CLI and the REST API return presigned URLs only for checkpoints stored in S3. For a checkpoint stored in a volume, they fail with a Checkpoint <checkpoint_id> has no presigned URLs error; use the Python SDK instead. To check where a checkpoint is stored, send a Get checkpoint source request. The Python SDK, the Baseten CLI, and the curl examples authenticate with BASETEN_API_KEY. Export your API key first:
To download a checkpoint’s files:Call download_checkpoint() on a ServiceClient with the checkpoint’s id and a dest_dir that doesn’t exist yet or is empty. The run doesn’t need to be active. Replace <checkpoint_id> with the id, then run:
To identify the checkpoint by the name you saved it under, pass name and the run’s ID instead of checkpoint_id:
The script prints the directory that holds the files and how many it wrote. A sampler checkpoint with two files prints:
During a run, training_client.download_checkpoint() takes the same arguments except run_id, which it resolves from the client’s run.

Next steps