Safe to Delete

Hugging Face Hub Model Cache Folder (~/.cache/huggingface/hub)

Quick Answer: The ~/.cache/huggingface/hub folder stores cached AI model weights and tokenizer files. Purging old model revisions via CLI is safe.

Bottom Line: It is 100% safe to clear the Hugging Face Hub model cache. Running huggingface-cli delete-cache will NOT delete your Python machine learning scripts, datasets, or fine-tuned checkpoints.


What is the Hugging Face Hub Cache Folder?

Located at ~/.cache/huggingface/hub on Linux/macOS (and %USERPROFILE%\.cache\huggingface\hub on Windows), this folder is managed by the Hugging Face transformers and diffusers libraries.

When downloading open-source models from Hugging Face (BERT, RoBERTa, Stable Diffusion, Llama, Falcon), Hugging Face uses a symlinked cache architecture inside models--[author]--[repo]. Over time, duplicate model commits and unlinked snapshot revisions hoard 20 GB to 100 GB+ of drive space.


Can You Delete Hugging Face Hub Cache?

✅ Yes, it is completely safe to delete.

  • No code risk: Your Python scripts, fine-tuning scripts, and training code stay 100% safe.
  • Auto-downloaded: Calling AutoModel.from_pretrained("...") will re-fetch required model weights automatically.

How to Safely Clean Up Hugging Face Cache

  1. Open your terminal.
  2. Launch the interactive cache manager:
    huggingface-cli delete-cache
  3. Select older model revisions to delete and press Enter.

Method 2: Manual Directory Wipe

# macOS / Linux
rm -rf ~/.cache/huggingface/hub/*

# Windows (PowerShell)
Remove-Item -Recurse -Force $env:USERPROFILE\.cache\huggingface\hub\*

Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files