Home / Guides / LM Studio and Hugging Face Cache: Find and Delete Models on Mac
LM Studio and Hugging Face Cache: Find and Delete Models on Mac
Before you start
The commands below are provided as-is, without warranty of any kind. Deletion is permanent: rm does not use the Trash and there is no undo, so make a backup first (for example with Time Machine). Paths and command names vary by tool version and how you installed it. Use at your own risk; Yogi Software Works is not liable for data loss or other damage resulting from these commands. See our Terms.
LM Studio and Hugging Face tools store models in different places on your Mac. LM Studio keeps GGUF model files in a models folder, while Hugging Face libraries keep downloaded repositories in a cache folder. This guide shows how to find both, check their sizes and delete models you no longer need. The manual steps work without any paid software.
Disclosure: I'm the developer of AiKiller (Yogi Software Works), a paid Mac app that can do part of this cleanup. The manual steps below work without it.
Part 1: LM Studio models
Find the models folder
LM Studio's import documentation shows the models folder as ~/.lmstudio/models, organized as publisher/model/model-file.gguf. The download documentation says the models directory can be changed in the My Models view. AiKiller also checks ~/.cache/lm-studio/models, which may be used by older versions. This read-only command shows which of these exist:
ls -d ~/.lmstudio/models ~/.cache/lm-studio/models 2>/dev/null
If you changed the directory in LM Studio, look in the new location instead. Its path is shown in the app.
Check sizes
Size per publisher folder, then every .gguf file sorted by size (the two commands are read-only; missing folders are skipped):
du -sh ~/.lmstudio/models/*/ 2>/dev/null
find ~/.lmstudio/models ~/.cache/lm-studio/models -name "*.gguf" -exec du -h {} + 2>/dev/null | sort -hr
If you have the lms command-line tool, lms ls lists downloaded models with their sizes (see the lms ls documentation).
Delete a model
Quit LM Studio first so no file is in use. LM Studio may also offer a delete option in My Models in your version; check the app. To delete by hand, remove the model's folder (or the single .gguf file) from the models directory. Deletion is permanent:
rm -rf "$HOME/.lmstudio/models/<publisher>/<model>"
Substitute the real names: replace <publisher> and <model> with the folder names you saw above, and keep the double quotes. Check the path before you press Return.
What else lives in ~/.lmstudio
The ~/.lmstudio folder holds more than models. The numbers below are one example measured on one MacBook with LM Studio installed and no models downloaded. They are not typical, and sizes vary by LM Studio version. On that Mac the folder was about 1.5 GB in total:
extensions: about 1.2 GB (runtimes and extensions, not models)apps: about 81 MBbin: about 62 MBcredentials: a few KBmodels: empty
To see the same breakdown on your Mac (read-only):
du -sh ~/.lmstudio/* 2>/dev/null | sort -hr
Take care with two of these folders. credentials may hold sign-in details. Deleting the whole ~/.lmstudio folder removes LM Studio's settings and extensions along with your models, so delete only the model folders unless you intend to remove LM Studio entirely. AiKiller's Local Models screen lists .gguf files in the model folders only; it does not cover extensions or the other folders in this list.
Part 2: Hugging Face cache
Find the cache
The default cache folder is ~/.cache/huggingface/hub. It can be moved with the HF_HUB_CACHE or HF_HOME environment variable, per the environment variable documentation. If a variable is set, the command prints its value; blank means it is not set in that Terminal session:
echo "$HF_HOME" "$HF_HUB_CACHE"
ls -d ~/.cache/huggingface/hub
Each cached repository is a folder named by type and repository ID, with slashes replaced by --. For example, the model julien-c/EsperBERTo-small is stored as models--julien-c--EsperBERTo-small. Inside are blobs (the actual files), refs and snapshots (symlinks to the blobs); see the cache documentation. Datasets and spaces use the prefixes datasets-- and spaces-- in the same folder.
Check sizes
The biggest items first. In a test with placeholder files on a macOS virtual machine, du reported the size of a repository folder's blob file, since the snapshot entries are symlinks. If nothing matches, zsh prints no matches found, which only means there are no cached models there:
du -sh ~/.cache/huggingface/hub/models--* 2>/dev/null | sort -hr
du -sh ~/.cache/huggingface/* 2>/dev/null
The second command shows the other items in the Hugging Face folder separately, such as hub, a token file and the xet chunk cache described in the documentation.
You can also list the cache with the hf tool (the CLI guide lists the install options, including pip and Homebrew):
hf cache ls
Delete a repository
The documented way is hf cache rm, which accepts a repository identifier. Run it with --dry-run first to preview the result, then without it; the tool asks for confirmation unless you pass --yes:
hf cache rm model/<org>/<name> --dry-run
hf cache rm model/<org>/<name>
Older versions of the tool used different command names, so check hf cache --help and the documentation for your version. To remove a folder by hand instead, delete the repository folder, which is what AiKiller does for model repositories:
rm -rf "$HOME/.cache/huggingface/hub/models--<org>--<name>"
Substitute the real names: replace <org> and <name> with the folder name you saw in the size listing, and keep the double quotes.
The documentation says recent versions can share some files between repositories and that hf cache prune removes shared files no cached repository uses anymore. If you deleted folders by hand, you can run it afterwards:
hf cache prune
What to keep in mind
- Deleting the whole
~/.cache/huggingfacefolder also removes a saved login token, which the documentation places at~/.cache/huggingface/tokenby default. Deletehubor individual repository folders instead. - Other tools share this cache. The Hub documentation lists libraries such as
transformersandvllmas users of this layout. If you delete a model, they download it again the next time it is needed, if it is still available online. - Models you created or fine-tuned only on your Mac may not exist anywhere else. Back them up first.
What this guide does not cover
We did not test LM Studio itself (its folder locations come from its documentation and AiKiller's detection rules), and we did not test the hf command, whose behavior is taken from the Hugging Face documentation. Other tools that store models (for example Jan, GPT4All or MLX-based apps) are not covered; check their documentation. Locations and command names vary by version.
Do this in one scan with AiKiller (free)
AiKiller's Local Models screen lists Hugging Face repositories (the models-- folders in ~/.cache/huggingface/hub) and .gguf files in the two LM Studio folders above, each with its path and size. It checks these default locations only, so a cache moved with HF_HOME or a changed LM Studio directory is not scanned, and datasets and spaces are not listed. Scan Mode is read-only: it lists each item with its path and size. Nothing is deleted until you switch to Clean Mode, select the items you want and type a confirmation code. Deletion is permanent and does not use the Trash, so back up anything you need first. AiKiller is free. Safety Shield (Applications screen only, on by default): when you remove an application, it keeps the credential files AiKiller recognizes, but recognition is limited to AiKiller's built-in detection rules, so other secrets may not be recognized. It does not apply to local model removal, which deletes everything you select.