Hugging Face Cache on Mac: Where It Is and How to Clear It

On this page
- Where is the Hugging Face cache on a Mac?
- What was in the cache on my Mac?
- How is the hub folder organised?
- How much space is your Hugging Face cache using?
- How do I clear the Hugging Face cache?
- Is it safe to delete the Hugging Face cache?
- Can I move the Hugging Face cache to an external drive?
- Where else do AI models pile up on a Mac?
- Questions about the Hugging Face cache
- See every AI model folder in one list
Quick answer: On a Mac the Hugging Face cache is ~/.cache/huggingface, and downloaded models sit in its hub folder. HF_HOME or HF_HUB_CACHE can move it. To clear it, list it with hf cache ls, remove a model with hf cache rm, and tidy leftovers with hf cache prune. Anything deleted downloads again on next use.
Tested on: MacBook Air M1, 16 GB, macOS 27.0.1, on 23 November 2026. I measured my own cache with
du,ls,statandhuggingface-cli scan-cachefrom huggingface_hub 0.22.2. The newerhftool is not installed on this Mac, so its commands come from Hugging Face's documentation. Deletion tests ran on copies in a scratch folder.
Where is the Hugging Face cache on a Mac?
By default everything goes under one hidden folder in your home folder:
~/.cache/huggingface
Hugging Face's environment variable reference names that folder HF_HOME and puts the model cache at $HF_HOME/hub. Transformers, Diffusers and anything else that downloads through the Hub library uses it.
Finder hides folders that start with a dot. To open it, press Cmd + Shift + G in Finder, paste ~/.cache/huggingface and press Return. Cmd + Shift + . (period) toggles hidden files instead.
The variables that move it
If the folder is missing or looks too small, one of these is probably set. Defaults are from the reference above, except the Datasets line, which comes from the Datasets cache guide.
| Variable | What it controls | Default |
|---|---|---|
HF_HOME | The whole Hugging Face folder, including your login token | ~/.cache/huggingface |
XDG_CACHE_HOME | Used only when HF_HOME is unset; the folder becomes $XDG_CACHE_HOME/huggingface | not set on my Mac |
HF_HUB_CACHE | Models, datasets and Spaces from the Hub | $HF_HOME/hub |
HF_XET_CACHE | Xet upload and shard data | $HF_HOME/xet |
HF_TOKEN_PATH | The saved login token | $HF_HOME/token |
HF_DATASETS_CACHE | The Datasets library's processed Arrow files | $HF_HOME/datasets |
The reference lists HUGGINGFACE_HUB_CACHE as an older name for HF_HUB_CACHE. It still works, but the new name wins when both are set.
To see which of these your shell has, run:
env | grep -E '^(HF_|XDG_CACHE)'
On my Mac that printed nothing, so every path below is the default.
What was in the cache on my Mac?
du -sh ~/.cache/huggingface reported 11G. The scan in huggingface-cli reported 11.6G across seven models. Both are right: du -sh counts in units of 1,024, and Hugging Face's tools count in units of 1,000, as Finder does.
Here is the scan, with the biggest single file in each model measured by stat:
| Model (repo ID) | Size in scan | Files | Biggest file |
|---|---|---|---|
ResembleAI/chatterbox | 3.2 GB | 5 | t3_cfg.safetensors, 2.13 GB |
Systran/faster-whisper-large-v3 | 3.1 GB | 7 | model.bin, 3.09 GB |
facebook/nllb-200-distilled-600M | 2.5 GB | 9 | pytorch_model.bin, 2.46 GB |
deepdml/faster-whisper-large-v3-turbo-ct2 | 1.6 GB | 7 | model.bin, 1.62 GB |
csukuangfj/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8 | 671.2 MB | 9 | encoder.int8.onnx, 652 MB |
hexgrad/Kokoro-82M | 329.8 MB | 7 | kokoro-v1_0.pth, 327 MB |
csukuangfj/sherpa-onnx-whisper-tiny | 256.6 MB | 10 | tiny-decoder.onnx, 115 MB |
None of these came from the Hugging Face website. Speech and translation tools I use pulled them in the background by repo ID. Each model had exactly one version on disk, so in my case old revisions were not the problem. The weight files were.
Apart from hub, the folder held only xet, at 12 KB of logs and an empty staging folder. There was no datasets folder and no token file, because I never used the Datasets library or signed in here.
How is the hub folder organised?
Each model gets its own folder named models--owner--name. Datasets and Spaces get datasets-- and spaces-- in front instead. This is one real model folder from my Mac, trimmed:
models--Systran--faster-whisper-large-v3/
refs/main 40-character commit hash
snapshots/edaa852e.../
model.bin -> ../../blobs/69f74147...
config.json -> ../../blobs/75336fea...
(5 more links)
blobs/
69f74147... 3,087,284,237 bytes
(6 more files)
blobs/holds the real data. Each file is named after its hash, not its original name.snapshots/has one folder per downloaded version. Every file in it is a symbolic link, 52 to 79 bytes on my Mac, pointing intoblobs. Your code reads from here.refs/maps names likemainto a commit, which is how the library knows which snapshot is current.
The links are relative (../../blobs/...). That matters if you move the cache: move the whole folder and they keep working.
Two small extras sit at the top of hub. .locks holds lock files during downloads and was empty here. CACHEDIR.TAG, according to Hugging Face's cache management guide, tells backup tools the folder can be downloaded again.
The shared blobs folder
My hub folder also had a blobs folder of its own, outside every model, holding 3.5 GB. It contained a marker file called .huggingface-shared-blobs.
Hugging Face's local cache page explains it. Newer versions of the library store files that arrive through its Xet storage once, in this shared folder. The model's own blobs then holds only links to them.
Two of my models, chatterbox and Kokoro, were stored this way. So du -sh on the chatterbox folder said 32K, while its files really take 3.2 GB. If you size models by folder, the biggest ones can look empty.
How much space is your Hugging Face cache using?
For one total, which counts shared blobs correctly because they sit inside the folder:
du -sh ~/.cache/huggingface
For a size per model, use Hugging Face's own tool instead of du on each folder. In current versions it is hf:
hf cache ls
hf cache ls --revisions
hf cache ls --filter "size>1GB"
hf cache ls --filter "accessed>30d"
The CLI reference documents these options. --revisions splits a model into its versions, and the filters pick out big or unused items. Not tested here, because hf is not installed on this Mac.
If your Python has an older library, you may only have huggingface-cli scan-cache, which is what produced my table. Hugging Face's 1.0 migration notes say huggingface-cli was removed in 1.0, with hf taking over from version 0.34.
The same docs list pip install -U huggingface_hub and brew install hf among the ways to get the new tool.
How do I clear the Hugging Face cache?
Hugging Face's own method is the hf cache commands. They know which links belong to which model, which a plain folder delete does not.
hf cache commands, in the order to run them.Remove one model with hf cache rm
- Run
hf cache lsand copy the ID of the model you no longer need, such asmodel/Systran/faster-whisper-large-v3. - Preview the deletion:
hf cache rm model/Systran/faster-whisper-large-v3 --dry-run. Nothing is removed. - Run it again without
--dry-run. The CLI reference says it asks for confirmation unless you add-y.
You can pass several IDs at once, or a revision hash from hf cache ls --revisions to drop just one version. Not tested here.
Clean up leftovers with hf cache prune
hf cache prune --dry-run
hf cache prune
Per the cache management guide, prune removes revisions no branch or tag points to any more, half-finished downloads, and shared blobs no model uses. That last part matters, as my test below shows. Not tested here.
What I saw when I deleted copies of two models
I copied two models and the shared blobs they use into a scratch folder, 559M by du -sh, and deleted them with the installed library's Python API (scan_cache_dir, then delete_revisions and execute):
| Copy deleted | Library said it would free | Scan afterwards | Left on disk (du) |
|---|---|---|---|
| sherpa-onnx-whisper-tiny (normal blobs) | 256.6 MB | gone | nothing; the folder was removed |
| Kokoro-82M (shared blobs) | 329.8 MB | 0.0, nothing listed | 315M (about 330 MB) still in the shared blobs folder |
Version 0.22.2 predates the shared store, so it removed only the links. Deleting a models-- folder in Finder would do the same. Once a scan stops listing the model, that space is invisible to it.
The fix is a current hf cache prune, which the docs say removes unused shared blobs, or deleting the whole hub folder.
Delete the whole cache
If you want every model gone, remove the hub folder. It is the only big part, and it does not contain your login token:
rm -rf ~/.cache/huggingface/hub
rm -rf deletes permanently, with no Trash. If you would rather be able to undo it, drag the hub folder to the Trash in Finder and empty the Trash later. Quit any notebook or app using a model first.
Two smaller caches have their own documented clean-ups. The cache management guide says to remove the xet folder by hand, as there is no command for it. The Datasets guide offers Dataset.cleanup_cache_files() for its Arrow files.
Is it safe to delete the Hugging Face cache?
For almost all of it, yes. The cache is a local copy of files hosted on the Hub. Removing it does not affect macOS, Python or your installed packages. The next script that asks for a model downloads it again.
Pause in these cases:
- Slow or metered internet. On my Mac, getting chatterbox back alone means 3.2 GB of downloads.
- Offline work. The variable reference says that with
HF_HUB_OFFLINEset, a file missing from the cache raises an error. - Models that may disappear. If a model is gated and you lose access, or its owner deletes it, your cached copy may be the only one left.
- The token file. It lives at
$HF_HOME/token, outsidehub. Deleting the wholehuggingfacefolder signs you out.
Models you train yourself are not here. save_pretrained() and training scripts write to the folder you give them.
Can I move the Hugging Face cache to an external drive?
- Quit anything that uses Hugging Face models.
- Move the whole folder, so the relative links stay intact:
mv ~/.cache/huggingface /Volumes/External/huggingface - Add
export HF_HOME=/Volumes/External/huggingfaceto~/.zshrc. - Open a new Terminal window and run
hf cache lsto confirm your models are listed.
Not tested here. The variable reference says these variables are read when the library is imported, so set them before Python starts. Apps opened from the Dock do not read ~/.zshrc, so set HF_HOME in the app's own settings if it has one.
Keep the drive connected whenever you run models from it.
Where else do AI models pile up on a Mac?
The Hugging Face cache does not share files with other local AI tools, so one model can be on disk several times:
- Ollama keeps its own copies in
~/.ollama/models, 5.0 GB on my Mac. See where Ollama stores models and how to delete Ollama models. - LM Studio has its own models folder. See LM Studio models taking up space.
To plan disk space for all of this before you download, read how much storage local LLMs need on a Mac.
Questions about the Hugging Face cache
These come up most.
Why does hf cache ls show a different size than Finder or du?
Two reasons. Hugging Face's tools and Finder count a gigabyte as 1,000 megabytes, while du -h uses 1,024, so my 11.6 GB showed as 11G. And du on a single model folder misses files kept in the shared blobs folder.
What happened to huggingface-cli scan-cache and delete-cache?
They were replaced. The 1.0 migration notes say huggingface-cli was removed and that hf, added in 0.34, takes its place. The cache commands are now hf cache ls, rm, prune and verify.
Can I delete the snapshots folder to save space?
No. Snapshots are only links of a few bytes each; the data is in blobs. Deleting files inside a model by hand can leave a model that fails to load. Remove whole models with hf cache rm instead.
Does deleting the cache uninstall Transformers?
No. Python packages live in your Python installation, not in ~/.cache/huggingface. Only the downloaded models and data go, and they come back on next use.
See every AI model folder in one list
Purgy lists the Hugging Face cache under AI models, with its size, beside Ollama, LM Studio, GPT4All, PyTorch hub and Whisper. It is marked for review and never selected for you, because downloading models again costs real time.
Purgy treats the cache as one item, shared blobs included. If you choose it, it goes to the Trash, so you can put it back. For one model at a time, hf cache rm is the finer tool. See what your AI tools are holding with the free trial.