Skip to content

Ollama Models Location on Mac (and Hugging Face Cache)

Ollama models location on Mac is ~/.ollama/models. Where Hugging Face and LM Studio keep models, how to delete them safely, and how to move them elsewhere.

Updated · 7 min read

On a Mac, Ollama stores models in ~/.ollama/models, and Hugging Face libraries cache them in ~/.cache/huggingface/hub. LM Studio uses ~/.lmstudio/models. All three folders are hidden, which is why a few local LLMs can quietly take tens of gigabytes. Delete Ollama models with ollama rm, and Hugging Face downloads with hf cache rm.

TL;DR

  • Ollama: ~/.ollama/models. List with ollama ls, delete with ollama rm <model>, move with the OLLAMA_MODELS variable.
  • Hugging Face: ~/.cache/huggingface/hub. List with hf cache ls, delete with hf cache rm, move with HF_HOME or HF_HUB_CACHE.
  • LM Studio: ~/.lmstudio/models (older versions used ~/.cache/lm-studio/models). Delete and relocate in the My Models tab.
  • Check sizes first: du -sh ~/.ollama/models ~/.cache/huggingface ~/.lmstudio/models 2>/dev/null.

Where are Ollama models stored on a Mac?

According to Ollama’s FAQ, the default on macOS is:

~/.ollama/models

Inside it are two folders:

  • manifests/: one small file per model and tag, for example manifests/registry.ollama.ai/library/llama3.2/latest. This is how Ollama knows what you’ve installed.
  • blobs/: the actual weights and config, named by hash (sha256-…). Tags that share weights point to the same blobs, so two names don’t always mean two copies.

The rest of ~/.ollama holds logs (~/.ollama/logs) and your Ollama keys. Don’t delete the whole ~/.ollama folder unless you’re uninstalling Ollama.

Check how much space the models use:

du -sh ~/.ollama/models

If you’ve set OLLAMA_MODELS, look there instead:

launchctl getenv OLLAMA_MODELS
echo "$OLLAMA_MODELS"

How to delete Ollama models on a Mac

List what’s installed. The output shows each model’s name, ID, size and when it was last modified:

ollama ls

Remove a model by name:

ollama rm llama3.2

ollama rm deletes the manifest and any blobs that no other installed model still uses. That’s why it’s safer than deleting files in blobs/ yourself: you can’t tell from a hash which model a blob belongs to, and removing a shared blob breaks the other model. If a model is loaded in memory, ollama ps shows it and ollama stop <model> unloads it.

To get a model back, run ollama pull llama3.2.

If you’ve removed everything and want Ollama itself gone, Ollama’s macOS docs list the app’s other locations: /Applications/Ollama.app, /usr/local/bin/ollama, ~/Library/Application Support/Ollama, ~/Library/Caches/ollama and ~/.ollama, among a few others.

How to move Ollama models to an external drive

Ollama reads the OLLAMA_MODELS environment variable for its model folder. The Ollama Mac app doesn’t read your ~/.zshrc, so set the variable with launchctl, as the FAQ describes:

# 1. Quit Ollama from the menu bar, then copy your existing models
mkdir -p /Volumes/External/ollama-models
rsync -a ~/.ollama/models/ /Volumes/External/ollama-models/

# 2. Point Ollama at the new folder, then start Ollama again
launchctl setenv OLLAMA_MODELS /Volumes/External/ollama-models

Run ollama ls to confirm your models show up, then delete the old copy in ~/.ollama/models to get the space back.

Two catches. Setting the variable doesn’t move existing models, so without the copy step Ollama simply starts with an empty list. And a value set with launchctl setenv doesn’t survive a restart of your Mac, so you’ll need to run it again after a reboot, or from a login script. If you run ollama serve yourself in Terminal, export OLLAMA_MODELS=... in your shell profile is enough.

Where is the Hugging Face cache on a Mac?

Anything that downloads through huggingface_hub (that includes transformers, diffusers, sentence-transformers and the hf CLI) uses one shared cache:

~/.cache/huggingface/hub

The surrounding folder, ~/.cache/huggingface, is HF_HOME. Besides hub/ it can contain:

  • datasets/: the processed cache of the datasets library.
  • xet/: upload bookkeeping for Hugging Face’s Xet storage (a shard cache and staging data).
  • token: your login token. Leave it alone.

Each downloaded repository gets its own folder, named like models--meta-llama--Llama-3.2-1B-Instruct or datasets--glue. Inside, blobs/ holds the real files, snapshots/<commit>/ holds symlinks to them, and refs/ records which commit main points to. When a model updates, the new files are downloaded and the old ones are kept, so a model you’ve used for a year may be cached several times.

See the totals:

du -sh ~/.cache/huggingface/hub ~/.cache/huggingface/* 2>/dev/null

How to see and delete Hugging Face models

The hf CLI comes with huggingface_hub (pip install -U huggingface_hub), or install it on its own with brew install hf. List what’s cached:

hf cache ls
hf cache ls --sort size

Filters make it easy to find dead weight, for example repos you haven’t touched in months:

hf cache ls --filter "accessed>90d"

Preview a deletion, then run it:

hf cache rm model/meta-llama/Llama-3.2-1B-Instruct --dry-run
hf cache rm model/meta-llama/Llama-3.2-1B-Instruct

You can also remove a single file, such as one GGUF quantization, with an hf:// path like hf cache rm hf://models/<org>/<repo>/<file>.gguf. And hf cache prune cleans up old revisions that no branch or tag points to anymore, plus partial .incomplete downloads:

hf cache prune --dry-run
hf cache prune

On older versions of huggingface_hub without the hf command, the equivalents are huggingface-cli scan-cache and huggingface-cli delete-cache. Updating is the better fix: recent versions share identical files between repositories in a top-level blobs/ folder, and the Hugging Face docs warn that older deletion tools can remove a shared file another repo still needs. That’s also why deleting models--… folders by hand is no longer the cleanest option. It works, and anything missing downloads again, but shared files can stay behind until you run hf cache prune.

The xet/ folder is different: Hugging Face’s docs say you can remove it entirely with rm -rf ~/.cache/huggingface/xet if you need the space. It’s rebuilt as needed.

How to change the Hugging Face cache location

Pick the variable that matches what you want to move:

Variable Default What it moves
HF_HOME ~/.cache/huggingface Everything: hub cache, Xet, assets, token
HF_HUB_CACHE $HF_HOME/hub Only downloaded models, datasets and Spaces
HF_XET_CACHE $HF_HOME/xet Only the Xet folder

To move everything to an external drive, add this to ~/.zshrc and open a new terminal:

export HF_HOME=/Volumes/External/huggingface

Then move the existing cache so you don’t download it all again:

rsync -a ~/.cache/huggingface/ /Volumes/External/huggingface/

Once hf cache ls shows your models in the new place, delete the old ~/.cache/huggingface. Three things to know:

  • huggingface_hub reads these variables when it’s imported, so restart notebook kernels and Python processes after changing them.
  • GUI apps and IDE run configurations don’t read ~/.zshrc. Set the variable in their own environment settings too.
  • The older HUGGINGFACE_HUB_CACHE still works but is deprecated in favor of HF_HUB_CACHE.

Where does LM Studio store models?

LM Studio’s documentation gives the models folder as:

~/.lmstudio/models/<publisher>/<model>/<file>.gguf

Older LM Studio installs used ~/.cache/lm-studio/models, so check both:

du -sh ~/.lmstudio/models ~/.cache/lm-studio/models 2>/dev/null

Delete models and change the models folder from the My Models tab in LM Studio. If you have the lms CLI installed, lms ls lists what’s downloaded. Each model is a self-contained folder, so deleting one by hand is safe once LM Studio is closed. You can download it again from LM Studio’s model search.

Other AI model folders worth checking

Path What it is Safe to delete? How it comes back
~/.ollama/models Ollama models Yes, via ollama rm ollama pull <name>
~/.cache/huggingface/hub Hugging Face models, datasets, Spaces Yes, via hf cache rm Downloads on next use
~/.cache/huggingface/xet Xet upload cache Yes Rebuilt as needed
~/.lmstudio/models LM Studio models Yes, from My Models Download again in LM Studio
~/.cache/torch/hub PyTorch Hub checkpoints Yes Downloads on next torch.hub.load
~/.cache/whisper OpenAI Whisper models (.pt) Yes Downloads on next use

To find large model files anywhere in your home folder:

find ~ -type f \( -name "*.gguf" -o -name "*.safetensors" \) -size +1G 2>/dev/null

Before deleting a model, check whether a project pins it. Downloading a 30 GB model again takes far longer than reading a config file.

Do it in one click with DevCleanup

DevCleanup’s AI Models screen finds models from Ollama, Hugging Face, LM Studio, PyTorch Hub, Whisper and GPT4All in one list, with each model’s size and when it was last used. Models unused for 60 days are pre-selected; everything else stays unchecked. Sizes use real-space accounting: Ollama blobs shared between tags count only toward the space you’d actually free, and Hugging Face files shared between revisions aren’t counted twice. Ollama models are removed with ollama rm when Ollama is installed, models stored outside your home folder go to the Trash instead of being deleted, and every removal is logged in History with how to get the model back (for Ollama, the exact ollama pull command). Download DevCleanup: scanning is free, and Pro ($29 one-time) unlocks the developer cleanup actions.

Frequently asked questions

Where does Ollama store models on a Mac?

In ~/.ollama/models, unless you set the OLLAMA_MODELS environment variable. Model weights live in the blobs folder and the list of installed models in the manifests folder.

How do I delete Ollama models on a Mac?

Run ollama ls to see installed models, then ollama rm <name> for each one you don't need. It removes the manifest and any blobs no other model uses, and ollama pull <name> downloads it again.

Where is the Hugging Face cache on a Mac?

Models and datasets downloaded through huggingface_hub, transformers or diffusers go to ~/.cache/huggingface/hub by default. HF_HOME moves the whole Hugging Face folder, and HF_HUB_CACHE moves only the hub cache.

How do I change the Hugging Face cache location?

Set HF_HOME (or HF_HUB_CACHE) in your shell profile, for example export HF_HOME=/Volumes/External/huggingface in ~/.zshrc, then open a new terminal. The variable is read when huggingface_hub is imported, so restart any running Python process or notebook kernel.

Is it safe to delete the Hugging Face cache?

Yes. It only holds downloaded copies, and each model downloads again the next time code asks for it. Use hf cache rm or hf cache prune rather than deleting folders by hand, because newer versions share some files between repositories.