# Hugging Face Cache on Mac: Can You Delete It?

> ~/.cache/huggingface stores downloaded models and datasets, often tens of GB. They download again on next use, but your Hub login token lives here too.

- Updated: 2026-10-10
- URL: https://fresh.ist/caches/huggingface/

**TL;DR:** You can, but do it selectively. ~/.cache/huggingface is the Hugging Face home folder: downloaded model weights and datasets, plus your saved access token. Models and datasets download again the next time code asks for them, which can mean many gigabytes. Deleting the whole folder also logs you out. hf cache rm and hf cache prune let you remove only what you don't need.

## Facts from the Freshist app

- Category in Clean: Hugging Face Models — "Downloaded AI models & datasets — LARGE; re-downloaded when a model is next used."
- Location: `~/.cache/huggingface`
- Risk level: High risk — Large stores — whole dependency repositories or downloaded AI models — that take a long time to get back. Listed, never pre-selected.
- Selected by default: no
- What Freshist does: Moves the selected items to the Trash, so you can undo. Nothing is deleted outright.

## 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:

| Path | What it holds | Comes back after deletion? |
| --- | --- | --- |
| `hub/` | Model, dataset and Space repos downloaded from the Hub | Yes, downloaded again on next use |
| `datasets/` | Processed dataset files written by the Datasets library | Yes, rebuilt from the source data |
| `xet/` | Xet shard cache and upload staging | Yes; used to speed up uploads |
| `assets/` | Extra files cached by downstream libraries | Usually, depending on the library |
| `token`, `stored_tokens` | Your Hub access tokens | No. 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

```bash
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](/caches/ollama/) and the [PyTorch cache guide](/caches/torch-cache/).

## Sources

- [Hugging Face: Understand caching (manage cache)](https://huggingface.co/docs/huggingface_hub/guides/manage-cache)
- [Hugging Face: Environment variables (HF_HOME, HF_TOKEN_PATH)](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables)
- [Hugging Face: Command line interface](https://huggingface.co/docs/huggingface_hub/guides/cli)

## 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.

---

Canonical page: https://fresh.ist/caches/huggingface/
Official site: https://fresh.ist/ (fresh.ist only)
Generated: 2026-10-10
