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:-
Find the checkpoint’s
idby listing the job’s checkpoints with the Training API. The request URL takes thatid. The response’scheckpoint_name, and its deprecatedcheckpoint_id, hold the checkpoint’s name, such ascheckpoint-50, and the CLI listing shows those names instead of IDs. -
Send a request to Set a training job checkpoint TTL. The
curlexamples authenticate withBASETEN_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’sid.ttl_secondscounts 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 newexpires_at, the time Baseten deletes it.
null as ttl_seconds, so the checkpoint never expires:
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.
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
- List and download checkpoints: Keep a local copy before a checkpoint expires.
- Deploy a checkpoint: Serve a checkpoint as a model.