Hugging Face cache (~/.cache/huggingface) — official cleanup that works

Every from_pretrained() call lands in ~/.cache/huggingface/hub/models--*. Fine-tuning loops can add 50+ GB/week.

Audit

du -sh ~/.cache/huggingface
ls ~/.cache/huggingface/hub | head
du -sh ~/.cache/huggingface/hub/* | sort -h | tail

Clean (official)

pip install -U huggingface_hub
huggingface-cli delete-cache --disable-tui   # pick what to drop
The cache uses symlinks (blobs ↔ snapshots). Deleting snapshot files by hand leaves orphan blobs — use the CLI, or rm -rf the whole models--* folder to re-download cleanly later.

Relocate

export HF_HOME=/data/hf        # then move the dir

FAQ

Will models re-download?
Only if a script needs them and they're gone — that's the point of pruning unused ones.