hugging face, mac, disk space
Where does Hugging Face store models on a Mac, and how do I clear the cache?
Last updated · 3 min read · By Muhammad Hamza
Hugging Face downloads models to ~/.cache/huggingface/hub and never deletes old revisions. How the cache is laid out, how to see what is big with hf cache ls, and how to remove it safely.
Hugging Face stores downloaded models in ~/.cache/huggingface/hub on a Mac, and it never deletes old revisions for you, so the cache only grows. You clear it with hf cache ls to look and hf cache rm to remove, ideally with --dry-run first.
Everything below is from the official huggingface_hub cache guide.
Where is the Hugging Face cache on macOS?
The default cache folder is ~/.cache/huggingface/hub. You can move it with the HF_HOME or HF_HUB_CACHE environment variables, according to the guide. See the environment variables reference for the full list.
The folder starts with a dot, so Finder hides it. In Finder, press Cmd+Shift+G and paste ~/.cache/huggingface/hub, or run open ~/.cache/huggingface/hub in Terminal.
What is inside the cache?
Each repo gets its own folder, and inside it are three parts:
blobs: the actual downloaded files, named by hash.snapshots: one folder per revision, holding symlinks that point back to the blobs.refs: which revision a branch likemainpoints to.
Because snapshots are symlinks, deleting a blob by hand can leave a snapshot pointing at nothing. The guide describes this layout, and it is the main reason to use the official commands instead of rm inside the folder.
The guide also says that when you download a new revision of a branch, the previous files are kept in case you need them again. That is why the folder keeps growing even when you only use one version.
How do I see what is taking the space?
List the cache with the hf command:
hf cache ls
hf cache ls --revisions --filter "size>1GB" --filter "accessed>30d"
The first command groups by repo and shows size and last accessed. The second lists individual revisions that are over 1 GB and have not been accessed in 30 days, which is exactly the list worth reviewing. Both forms come from the guide.
How do I delete a model from the cache?
Use hf cache rm, and preview first:
hf cache rm model/bert-base-cased --dry-run
hf cache rm model/bert-base-cased
--dry-run previews the impact without removing anything. Without it, the guide says hf cache rm permanently deletes the repo or revision: there is no Trash step. You can also remove a single revision by its hash.
There is also hf cache prune. Per the guide, it removes shared files that no cached repo uses anymore. Check its description in the CLI reference for the exact behaviour in your version.
What about the xet cache?
Recent versions keep a xet folder at ~/.cache/huggingface/xet. The guide says that if you need to reclaim that space, you can remove the whole xet cache. Models are downloaded again the next time they are needed.
Older tutorials mention huggingface-cli delete-cache. The current guide uses hf cache, so prefer that.
How do I avoid deleting something I still need?
- Run
hf cache lsand sort out what you have not accessed in a long time. - Run
hf cache rm ... --dry-runand read the list. - Check that you could download it again, and how long that takes.
- Only then run the real command.
A safer way: a list with sizes and a Trash step
The terminal does the job, but it is permanent and it only covers Hugging Face. Disk Goat is an offline Mac app we are building that shows every model store (Hugging Face, Ollama, LM Studio) with size and last-used date, lets you prune old revisions, runs a dry run, and moves what you pick to the Trash. It is not released yet. You can try a clickable demo of the app.