Is the Hugging Face cache safe to delete? What's inside ~/.cache/huggingface

Yes, but read this firstDiskmack safety tier: Caution
~/.cache/huggingface

Yes, you can delete the Hugging Face cache, but know what you're signing up for: every model you still use will re-download the next time a script asks for it, and that can be many gigabytes over the network. The folder at ~/.cache/huggingface holds models and datasets downloaded from the Hugging Face Hub, and it grows silently to tens of GB. If your ML experimenting days are behind you, clearing it is one of the biggest single wins on a full Mac.

What it is

~/.cache/huggingface is the shared download cache for the Hugging Face ecosystem: the transformers, diffusers, datasets, and sentence-transformers libraries, plus any app built on top of them. Every time Python code calls from_pretrained, the library checks this folder first and downloads the model weights if they aren't there yet. Most of the bulk sits in the hub subfolder, where each model gets its own directory named models--organization--modelname, and downloaded datasets sit alongside them with a datasets-- prefix.

It grows because models are big and nothing is ever evicted. A small text model might be a few hundred megabytes, an image generation model several gigabytes, and local LLM weights bigger still. The libraries keep every model and every revision you've ever pulled, forever, on the theory that you might want it again. One afternoon of following a tutorial can leave 5 to 10 GB behind, and tools that use these libraries under the hood (local chat apps, embedding tools, transcription scripts) fill the same cache without ever telling you.

Is it safe to delete?

Nothing breaks permanently if you delete it. No app needs this folder to launch; it's purely a download cache, and any model you use again will re-download to the same spot. The caution is the cost of that re-download: pulling a few large models back can mean tens of gigabytes over the network, which is slow on hotel Wi-Fi and expensive on a metered connection. If you still run ML work regularly, prune individual models instead of wiping the whole thing.

One wrinkle: your Hugging Face login token also lives at the top level of this folder. Delete the entire folder and you'll need to run huggingface-cli login again before you can push models or pull from gated repos. If you only remove folders inside hub, your login is untouched. Diskmack identifies this cache automatically and cleans it the safe way, moving it to the Trash instead of deleting it in place.

How to check its size

In Finder: In Finder, choose Go > Go to Folder (or press Cmd-Shift-G), paste ~/.cache/huggingface, and press Return. Select the folder, press Cmd-I, and wait for the Get Info window to finish counting.

In Terminal:

du -sh ~/.cache/huggingface

How to clean it

  1. Quit any running Python scripts, notebooks, or apps that use Hugging Face models, so nothing is mid-download while you clean.
  2. In Finder, choose Go > Go to Folder, paste ~/.cache/huggingface, and press Return.
  3. Open the hub folder. Each model lives in its own folder named models--organization--modelname, so you can see exactly what you've collected.
  4. Switch to list view, choose View > Show View Options, and check Calculate all sizes. Sort by size to find the heavy ones.
  5. Drag the model folders you no longer use to the Trash. To clear everything, drag the whole hub folder instead, and leave the token file in place so you stay logged in.
  6. Empty the Trash once you're sure you won't need those models this week.

Deleting the whole ~/.cache/huggingface folder also removes your login token. Run huggingface-cli login (or hf auth login on newer installs) afterward if you use gated models or push to the Hub.

Will it come back?

Yes, and quickly if you're still doing ML work. The first time any script calls from_pretrained after a cleanup, the full model downloads again to the exact same path, so clearing the cache the night before a project deadline just trades disk space for download time. If the folder keeps refilling, two habits help: prune individual models every few months rather than letting the folder compound, or point the cache at an external drive by setting the HF_HOME environment variable so your internal disk stays clear.

Common questions

Can I delete just one model instead of the whole cache?

Yes. Inside ~/.cache/huggingface/hub, each model has its own folder named models--org--name. Drag any of them to the Trash individually. Run du -sh ~/.cache/huggingface/hub/* in Terminal to see which ones are worth removing first.

Will deleting the cache log me out of Hugging Face?

It can. Your access token is stored at the top level of ~/.cache/huggingface, so deleting the entire folder removes it, and you'll need to run huggingface-cli login again. Deleting only the folders inside hub leaves your login alone.

Can I move the cache to an external drive instead of deleting it?

Yes. Set the HF_HOME environment variable to a path on the external drive, for example export HF_HOME=/Volumes/External/huggingface in your shell profile. New downloads land there. To keep the models you already have, move the contents of the old ~/.cache/huggingface folder to the new location first; otherwise everything re-downloads on next use.

Why is this folder huge when I barely use Hugging Face?

Because libraries download models automatically. One diffusers tutorial can pull several gigabytes, and apps built on transformers (local chat UIs, embedding tools, Whisper transcription scripts) share this same cache without ever mentioning it. The folder is the sum of everything any of them ever fetched.

Related folders