CleanMate

All guides · macOS and Ubuntu · Updated

AI models filling your disk: Ollama, LM Studio, Hugging Face, Whisper and PyTorch on Mac and Ubuntu

Where local AI tools keep their models on a Mac and on Ubuntu, how to list them with their sizes and remove the ones you no longer use: ollama list and ollama rm, LM Studio, the Hugging Face cache, Whisper, PyTorch Hub, sentence-transformers and Keras.

Download for macOS · Install on Ubuntu — free and open source

CleanMate for Ubuntu listing downloaded AI models one by one with their sizes

Running models on your own computer is easy now, and each try leaves a file of 2 to 40 GB behind. A few weeks of testing Llama, Qwen and Mistral in Ollama, a couple of GGUF files in LM Studio, and a Python notebook that pulled Whisper and a Hugging Face model, and 100 GB are gone. None of these tools deletes a model on its own.

Each tool keeps its models in its own folder, and the paths are the same on a Mac and on Ubuntu unless noted. Start by measuring them all at once:

du -sh ~/.ollama/models ~/.lmstudio/models ~/.cache/lm-studio/models \
  ~/.cache/huggingface ~/.cache/whisper ~/.cache/torch ~/.keras 2>/dev/null | sort -h

Then go through the sections below. A model you delete can be downloaded again; the cost is the download time and, for a model you built yourself, rebuilding it.

Ollama

Ollama stores models in ~/.ollama/models, or in the folder the OLLAMA_MODELS variable points to. On Ubuntu, when Ollama was installed with its install script and runs as a system service, the models are in /usr/share/ollama/.ollama/models instead.

Always delete through Ollama itself:

ollama list
ollama rm llama3.2:latest

Don’t delete files in blobs/ by hand: models share layers, and a blob that looks unused may belong to another model. ollama rm removes the model’s manifest and only the layers no other model needs.

An interrupted ollama pull leaves a partial file behind, which can be several GB:

ls -lh ~/.ollama/models/blobs/*-partial* 2>/dev/null

Pulling the same model again resumes it. If you no longer want that model, quit Ollama and delete those -partial files.

LM Studio

LM Studio keeps downloaded models in ~/.lmstudio/models (older versions: ~/.cache/lm-studio/models), one folder per publisher and model. If you moved the folder in My Models, they are where you chose.

du -sh ~/.lmstudio/models/*/* 2>/dev/null | sort -h

Delete a model from My Models in the app, or quit LM Studio and delete the publisher/model folder. Download it again from the Discover tab.

Hugging Face

The transformers, diffusers and datasets libraries, and many apps built on them, download into the Hugging Face cache: ~/.cache/huggingface/hub (or HF_HOME / HF_HUB_CACHE). Each repo is a folder such as models--meta-llama--Llama-3.2-1B or datasets--squad.

The Hugging Face CLI lists the cache and removes what you pick:

huggingface-cli scan-cache
huggingface-cli delete-cache

delete-cache opens a list where you tick the repos or revisions to remove (newer versions of the CLI name these commands hf cache scan and hf cache delete). Without the CLI, deleting a whole models--… folder is safe too; leave ~/.cache/huggingface/token alone, it is your login.

Whisper, PyTorch Hub, sentence-transformers and Keras

Python libraries download models into their own caches:

ls -lh ~/.cache/whisper                        # openai-whisper: large-v3.pt is about 3 GB
ls -lh ~/.cache/torch/hub/checkpoints          # torch.hub and torchvision weights
du -sh ~/.cache/torch/sentence_transformers/*  # older sentence-transformers versions
du -sh ~/.keras/models ~/.keras/datasets       # Keras applications and datasets

TORCH_HOME, XDG_CACHE_HOME, SENTENCE_TRANSFORMERS_HOME and KERAS_HOME move these folders. Each file or model folder can be deleted on its own while no Python program is using it; the library downloads it again on the next run. Leave ~/.keras/keras.json, it is your Keras configuration.

AI coding assistants

Claude Code, Codex, Cursor and similar tools don’t keep models on your disk, but they do keep every past session, plus caches and logs, which grow over months. Those are smaller than models, but worth a look in ~/.claude, ~/.codex and ~/.cursor. Delete old sessions only for projects you are done with: they are your history with the assistant.

How CleanMate does it

CleanMate puts models in their own group, on both systems, and never ticks a model for you: you choose each one. The AI models page sums up how it works on both systems.

See all features for macOS and Ubuntu, and how CleanMate compares with other cleaners, which mostly don’t list models one by one. For the rest of the developer junk, read the guides for Mac and Ubuntu, Docker and Xcode.

Skip the commands

CleanMate runs on both systems: pick yours.

Open source — star it on GitHub: CleanMate for macOS · CleanMate for Ubuntu

How CleanMate decides what is safe to remove →