save_checkpoint - Tinker Documentation
tinker_cookbook.checkpoint_utils.save_checkpoint
tinker_cookbook.checkpoint_utils.save_checkpoint( training_client, name, log_path, loop_state, kind, ttl_seconds, store)
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. - store ( TrainingRunStore | None) – If provided, write the checkpoint record via Storage protocol.
Returns: Dict mapping "state_path" and/or "sampler_path" to tinker:// paths.
save_checkpoint(
training_client=training_client,
name="step-100",
log_path="./logs",
loop_state={"epoch": 0, "batch": 100},
)