[GH-ISSUE #12866] ollama ls: there is no way to sort the models #34286

Open
opened 2026-04-22 17:43:48 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @FlorinAndrei on GitHub (Oct 30, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12866

If you run ollama ls the models are shown in some order that's not entirely obvious.

I think it would be best if the models were shown sorted in alphabetical order by name. Other sorting criteria would make sense, too. But let the user have some control over it, and apply a better criterion to the default action.

If the app always behaved like ollama ls | sort on Linux, that would be fine by me. (except sort on many Linux distros ignores case by default, and mangles the header of that table)

Originally created by @FlorinAndrei on GitHub (Oct 30, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12866 If you run `ollama ls` the models are shown in some order that's not entirely obvious. I think it would be best if the models were shown sorted in alphabetical order by name. Other sorting criteria would make sense, too. But let the user have some control over it, and apply a better criterion to the default action. If the app always behaved like `ollama ls | sort` on Linux, that would be fine by me. (except `sort` on many Linux distros ignores case by default, and mangles the header of that table)
GiteaMirror added the feature request label 2026-04-22 17:43:48 -05:00
Author
Owner

@magnusbonnevier commented on GitHub (Oct 30, 2025):

You can actually write for example "ollama ls qwen" and only the models starting with "qwen" is showing in the list.

<!-- gh-comment-id:3469827104 --> @magnusbonnevier commented on GitHub (Oct 30, 2025): You can actually write for example "ollama ls qwen" and only the models starting with "qwen" is showing in the list.
Author
Owner

@mzapukhlyak commented on GitHub (Dec 5, 2025):

The Ollama list should be sorted according to certain criteria. The most obvious and default could be the model name, but other options, f.e. to sort by size, should also be included.

<!-- gh-comment-id:3616794592 --> @mzapukhlyak commented on GitHub (Dec 5, 2025): The Ollama list should be sorted according to certain criteria. The most obvious and default could be the model name, but other options, f.e. to sort by size, should also be included.
Author
Owner

@bulrush15 commented on GitHub (Dec 7, 2025):

I would also like the models sorted by name by default.

For now a person on Windows 11 can do: ollama list|sort

<!-- gh-comment-id:3622455252 --> @bulrush15 commented on GitHub (Dec 7, 2025): I would also like the models sorted by name by default. For now a person on Windows 11 can do: `ollama list|sort`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#34286