curl examples authenticate with BASETEN_API_KEY. Export your API key first:
Set an expiry when you save
In your training loop, passttl_seconds to save_state() or save_weights_for_sampler(): the number of seconds that Baseten keeps the checkpoint, from 3600 (1 hour) to 315360000 (10 years). To keep the training state for 7 days and print when it expires, add these lines to the loop:
expires_at is about 7 days from now.
Change or remove an expiry
A change countsttl_seconds from now, over the same 3600 to 315360000 range. Pass ttl_seconds=None, or "ttl_seconds": null in the request body, to remove the expiry so the checkpoint never expires.
- Python SDK
- REST API
To change a checkpoint’s expiry:Call The call returns the updated checkpoint, and the printed
set_checkpoint_ttl_from_path() on a ServiceClient with the checkpoint’s bt:// path. To keep the checkpoint for 30 days from now, replace <checkpoint_path> and run:expires_at is about 30 days from now.Next steps
- Delete a checkpoint: Remove a checkpoint now instead of waiting for it to expire.
- Download checkpoint files: Keep a local copy before the checkpoint expires.