[GH-ISSUE #1599] Delete partially downloaded models. #884

Closed
opened 2026-04-12 10:33:07 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @luckydonald on GitHub (Dec 19, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1599

So, I accidentally started downloading a 118 GB file.
I could see that it would add files to ~/.ollama/models/blobs, however they are not picked up by the rm command.

The only way to do it is to download it completely, just to then instantly delete it ($ ollama rm …).

That's quite wasteful for you guys bandwidth and actually my slow internet connection as well.
As I am running other model downloads, the timestamps don't really help in figuring out which files to delete.

Probably the first and easiest solution to this could be writing the manifests file with the start of the download.

Originally created by @luckydonald on GitHub (Dec 19, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1599 So, I accidentally started downloading a 118 GB file. I could see that it would add files to `~/.ollama/models/blobs`, however they are not picked up by the rm command. The only way to do it is to download it completely, just to then instantly delete it (`$ ollama rm …`). That's quite wasteful for you guys bandwidth and actually my slow internet connection as well. As I am running other model downloads, the timestamps don't really help in figuring out which files to delete. Probably the first and easiest solution to this could be writing the `manifests` file with the start of the download.
Author
Owner

@easp commented on GitHub (Dec 19, 2023):

FWIW, restarting the backend server cleans up partial downloads.

<!-- gh-comment-id:1863235041 --> @easp commented on GitHub (Dec 19, 2023): FWIW, restarting the backend server cleans up partial downloads.
Author
Owner

@technovangelist commented on GitHub (Dec 19, 2023):

Exactly. We have a pruning process that will automatically remove incomplete files. That occurs the next time the server starts. If you want to force it to run, quit Ollama from the menubar icon, then run Ollama again.

<!-- gh-comment-id:1863285907 --> @technovangelist commented on GitHub (Dec 19, 2023): Exactly. We have a pruning process that will automatically remove incomplete files. That occurs the next time the server starts. If you want to force it to run, quit Ollama from the menubar icon, then run Ollama again.
Author
Owner

@jmorganca commented on GitHub (Dec 21, 2023):

Hi there @luckydonald – Ollama will automatically "prune" all partially downloaded files when you restart it, so you can do this to purge all partial downloads. Let us know if that helps!

<!-- gh-comment-id:1865413143 --> @jmorganca commented on GitHub (Dec 21, 2023): Hi there @luckydonald – Ollama will automatically "prune" all partially downloaded files when you restart it, so you can do this to purge all partial downloads. Let us know if that helps!
Author
Owner

@luckydonald commented on GitHub (Jan 15, 2024):

Thanks!

<!-- gh-comment-id:1892211617 --> @luckydonald commented on GitHub (Jan 15, 2024): Thanks!
Author
Owner

@Zeus-Eternal commented on GitHub (May 3, 2024):

This might also be helpful for anyone else with similar issues...

Just type history in the command terminal to see all your previous command entries ie. 1. ollama pull previous-model-pull-attempt,2. ollama run previous-model-run-attempt, 4. ollama pull..., this should allow you to re-trace your steps.

<!-- gh-comment-id:2093309700 --> @Zeus-Eternal commented on GitHub (May 3, 2024): This might also be helpful for anyone else with similar issues... Just type `history` in the command terminal to see all your previous command entries ie. `1. ollama pull previous-model-pull-attempt`,`2. ollama run previous-model-run-attempt`, `4. ollama pull...`, this should allow you to re-trace your steps.
Author
Owner

@gaardhus commented on GitHub (Sep 19, 2024):

I +1 an ollama prune command to call the PruneLayers function.

<!-- gh-comment-id:2360813882 --> @gaardhus commented on GitHub (Sep 19, 2024): I +1 an `ollama prune` command to call the [PruneLayers function](https://github.com/ollama/ollama/blob/8645076a71941d78a996e52cff65c794df6cdbcb/server/images.go#L796-L827).
Author
Owner

@Asimoedeus commented on GitHub (Apr 20, 2025):

I clicked "Quit ollama" and those partial files are removed!😃

<!-- gh-comment-id:2816936144 --> @Asimoedeus commented on GitHub (Apr 20, 2025): I clicked "Quit ollama" and those partial files are removed!😃
Author
Owner

@mafonya commented on GitHub (May 25, 2025):

rm -rf ~/.ollama/models/blobs/*partial*

<!-- gh-comment-id:2907572014 --> @mafonya commented on GitHub (May 25, 2025): `rm -rf ~/.ollama/models/blobs/*partial*`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#884