[GH-ISSUE #14013] ollama rm should list total removed size #71219

Open
opened 2026-05-05 00:42:55 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @osalbahr on GitHub (Feb 1, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14013

Hi!

I just ran:

% ollama list
NAME                  ID              SIZE      MODIFIED      
deepseek-r1:8b        6995872bfe4c    5.2 GB    5 months ago     
gpt-oss:20b           aa4295ac10c3    13 GB     5 months ago     
deepseek-r1:latest    0a8c26691023    4.7 GB    12 months ago    
% ollama rm deepseek-r1:8b gpt-oss:20b deepseek-r1:latest
deleted 'deepseek-r1:8b'
deleted 'gpt-oss:20b'
deleted 'deepseek-r1:latest'

and I was expecting to know the total removed size, kinda like with podman/docker.

Would this feature be welcome? And if so does it need to be under a flag like --size?

Current ollama rm flags for reference:

% ollama rm --help          
Remove a model

Usage:
  ollama rm MODEL [MODEL...] [flags]

Flags:
  -h, --help   help for rm

Environment Variables:
      OLLAMA_HOST                IP Address for the ollama server (default 127.0.0.1:11434)
Originally created by @osalbahr on GitHub (Feb 1, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14013 Hi! I just ran: ```console % ollama list NAME ID SIZE MODIFIED deepseek-r1:8b 6995872bfe4c 5.2 GB 5 months ago gpt-oss:20b aa4295ac10c3 13 GB 5 months ago deepseek-r1:latest 0a8c26691023 4.7 GB 12 months ago % ollama rm deepseek-r1:8b gpt-oss:20b deepseek-r1:latest deleted 'deepseek-r1:8b' deleted 'gpt-oss:20b' deleted 'deepseek-r1:latest' ``` and I was expecting to know the total removed size, kinda like with `podman`/`docker`. Would this feature be welcome? And if so does it need to be under a flag like `--size`? Current `ollama rm` flags for reference: ```console % ollama rm --help Remove a model Usage: ollama rm MODEL [MODEL...] [flags] Flags: -h, --help help for rm Environment Variables: OLLAMA_HOST IP Address for the ollama server (default 127.0.0.1:11434) ```
GiteaMirror added the feature request label 2026-05-05 00:42:55 -05:00
Author
Owner

@dhirajlochib commented on GitHub (Apr 2, 2026):

Implemented in PR #15215.

The fix is in DeleteHandler in cmd/cmd.go:

  1. Call client.List() before deletion to record each model's size via /api/tags
  2. Accumulate freed bytes across all deleted models (names normalized via model.ParseName(arg).DisplayShortest() to match the list format)
  3. Print freed <size> at the end when the total is non-zero

The freed line is suppressed if the list call fails, so existing behaviour for offline scenarios is unchanged.

<!-- gh-comment-id:4178490965 --> @dhirajlochib commented on GitHub (Apr 2, 2026): Implemented in PR #15215. The fix is in `DeleteHandler` in `cmd/cmd.go`: 1. Call `client.List()` before deletion to record each model's size via `/api/tags` 2. Accumulate freed bytes across all deleted models (names normalized via `model.ParseName(arg).DisplayShortest()` to match the list format) 3. Print `freed <size>` at the end when the total is non-zero The freed line is suppressed if the list call fails, so existing behaviour for offline scenarios is unchanged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71219