Skip to main content
Delete a checkpoint when you no longer need to load, sample, or deploy it. To keep the run and its other checkpoints, delete checkpoints one at a time. To remove a run and every checkpoint that nothing else uses, delete the run instead. The Baseten CLI doesn’t delete checkpoints; use the Python SDK or the REST API. You can’t delete a checkpoint that something still uses. The error names the use. Remove that use and retry:
Deleting a checkpoint is permanent. Afterward, you can’t load, sample, or deploy it. To keep a copy, download its files first.
The Python SDK and the curl examples authenticate with BASETEN_API_KEY. Export your API key first:
To delete a checkpoint:Call delete_checkpoint_from_path() on a ServiceClient, replacing <checkpoint_path> with the checkpoint’s bt:// path, such as the path that save_state() or save_weights_for_sampler() returned:
The result reports the deleted checkpoint’s id and path. Listing the run’s checkpoints afterward no longer includes it.To delete the checkpoint by the name you saved it under, pass that name and the run’s ID to delete_checkpoint():

Next steps