# Hugging Face Cache on Windows: Inspect, Clean and Relocate

Hugging Face downloads can fill a Windows drive through several model revisions, datasets and interrupted downloads. Start with the cache tooling in the environment that downloaded them. Deleting an arbitrary `blobs` folder can damage revisions that still share those files, while deleting all of `HF_HOME` can also remove authentication state.

## Find the cache that your application actually uses

The usual Hub cache is `%USERPROFILE%\.cache\huggingface\hub`, but an application can use a different account, environment variable or explicit cache directory. The [environment-variable reference](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables) distinguishes `HF_HOME`, `HF_HUB_CACHE` and `HF_XET_CACHE`. `HF_HOME` is broader than the model cache and includes the stored authentication token.

Open the terminal or Python environment used by the AI application and inspect its installed command:

```
hf cache --help
hf cache ls
hf cache ls --revisions
```

These are inventory commands. If `hf` or a subcommand is unavailable, check the `huggingface_hub` version in that environment and the tool's supported upgrade path. Do not upgrade an unrelated global Python installation and assume it changes the app's private environment.

For a configured Hub cache elsewhere, pass the actual path with `--cache-dir`. A listing from the default location does not prove that the larger custom location is empty.

## Check the command and path before trusting the total

In PowerShell, these checks show which executable is being called and the current process's path overrides. They do not display the authentication token:

```powershell
Get-Command hf | Select-Object Source
$env:HF_HOME
$env:HF_HUB_CACHE
$env:HF_XET_CACHE
```

An empty line means that variable is not set in this PowerShell process. It does not prove that a desktop launcher, virtual environment or service uses no override. Compare these readings with the application that performed the download, especially when several Python installations are present.

For an example custom cache, use its explicit path in both the inventory and preview:

```powershell
hf cache ls --cache-dir "D:\AI\huggingface\hub" --revisions
hf cache rm model/OWNER/REPOSITORY --cache-dir "D:\AI\huggingface\hub" --dry-run
```

Replace the path and repository ID with values found on the PC. If the installed command rejects an option, stop and read its help. Do not turn a syntax failure into a manual folder deletion. A listing of zero entries at a newly typed path is also not proof that the actual cache is empty.

## Understand why multiple revisions can cost more on Windows

Hugging Face's [cache explanation](https://huggingface.co/docs/huggingface_hub/guides/manage-cache) describes shared blobs and revision snapshots. On Windows without symlink support, files can be stored directly in snapshots, so the same file may occupy space more than once across revisions.

Developer Mode can enable the more efficient symlink behavior where policy permits it. Hiding the symlink warning does not enable symlinks or retroactively deduplicate old downloads. Do not run an entire AI application as administrator just to silence that message.

Also distinguish the Hub cache from model files copied into an application's own folder. A cache command does not inventory every `.safetensors` or GGUF file on the PC.

## Avoid counting shared model files twice

The current cache documentation describes sharing not only between revisions but also across repositories for eligible Xet downloads. A repository's reported size can be logical while the cache-wide physical size counts shared files once. Adding every repository size can therefore overstate the amount that deleting them would recover.

This matters when two model names appear equally large. They may contain different weights, shared files or separate copies, depending on the download method and filesystem. Let the compatible cache tool compute a deletion plan instead of assuming that every listed gigabyte is independent.

The same documentation warns that older clients do not all manage the newer shared store correctly. If the cache was created by a newer library than the tool you are about to use for removal, check the application's supported version before cleanup. Preserve the existing environment or use a compatible maintained tool deliberately; do not update an application's pinned dependencies blindly.

The Hub cache is only one location. Xet data, dataset-processing output and files explicitly downloaded into a local model directory may sit elsewhere. If the Hub preview accounts for only a small part of the disk use, identify those other owners rather than making the Hub deletion more aggressive.

## Preview removal of one known repository

Stop downloads, training and inference using the target cache. Identify a repository you no longer need and confirm that its exact revision is available again if recovery matters. Gated access, deleted upstream files and offline use can make a nominally downloadable model difficult to replace.

The current [CLI guide](https://huggingface.co/docs/huggingface_hub/guides/cli) supports a preview:

```
hf cache rm model/OWNER/REPOSITORY --dry-run
```

Replace `model/OWNER/REPOSITORY` with the exact ID from the listing. Read the affected revisions and size. Only after that review, run the same command without `--dry-run` and answer its confirmation. This is deletion, not a move to the Recycle Bin.

For cleanup of unreferenced cache material, preview the installed tool's plan separately:

```
hf cache prune --dry-run
```

An unreferenced revision can still be required by a script pinned to its commit. Check those projects before accepting a prune. Do not use a blanket confirmation flag to bypass that review.

## Check a prune plan against real projects

A branch or tag reference in the cache is not a complete inventory of what your projects need. A script may name an exact revision hash that is no longer the cached branch tip. Before accepting a prune, search the configuration of active projects for the model ID and pinned revision, and keep a copy of anything required for offline or reproducible work.

Current CLI documentation also includes interrupted `.incomplete` downloads in prune behavior. Finish or stop the owning download before reviewing the plan. A partial file left by an interrupted download is different from a file that another running process is still writing.

After one reviewed removal, rerun the inventory for the same explicit cache path and compare available space on the same drive. Then run a small representative workload. If it immediately downloads a large model again, that workload still requires the removed data; repeating the cleanup will only trade disk use for download time.

For a move, keep authentication state out of the operation unless relocating it is intentional. Pointing only `HF_HUB_CACHE` at a different drive is narrower than moving all of `HF_HOME`. Record the old value before changing it, restart the owning app and check where its next actual download appears. If the app keeps using the old directory, investigate its explicit cache path before removing either copy.

## Move future downloads without confusing the locations

To place the Hub cache on another drive, configure `HF_HUB_CACHE` for the application that owns it, then fully restart that application. Environment changes must be present before the library imports. An app-specific `cache_dir` can still point elsewhere, so verify the next download's actual destination.

Changing the variable does not move the old files. Keep the old cache until the new location has been tested and any required local-only material is preserved. If the old directory is still large, review it explicitly with the cache tool and its path.

After cleanup, test one important workload and compare free space on the same volume. For Ollama's separate model store, use the [Ollama migration guide](/windows/blog/move-ollama-models-windows). Shared branding around AI does not mean the tools share one cache or one safe deletion command.


Canonical: https://mole.fit/windows/blog/huggingface-cache-windows
