Hugging Face Cache on Mac: Can You Delete It?

High riskAI & machine learningUpdated

Facts from the app
Location
  • ~/.cache/huggingface
Risk level
High riskLarge stores — whole dependency repositories or downloaded AI models — that take a long time to get back. Listed, never pre-selected.
Selected by default
No — you choose whether to include it
What Freshist does
Moves the selected items to the Trash, so you can undo. Nothing is deleted outright.
In the app
Clean → Hugging Face Models — “Downloaded AI models & datasets — LARGE; re-downloaded when a model is next used.”

From Freshist's own cleaning rules — the same catalog the app uses.

What's in the Hugging Face home folder

huggingface_hub, and the libraries built on it such as Transformers, Diffusers and Datasets, store their files under HF_HOME. On a Mac that defaults to ~/.cache/huggingface, unless HF_HOME or XDG_CACHE_HOME is set. The main parts:

PathWhat it holdsComes back after deletion?
hub/Model, dataset and Space repos downloaded from the HubYes, downloaded again on next use
datasets/Processed dataset files written by the Datasets libraryYes, rebuilt from the source data
xet/Xet shard cache and upload stagingYes; used to speed up uploads
assets/Extra files cached by downstream librariesUsually, depending on the library
token, stored_tokensYour Hub access tokensNo. You need to log in again

How the hub cache grows

The hub cache is organized per repo (models--org--name) with blobs, snapshots and refs. Hugging Face's own guide states that cached files are never deleted from your local directory: when a new revision of a model appears, the previous files are kept in case you need them again. Large language models and diffusion checkpoints often weigh 5 to 50 GB each, so a few experiments can fill a disk quickly.

What happens after you remove models

The next time a script calls from_pretrained or hf_hub_download, the files download again, which can take a long time for large models on a home connection. Gated models (those that need you to accept a licence on the Hub) also need a valid token to download. Code that runs with HF_HUB_OFFLINE=1 fails until the files are back.

See what you have before deleting

du -sh ~/.cache/huggingface/*
hf cache ls                                 # repos, sizes, last accessed
hf cache ls --revisions --filter "accessed>30d"

hf is the current Hugging Face CLI; older installs ship the same features as huggingface-cli scan-cache. Neither command changes anything.

Clean it with the hf CLI

Hugging Face documents two cleanup commands:

  • hf cache rm model/<org>/<name> removes one repo (or a specific revision hash). Add --dry-run first to see what would go.
  • hf cache prune removes revisions that no branch or tag references, leftover .incomplete files from interrupted downloads, and shared files no repo uses anymore.

Both ask for confirmation and accept --dry-run. The docs also note that the xet folder can be removed entirely if you need the space; it only affects upload efficiency.

If you prefer Finder, delete folders inside ~/.cache/huggingface/hub rather than the parent folder, so your token stays in place.

Which models to keep

Keep models you run regularly, anything slow to download on your connection, and gated models you'd have to request again. Clear old revisions and models you tried once. Local model runners keep their own stores, explained in the Ollama models guide and the PyTorch cache guide.

Sources

Frequently asked questions

Will deleting the Hugging Face cache log me out?

Yes, if you delete the whole folder. The access token saved by hf auth login is stored at ~/.cache/huggingface/token by default. Delete only the hub folder, or use hf cache rm, to keep your login.

Why does the same model take space twice?

The cache keeps every revision you've downloaded. If a model was updated between two downloads, both versions stay until you remove the old one. hf cache prune deletes revisions no branch or tag points to anymore.

Do I need to keep models I fine-tuned?

Models you trained and saved with save_pretrained go to whatever folder you chose, not this cache. Check that you didn't point an output directory inside ~/.cache/huggingface before deleting anything.

Keep reading