# Where the hf CLI downloads models and how to move it

> Find the hf CLI cache path on Windows, macOS and Linux, inspect it with hf cache ls, move it with HF_HOME, and prune old models.

- Canonical: https://guides-ai.com/guides/hugging-face-cache-location/
- Plate 16.03 · Topic: Hugging Face (https://guides-ai.com/topics/huggingface/)
- Published: 12 Oct 2026 · 3 min read
- Source site: guides-ai — https://guides-ai.com/

The `hf` CLI keeps downloaded models in one shared cache so several tools reuse a single copy. Knowing where that is lets you free space, move it to a bigger drive, or work offline.

## 1. Find the default cache path

The cache lives under `HF_HOME`, which defaults to `~/.cache/huggingface`; repos go in its `hub` subfolder (`HF_HUB_CACHE`, default `$HF_HOME/hub`):

- macOS / Linux: `~/.cache/huggingface/hub`
- Windows: `C:\Users\<you>\.cache\huggingface\hub`

Inside, each repo is a folder like `models--bartowski--Llama-3.2-3B-Instruct-GGUF` holding `snapshots/`, `blobs/` and `refs/`. The `snapshots` folder has the files you actually use (symlinks to `blobs`, which holds the real data); `refs` records the latest commit per branch.

## 2. See the path with hf cache ls and hf env

```bash
hf cache ls
```

Lists every cached repo with its size, last-accessed time and refs. Add `--revisions` for per-snapshot detail.

```bash
hf env
```

Prints your setup, including the resolved cache directory. Trust this over any guess about the path.

## 3. Move the cache to another drive

Set `HF_HOME` before downloading. `huggingface_hub` reads it at import, so set it in your shell profile, not mid-script.

macOS / Linux:

```bash
export HF_HOME=/mnt/bigdrive/hf
```

All HF data (model cache plus token) now lands under that path.

Windows (PowerShell):

```powershell
[Environment]::SetEnvironmentVariable("HF_HOME", "D:\hf", "User")
```

Sets it permanently for your user; reopen the terminal to pick it up. To move only the model cache and leave the token in place, set `HF_HUB_CACHE` instead. Details are in the official [cache guide](https://huggingface.co/docs/huggingface_hub/guides/manage-cache).

## 4. Clean old models and revisions

```bash
hf cache ls --filter "size>5G" --revisions
hf cache rm model/bartowski/Llama-3.2-3B-Instruct-GGUF
hf cache prune
```

`ls --filter` finds the big items; `rm` deletes a repo or a revision hash; `prune` clears unreferenced revisions and `.incomplete` leftovers from interrupted downloads. Add `--dry-run` to preview, or `--yes` to skip the prompt.

To drop a single GGUF quant without touching the rest:

```bash
hf cache rm hf://models/bartowski/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf
```

Removes that one file; it re-downloads next time it is needed.

## 5. Work offline

```bash
export HF_HUB_OFFLINE=1
```

PowerShell: `$env:HF_HUB_OFFLINE = "1"`. Skips all Hub HTTP calls and serves only cached files; a missing file then raises an error instead of downloading.

**If it fails:**

- `hf env` still shows the old path after setting `HF_HOME` — you set it only in the current shell, or after Python already imported the library. Set it in your profile and open a new terminal.
- Windows warning `cache-system uses symlinks ... not supported` — enable Developer Mode or run as admin, or set `HF_HUB_DISABLE_SYMLINKS=1` to copy files into snapshots instead.
- `hf cache rm` reports the revision was not found — you passed a branch name. Pass a repo id (`model/org/name`) or a full revision hash from `hf cache ls --revisions`.

---

Next: [download models with the hf CLI](/guides/hugging-face-cli-download-models/) · [upload a model or dataset](/guides/hugging-face-upload-model-or-dataset/) · [how much RAM or VRAM a model needs](/guides/local-llm-ram-vram-requirements/).
