How to delete Ollama models and free disk space

Every ollama pull drops multi-GB model files on disk. The clean way to get space back is ollama rm: it removes the model and any layers no other model still uses. Deleting the folder by hand works too, but you lose every model at once.

These commands permanently delete files. Most are caches the tool rebuilds on its own (the next build or install is slower and may need internet). Anything that can hold data you cannot re-download is flagged on the page. Read each command, then copy and run it yourself. devdisk never runs cleanup commands for you.

Where Ollama stores models

If the OLLAMA_MODELS environment variable is set, that folder wins.

See what is taking space

Any OS
ollama list          # SIZE column per model
macOS / Linux (your user)
du -sh ~/.ollama/models
Linux (system service)
sudo du -sh /usr/share/ollama/.ollama/models
Windows (PowerShell)
"{0:N1} GB" -f ((Get-ChildItem "$env:USERPROFILE\.ollama\models" -Recurse -File | Measure-Object Length -Sum).Sum / 1GB)

Remove models you no longer use

Any OS
ollama ps                 # models loaded right now
ollama stop llama3.1:70b  # unload first if it is running
ollama rm llama3.1:70b

Replace llama3.1:70b with a name from ollama list. Nothing is re-downloaded until you run or pull that model again.

Move models instead of deleting

Point OLLAMA_MODELS at an external or larger drive, move the existing models folder there, then restart Ollama. On the macOS app use launchctl setenv OLLAMA_MODELS /Volumes/External/ollama-models; on Linux add Environment="OLLAMA_MODELS=..." with sudo systemctl edit ollama.service. If you skip the move, Ollama sees an empty folder and downloads again.

Measure with devdisk

devdisk is a free, read-only scanner. It lists ~/.ollama/models under Review first (AI models), next to your other dev caches. It never deletes anything; it only shows sizes and writes a cleanup script you read and run yourself. The Linux system-service path above is outside your home folder, so check it with du.

macOS / Linux
curl -fsSLO https://disk.sadana.app/devdisk.py && python3 devdisk.py
Windows (PowerShell)
iwr https://disk.sadana.app/devdisk.py -OutFile devdisk.py; py devdisk.py

Run free scannerSample report

Want one-click cleanup?

A planned devdisk desktop app for Mac and Windows: live treemap, cleanup that moves files to the Trash, scheduled scans. One email when it launches, with an early-supporter price. Your address is used only for that, and every email has an unsubscribe link.

FAQ

Is it safe to delete the ~/.ollama/models folder?

It will not break Ollama, but every model is gone and must be pulled again. ollama rm lets you keep the ones you use.

Why did ollama rm free less than the listed size?

Models that share a base layer share the same files on disk. Those files are only removed when no remaining model uses them.

Does devdisk remove models for me?

No. It is read-only. The generated script suggests ollama rm lines, commented out, for you to review.

More cleanup guides