Developer storage

Where the Hugging Face cache lives on macOS

The Hugging Face cache lives in ~/.cache/huggingface on macOS, with model repositories under hub/, datasets under datasets/, and some library files under transformers/. It is not in ~/Library/Caches. Measure it with du, inspect it with huggingface-cli scan-cache, and delete unused models with the cache CLI or by removing models--* folders.

Updated 2026-10-27

Key points

  • Default root: ~/.cache/huggingface, not ~/Library/Caches or the current project folder.
  • Models live in hub/models--<org>--<name>, with blobs for data, snapshots for revisions, and refs for branch pointers.
  • huggingface-cli env prints the active cache paths; scan-cache lists repositories and sizes.
  • HF_HOME moves the whole cache, while HF_HUB_CACHE moves only the model hub.
  • Deleted models must be downloaded again, and removing the cache root also removes the saved access token.

On macOS, the Hugging Face cache is ~/.cache/huggingface, not ~/Library/Caches. Model weights go under hub/, datasets under datasets/, and some library files under transformers/. It is separate from Ollama’s ~/.ollama/models. Measure it before deleting, because every model you remove has to be downloaded again.

The default location

~/.cache/huggingface

The model hub is the largest part:

~/.cache/huggingface/hub

Inside it, each repository gets a folder named models--<org>--<name>. That folder contains:

  • blobs/ — the actual file contents, addressed by digest
  • snapshots/ — per-revision directories with symlinks into blobs
  • refs/ — pointers from branch names to revision hashes

Because snapshots are symlinks, several revisions of the same model can share blobs. This is why deleting one snapshot directory may not free as much as expected; the underlying blobs remain until no reference needs them. The cache CLI handles this bookkeeping better than manual deletion.

The root also holds small metadata and, by default, the saved access token. Deleting the entire ~/.cache/huggingface folder removes that token along with the models, so you will need to log in again for gated repositories.

Confirm the active path

If huggingface-cli is installed:

huggingface-cli env

The output includes HF_HUB_CACHE and related cache paths. The location may differ from the default if HF_HOME or XDG_CACHE_HOME is set. Measure the folders:

du -sh ~/.cache/huggingface
du -sh ~/.cache/huggingface/hub
du -sh ~/.cache/huggingface/hub/models--* | sort -hr | head -20

du reports allocated disk blocks, which is the number that matters for free space. Finder does not show the folder by default because it is hidden; press Shift-Command-G and paste the path to browse it.

Inspect before deleting

huggingface-cli scan-cache

The scan lists repository IDs, sizes, last access times and revisions. In newer versions of the library, the hf CLI provides the same function:

hf cache scan

Use this output to decide which models you actually use. A model downloaded once for an experiment can be several gigabytes, and old revisions can multiply that.

Delete unused models and datasets

Interactive cleanup is the safest option:

huggingface-cli delete-cache

The newer equivalent is hf cache delete. Both let you select repositories or revisions rather than deleting blindly.

You can also remove a repository directory directly:

rm -rf ~/.cache/huggingface/hub/models--org--name

Do this only while no download, training job or inference server is using the model. Removing datasets/ and transformers/ is also fine when you no longer need those caches; both are rebuilt on demand. Avoid deleting individual files inside snapshots/, because that breaks the link structure for a revision.

If a repository is gated and requires approval, re-downloading it may involve more than waiting: you may need to be signed in with an account that still has access. Keep that in mind before deleting large gated models.

Move the cache to another drive

Set HF_HOME before Python starts:

export HF_HOME=/Volumes/External/hf

HF_HOME is the cache root; the hub, datasets and other caches are created under it. If you only want to move model weights, set HF_HUB_CACHE instead. Add the export to ~/.zshrc for shell sessions.

Changing the variable does not move existing files. Stop any process using the cache, move the folder to the new location, and verify that the new path works. Apps launched from the Dock do not inherit shell exports, so a GUI tool may need the variable set at login or in its own environment settings.

If you work offline, HF_HUB_OFFLINE=1 prevents the library from trying to reach the Hub, but it does not change where files are stored.

Avoid duplicate downloads

  • Pin a revision when reproducibility matters, instead of downloading every new commit.
  • Reuse one cache across projects rather than downloading into each project directory.
  • Use local_files_only=True when the model is already cached and the network is slow.
  • Prefer smaller or quantized models for experiments.
  • Delete old revisions through the cache CLI so unused blobs are actually released.
  • If you also run Ollama, check ~/.ollama/models separately; the two tools do not share weights.

Downloading with --local-dir creates a separate copy outside the cache. That copy is not managed by the cache cleanup tools, so use it deliberately and remove it when the project ends.

How Maclean handles Hugging Face storage

Maclean scans the Hugging Face hub, datasets and transformers caches as part of its developer-cache pass. Individual model repositories above a small size threshold are listed separately and labeled as requiring a re-download; the dataset and transformers caches are treated as regenerable.

maclean scan --tab dev-cache
maclean clean --tab dev-cache --dry-run

Developer-cache tabs delete permanently in the CLI, so review the dry run before confirming. Large files and duplicates use the Trash and can be restored with maclean restore <id>. The app adds a visual review and a 14-day trial; the CLI is free and open source under Apache-2.0.

For the other local model store, see where Ollama stores models. For general developer space, see node_modules disk space.

Bottom line

The cache is at ~/.cache/huggingface, with models in hub/ and datasets in datasets/. Confirm the path, measure the repositories, and delete unused ones with the cache CLI so shared blobs are cleaned correctly. Move it with HF_HOME before the next download if the internal disk is tight.

FAQ

Frequently asked questions

Where is the Hugging Face cache on a Mac?

By default it is ~/.cache/huggingface. Models are under hub/, datasets under datasets/, and some library-specific files under transformers/. The folder is hidden at the root of your home directory, not inside ~/Library.

Why is the cache not in ~/Library/Caches?

The huggingface_hub library uses an XDG-style cache path based on your home directory, not the macOS-specific Library location. That is why Finder search and some storage tools miss it unless hidden folders are included.

Is it safe to delete the Hugging Face cache?

Yes, if you accept re-downloading what you remove. Models and datasets are not user data; they are copies of files hosted on the Hub. Do not delete while a download, training run or inference server is using them, and keep gated repositories in mind if access requires approval.

How do I move the cache to an external drive?

Set HF_HOME to a directory on the external volume before starting Python, then move the existing cache there while nothing is using it. HF_HUB_CACHE moves only the model hub. The variable must be visible to the process, so apps launched from the Dock may need it set at login.

Why are there symlinks inside the cache?

The snapshots directory contains links to files stored in blobs. Multiple revisions that share a file point to the same blob instead of storing duplicates. Delete through the cache CLI or remove a whole models--* repository rather than individual snapshot links.

Does Ollama use the Hugging Face cache?

No. Ollama stores its models in ~/.ollama/models. If you use both tools, you may have two copies of similar weights, and each has to be cleaned separately.

Preview first, then clean safely

Maclean breaks down caches, app data, large files and APFS snapshots, and labels the risk of every item before deletion.

Download for Mac→