Skip to main content
Checkpoint loading lets you resume training from previously saved model states. When enabled, Baseten automatically downloads your specified checkpoints to the training environment before your training code starts. Use cases:
  • Resume failed training jobs.
  • Incremental training and fine-tuning.

Access downloaded checkpoints

Checkpoints are available through the BT_LOAD_CHECKPOINT_DIR environment variable. For single-node training, they’re located in BT_LOAD_CHECKPOINT_DIR/rank-0/. For multi-node training, each node’s checkpoints are in BT_LOAD_CHECKPOINT_DIR/rank-<node_rank>/.

Checkpoint reference

Create references to checkpoints using the BasetenCheckpoint or LoopsCheckpoint factories:

From latest

Parameters:
  • project_name: Load the latest checkpoint from the most recent job in this project.
  • job_id: Load the latest checkpoint from this specific job.
  • Both parameters: Load the latest checkpoint from that specific job in that project.

From named

Parameters:
  • checkpoint_name: The name of the specific checkpoint to load.
  • job_id: The job that contains the named checkpoint.
  • Both parameters: Load the named checkpoint from that specific job in that project.

From Loops

Parameters:
  • run_id: The ID of the Loops run.
  • checkpoint_name: The name of the checkpoint to load.
  • target: The checkpoint target, either trainer (full training state) or sampler (inference weights). Defaults to trainer.

Configuration examples

Here are practical examples of how to configure checkpoint loading in your training jobs:

From latest

From named

Configuration parameters:
  • enabled: Set to True to enable checkpoint loading.
  • checkpoints: List containing checkpoint references.
  • download_folder: Optional custom download location (defaults to /tmp/loaded_checkpoints).

Complete TrainingJob setup

Use checkpoints in your training code

Access loaded checkpoints using the BT_LOAD_CHECKPOINT_DIR environment variable: