Skip to main content
Deleting a run removes the run and its saved checkpoints, except checkpoints that another resource still uses. Deactivate a run instead when you want to end it but keep its checkpoints. The Baseten CLI doesn’t delete runs or checkpoints; use the REST API. Deletion is permanent. Before you start, set BASETEN_API_KEY to a workspace API key.

Delete a run

Deleting an active run deactivates it first. Baseten keeps checkpoints that another resource still uses, such as a deployment, and lists them in the response. They stay usable until that use stops. To keep a copy of other checkpoints, download them with download_checkpoint() before you delete the run. To delete a run and its checkpoints: Replace <run_id> with the run ID from TrainingClient.run_id or list your runs, then send a request to Delete a run:
The response returns the deleted run ID and a kept_checkpoints array. Check the array for any checkpoints Baseten kept because they’re still in use.

Delete a checkpoint

Delete a checkpoint when you no longer need to load, sample, or deploy it. You can’t delete a checkpoint that something still uses. The error names the use. Remove that use and retry: To delete a checkpoint: Replace <checkpoint_id> with the name you saved the checkpoint under, then send a request to Delete a checkpoint:
The response returns the deleted checkpoint’s id, run_id, checkpoint_id, and path. After deletion, the checkpoint disappears from listings and you can’t load, sample, or deploy it. Deleting an already-deleted checkpoint returns the same response.