Safe to Delete

Hugging Face Cache Folder (~/.cache/huggingface)

Quick Answer: ~/.cache/huggingface stores downloaded AI models, transformers, and datasets. Deleting old model caches is completely safe and reclaims massive disk space.

Bottom Line: It is 100% safe to delete ~/.cache/huggingface or clear specific model checkpoints. Doing so will not corrupt your Python code; Hugging Face will simply re-download models on demand when you run your scripts.


What is the Hugging Face Cache Folder?

Located at ~/.cache/huggingface on Linux/macOS or %USERPROFILE%\.cache\huggingface on Windows, this folder is created automatically by the Hugging Face transformers, diffusers, and datasets Python libraries.

When you load an AI model (like Llama, Stable Diffusion, Whisper, or BERT) in Python, Hugging Face downloads the model weights, tokenizer files, and datasets into this cache directory. Because modern Large Language Models (LLMs) and diffusion models range from 2 GB to 20 GB+ per model, running a few AI experiments can quickly fill your drive with 50 GB to 100 GB+ of cached weights.


Can You Delete ~/.cache/huggingface?

✅ Yes, it is completely safe to delete.

  • No code risk: Your Python scripts, project files, and training scripts remain 100% safe.
  • Auto-redownload: The next time you run from_pretrained("model-name"), Hugging Face will automatically download the required model weights again.

How to Safely Clean Up Hugging Face Cache

Hugging Face includes a built-in CLI utility to inspect and selectively delete cached models:

  1. Install/update the huggingface_hub package:
    pip install -U huggingface_hub
  2. Launch the interactive cache manager:
    huggingface-cli delete-cache
  3. Use the arrow keys and spacebar to select old, unused model weights to delete, then press Enter.

Method 2: Manual Cache Deletion

To wipe the entire cache and reclaim all space instantly:

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

# Windows (Command Prompt)
rmdir /s /q %USERPROFILE%\.cache\huggingface

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

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