tinker_cookbook.checkpoint_utils.save_checkpoint
tinker_cookbook.checkpoint_utils.save_checkpoint(training_client, name, log_path, loop_state, kind, ttl_seconds)
Save model checkpoint (synchronous wrapper around save_checkpoint_async).
Parameters:
- training_client (tinker.TrainingClient) – Training client to save from.
- name (str) – Name for the checkpoint (used in the tinker:// path).
- log_path (str) – Directory containing
checkpoints.jsonl. - loop_state (dict[str, Any]) – Training loop state dict (may include
batch,epoch, etc.). - kind (Literal['state', 'sampler', 'both']) – Which checkpoint types to save (
"state","sampler", or"both"). - ttl_seconds (int | None) – Server-side retention.
Nonekeeps the checkpoint indefinitely.
Returns: Dict mapping "state_path" and/or "sampler_path" to tinker:// paths.