[GH-ISSUE #5286] [feature request] Easy clean-up of large ollama files #65349

Closed
opened 2026-05-03 20:45:14 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @hamirmahal on GitHub (Jun 25, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5286

Problem

It isn't immediately clear how to delete large models from ollama.

image

/usr/share/ollama/.ollama/models/blobs $  du -sh *
4.0K	sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988
4.0K	sha256:42ba7f8a01ddb4fa59908edd37d981d3baa8d8efea0e222b027f29f7bcae21f9
12K	sha256:43070e2d4e532684de521b885f385d0841030efa2b1a20bafb76133a5e1379c1
8.0K	sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d
3.6G	sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246
8.0K	sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b
4.0K	sha256:e6836092461ffbb2b06d001fce20697f62bfd759c284ee82b581ef53c55de36e
3.9G	sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730
4.0K	sha256:ed11eda7790d05b49395598a42b155812b17e263214292f7b87d15e14003d337
4.0K	sha256:f9b1e3196ecfce03ac97468fa0b6d85941fea050c6666c57f5856a8baec6507d
4.0K	sha256:fa304d6750612c207b8705aca35391761f29492534e90b30575e4980d6ca82f6

/usr/share/ollama/.ollama/models/blobs $  ollama rm sha256\:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730 
Error: model 'sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730' not found

Proposed Solution

Give users a way to properly delete large files from ollama using the ollama CLI.

Originally created by @hamirmahal on GitHub (Jun 25, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5286 # Problem It isn't immediately clear how to delete large models from `ollama`. ![image](https://github.com/ollama/ollama/assets/43425812/18bdc092-2fd0-4c0f-ac12-0abb62fc2dc2) ``` /usr/share/ollama/.ollama/models/blobs $ du -sh * 4.0K sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988 4.0K sha256:42ba7f8a01ddb4fa59908edd37d981d3baa8d8efea0e222b027f29f7bcae21f9 12K sha256:43070e2d4e532684de521b885f385d0841030efa2b1a20bafb76133a5e1379c1 8.0K sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d 3.6G sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 8.0K sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b 4.0K sha256:e6836092461ffbb2b06d001fce20697f62bfd759c284ee82b581ef53c55de36e 3.9G sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730 4.0K sha256:ed11eda7790d05b49395598a42b155812b17e263214292f7b87d15e14003d337 4.0K sha256:f9b1e3196ecfce03ac97468fa0b6d85941fea050c6666c57f5856a8baec6507d 4.0K sha256:fa304d6750612c207b8705aca35391761f29492534e90b30575e4980d6ca82f6 /usr/share/ollama/.ollama/models/blobs $ ollama rm sha256\:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730 Error: model 'sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730' not found ``` # Proposed Solution Give users a way to properly delete large files from `ollama` using the `ollama` CLI.
GiteaMirror added the feature request label 2026-05-03 20:45:14 -05:00
Author
Owner

@hamirmahal commented on GitHub (Jun 25, 2024):

I tried deleting the files directly.

My concern is that doing so will break ollama.

hamir@hamir-desktop:/usr/share/ollama/.ollama/models $  du -sh .
7.4G    .

hamir@hamir-desktop:/usr/share/ollama/.ollama/models $  rm -rf blobs/
rm: cannot remove 'blobs/sha256:ed11eda7790d05b49395598a42b155812b17e263214292f7b87d15e14003d337': Permission denied
rm: cannot remove 'blobs/sha256:f9b1e3196ecfce03ac97468fa0b6d85941fea050c6666c57f5856a8baec6507d': Permission denied
rm: cannot remove 'blobs/sha256:43070e2d4e532684de521b885f385d0841030efa2b1a20bafb76133a5e1379c1': Permission denied
rm: cannot remove 'blobs/sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988': Permission denied
rm: cannot remove 'blobs/sha256:e6836092461ffbb2b06d001fce20697f62bfd759c284ee82b581ef53c55de36e': Permission denied
rm: cannot remove 'blobs/sha256:42ba7f8a01ddb4fa59908edd37d981d3baa8d8efea0e222b027f29f7bcae21f9': Permission denied
rm: cannot remove 'blobs/sha256:fa304d6750612c207b8705aca35391761f29492534e90b30575e4980d6ca82f6': Permission denied
rm: cannot remove 'blobs/sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730': Permission denied
rm: cannot remove 'blobs/sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d': Permission denied
rm: cannot remove 'blobs/sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246': Permission denied
rm: cannot remove 'blobs/sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b': Permission denied
<!-- gh-comment-id:2190186395 --> @hamirmahal commented on GitHub (Jun 25, 2024): I tried deleting the files directly. My concern is that doing so will break `ollama`. ``` hamir@hamir-desktop:/usr/share/ollama/.ollama/models $ du -sh . 7.4G . hamir@hamir-desktop:/usr/share/ollama/.ollama/models $ rm -rf blobs/ rm: cannot remove 'blobs/sha256:ed11eda7790d05b49395598a42b155812b17e263214292f7b87d15e14003d337': Permission denied rm: cannot remove 'blobs/sha256:f9b1e3196ecfce03ac97468fa0b6d85941fea050c6666c57f5856a8baec6507d': Permission denied rm: cannot remove 'blobs/sha256:43070e2d4e532684de521b885f385d0841030efa2b1a20bafb76133a5e1379c1': Permission denied rm: cannot remove 'blobs/sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988': Permission denied rm: cannot remove 'blobs/sha256:e6836092461ffbb2b06d001fce20697f62bfd759c284ee82b581ef53c55de36e': Permission denied rm: cannot remove 'blobs/sha256:42ba7f8a01ddb4fa59908edd37d981d3baa8d8efea0e222b027f29f7bcae21f9': Permission denied rm: cannot remove 'blobs/sha256:fa304d6750612c207b8705aca35391761f29492534e90b30575e4980d6ca82f6': Permission denied rm: cannot remove 'blobs/sha256:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730': Permission denied rm: cannot remove 'blobs/sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d': Permission denied rm: cannot remove 'blobs/sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246': Permission denied rm: cannot remove 'blobs/sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b': Permission denied ```
Author
Owner

@MaxJa4 commented on GitHub (Jun 26, 2024):

What's wrong with just using ollama rm <model>?

<!-- gh-comment-id:2191025301 --> @MaxJa4 commented on GitHub (Jun 26, 2024): What's wrong with just using `ollama rm <model>`?
Author
Owner

@hamirmahal commented on GitHub (Jun 26, 2024):

I honestly didn't think of that. I saw the large files, first, so I tried deleting the files directly through

ollama rm sha256\:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730
<!-- gh-comment-id:2191131050 --> @hamirmahal commented on GitHub (Jun 26, 2024): I honestly didn't think of that. I saw the large files, first, so I tried deleting the files directly through ``` ollama rm sha256\:e8a35b5937a5e6d5c35d1f2a15f161e07eefe5e5bb0a3cdd42998ee79b057730 ```
Author
Owner

@MaxJa4 commented on GitHub (Jun 26, 2024):

Oh ok. Since models consist of multiple blobs, you need to use the model's name instead of a file name, yes.

<!-- gh-comment-id:2191147433 --> @MaxJa4 commented on GitHub (Jun 26, 2024): Oh ok. Since models consist of multiple blobs, you need to use the model's name instead of a file name, yes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65349