WindowsmacOSLinux

Where Does Hugging Face Store Downloaded Models?

Find the Hugging Face model and dataset cache on Windows, macOS and Linux, and which env vars move it.

Last updated

The Python hub client keeps every downloaded model, dataset and Space as content addressed blobs under one home directory. Revisions pile up fast, so a few popular models can fill tens of gigabytes without any visible project folder growing. The folder matters when disk space runs low, since cleanup starts here and backup copies grow with each revision kept.

The default lives under your home cache on all three desktop OSes. Two env vars override it, and the token sits in the same home tree. Point the cache at a big drive before your first large download, not after the system disk fills. Quit the Python process before moving or clearing the folder, then keep the token file while removing blobs and locks.

Where Hugging Face Hub stores this, by platform

Windows
%USERPROFILE%\.cache\huggingface\hub

Default hub cache. Override with HF_HUB_CACHE for just the hub dir, or HF_HOME for the whole tree. Token lives in the same home folder.

macOS
~/.cache/huggingface/hub

Same layout as Linux. Homebrew Python and system Python share it unless HF_HOME is set per project. Check the dir size with du before blaming your code.

Linux
~/.cache/huggingface/hub

Respects XDG_CACHE_HOME when HF_HOME is unset, so the real path can be $XDG_CACHE_HOME/huggingface/hub on some distros. The xet subfolder beside hub holds Xet backed files.

Frequently asked questions

How do I move the Hugging Face cache to another drive?

Set HF_HOME to change the whole home dir, or HF_HUB_CACHE to move just the hub cache. XDG_CACHE_HOME only applies on Linux when HF_HOME is unset. Restart the Python process after changing them.

Is it safe to delete the Hugging Face cache?

Delete the models--* folders inside hub, or run huggingface-cli delete-cache to pick revisions interactively. The .locks folder goes too. Your login token in the same home dir stays unless you delete that file as well.

Notice an outdated path? Let us know.