> ## Content Index
> Fetch the complete content index at: https://airabbit.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to delete Hugging face model from cache
- URL: https://airabbit.blog/how-to-delete-hugging-face-model-from-cache/
- Published: 2024-09-16T16:49:10.000Z
- Updated: 2025-03-21T16:11:25.000Z
- Description: Tired of clutter in your Hugging Face cache? Deleting unused machine learning models can be tricky due to symlinks, but fear not! Use the `huggingface-cli` delete command to manage your cache effortlessly. Install the required package, list your models, and say goodbye to the ones you don’t need....
- Author: AiRabbit

I have a large collection of machine learning models on my device and stored in the Hugging Face cache. Many of them I no longer need or use. However, deleting them can be tricky because the files are just shortcuts (symlinks) that point to larger binary blobs. If you try to manually delete the model directory, this could lead to a mess if not done correctly.

![Cache Structure](https://storage.ghost.io/c/b6/58/b65880bb-2a06-491e-bb4d-a6abeb13a649/content/images/2024/09/image-49.png)

Luckily, Hugging Face has a delete command, and here's how you can use it.

## Option 1

### 1\. Install the Required Package

First, install the package required to manage the Hugging Face cache.

```bash
pip install -U "huggingface_hub[cli]"

```

### 2\. Start the Delete Cache Command

This won't delete anything yet. It will show you a list of models to choose from. No worries!

```bash
huggingface-cli delete-cache

```

Depending on your models, it will look something like this.

![](https://storage.ghost.io/c/b6/58/b65880bb-2a06-491e-bb4d-a6abeb13a649/content/images/2024/09/image-50.png)

Now, select the model you want to delete by pressing the space bar, and then press enter.

## Option 2

Another way to delete a model from the cache is by running `huggingface-cli scan-cache` and deleting the corresponding model folder.

And that's it—the model is deleted!