[PR #15215] cmd: show freed disk space after ollama rm #40954

Open
opened 2026-04-23 01:43:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15215
Author: @dhirajlochib
Created: 4/2/2026
Status: 🔄 Open

Base: mainHead: cmd/show-freed-size-on-rm


📝 Commits (1)

  • dce17c0 cmd: show freed disk space after ollama rm

📊 Changes

2 files changed (+66 additions, -0 deletions)

View changed files

📝 cmd/cmd.go (+13 -0)
📝 cmd/cmd_test.go (+53 -0)

📄 Description

Closes #14013

After deleting one or more models, print the total amount of disk space freed. The size is looked up via /api/tags before deletion and reported using the same human-readable format already used elsewhere in the CLI.

Example:

$ ollama rm llama3.2 gemma3:4b
deleted 'llama3.2'
deleted 'gemma3:4b'
freed 3.2 GB

If no size information is available (e.g. the server is unreachable before deletion), the freed line is not printed. Names are normalized so ollama rm llama3.2 correctly matches the llama3.2:latest entry in the list.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15215 **Author:** [@dhirajlochib](https://github.com/dhirajlochib) **Created:** 4/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `cmd/show-freed-size-on-rm` --- ### 📝 Commits (1) - [`dce17c0`](https://github.com/ollama/ollama/commit/dce17c093e8c5b8b45e31d25f8b1ba18853aee63) cmd: show freed disk space after ollama rm ### 📊 Changes **2 files changed** (+66 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+13 -0) 📝 `cmd/cmd_test.go` (+53 -0) </details> ### 📄 Description Closes #14013 After deleting one or more models, print the total amount of disk space freed. The size is looked up via `/api/tags` before deletion and reported using the same human-readable format already used elsewhere in the CLI. **Example:** ``` $ ollama rm llama3.2 gemma3:4b deleted 'llama3.2' deleted 'gemma3:4b' freed 3.2 GB ``` If no size information is available (e.g. the server is unreachable before deletion), the freed line is not printed. Names are normalized so `ollama rm llama3.2` correctly matches the `llama3.2:latest` entry in the list. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:43:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#40954