Skip to main content
A checkpoint expiry tells Baseten to delete the checkpoint after a set time. It’s also the only way to delete a single Training Jobs checkpoint: without an expiry, a checkpoint stays until you delete its job or project. Your organization may have a default expiry. If so, each new checkpoint gets it when it syncs. Changing the default doesn’t affect existing checkpoints.
Baseten permanently deletes expired checkpoints once a day, after the job has stopped. If a checkpoint expires while its job is still running, Baseten deletes it within about a day after the job stops.

Set a checkpoint expiry

The Baseten CLI doesn’t set a checkpoint expiry, so set it with the Training API. To set a checkpoint expiry:
  1. Find the checkpoint’s id by listing the job’s checkpoints with the Training API. The request URL takes that id. The response’s checkpoint_name, and its deprecated checkpoint_id, hold the checkpoint’s name, such as checkpoint-50, and the CLI listing shows those names instead of IDs.
  2. Send a request to Set a training job checkpoint TTL. The curl examples authenticate with BASETEN_API_KEY. Export your API key first. Replace <project_id>, <job_id>, and <checkpoint_id> with the project ID, the job ID, and the checkpoint’s id. ttl_seconds counts from now, from 3600 (1 hour) to 315360000 (10 years). To keep the checkpoint for 30 days, run:
    The response returns the checkpoint with its new expires_at, the time Baseten deletes it.
To remove a checkpoint’s expiry: Send null as ttl_seconds, so the checkpoint never expires:
The response’s expires_at is null. The request fails in these cases:
  • 404: the job has no checkpoint with that ID.
  • 409: Baseten hasn’t confirmed that the job’s checkpoint upload finished. That confirmation usually takes a few minutes after the job stops, and a checkpoint without it can’t expire.

When expired checkpoints are deleted

Baseten keeps an expired checkpoint if:
  • It has ever been deployed.
  • A Loops run or sampler uses it as its base model.
  • A training job is still copying it.
  • It’s inside the folder of another checkpoint that’s kept.
When all of a job’s checkpoints are deleted, Baseten also deletes any other files left in the job’s checkpoint storage.

Delete checkpoints with their job or project

Deleting a training job deletes all of its undeployed checkpoints, and deleting a project deletes them for every job in it. See Delete a job and Delete a project for what each deletion removes and what it leaves in place.

Next steps