List Checkpoints
Discover what a training run saved without ls
List the checkpoints a training run saved — no ls, no guessing the path.
praisonai-train checkpoints
praisonai-train checkpoints -d outputs --jsonQuick Start
- List the checkpoints
Point at the run’s output directory and see every saved step, newest first.
bash praisonai-train checkpoints -d outputstext checkpoint-1000 4.21 GB outputs/checkpoint-1000 checkpoint-200 4.21 GB outputs/checkpoint-200 2 checkpoint(s); newest is step 1000. - Get JSON for scripts
Add
--jsonto emit a machine-readable array your shell can parse.bash praisonai-train checkpoints -d outputs --jsonjson [ {"step": 1000, "path": "outputs/checkpoint-1000", "bytes": 4521984000}, {"step": 200, "path": "outputs/checkpoint-200", "bytes": 4521984000} ]
How It Works
The command scans output_dir for checkpoint-<n> directories, sums each one’s file sizes, and sorts by step — newest first.
Only directories named checkpoint-<n> count — checkpoint-final is skipped, not read as step 0. Sorting is numeric, so checkpoint-1000 comes before checkpoint-200.
Configuration Options
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--model-dir | -d | Path | outputs | Directory the run wrote to (i.e. its output_dir). |
--json | -j | bool | False | Emit a JSON array instead of the human listing. |
JSON Output
Each entry has three fields — the step number, the checkpoint path, and its size in bytes.
| Field | Type | Description |
|---|---|---|
step | int | The checkpoint’s step number (the <n> in checkpoint-<n>). |
path | str | Path to the checkpoint directory. |
bytes | int | Size on disk — sum of st_size of every file under the checkpoint. |
{"step": 1000, "path": "outputs/checkpoint-1000", "bytes": 4521984000}Common Patterns
Auto-pick the newest step for export
Pipe --json through jq to grab the newest checkpoint path, then hand it to export.
NEWEST=$(praisonai-train checkpoints -d outputs --json | jq -r '.[0].path')
praisonai-train export ollama --model-dir "$NEWEST" --ollama me/my-modelThe list is sorted newest-first, so .[0] is always the latest step.
Confirm a run actually saved
Run it right after an interrupted job to see what survived before deciding whether to resume.
praisonai-train checkpoints -d outputsBest Practices
Checkpoints live under the run’s output_dir (default outputs), not final_model_dir (default lora_model). Point -d at the same output_dir the run used.
Use save_total_limit to control disk
Each checkpoint is the full adapter size. Set save_total_limit in config.yaml to keep only the newest few — the listing then stays short and disk stays bounded.
Combine –json with jq in shell scripts
--json gives a stable {step, path, bytes} schema. Parse it with jq to auto-select a checkpoint instead of hardcoding a step number that changes every run.