[PR #15492] cmd/tui: add interactive model browser for pull command #77469

Open
opened 2026-05-05 10:08:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15492
Author: @jtslear
Created: 4/11/2026
Status: 🔄 Open

Base: mainHead: jts/pull-menu


📝 Commits (2)

  • c2dcbc8 cmd/tui: add interactive model browser for pull command
  • c488f62 cmd/tui: add tests for pull menu and ListRemote

📊 Changes

6 files changed (+727 additions, -3 deletions)

View changed files

📝 api/client.go (+30 -0)
📝 api/client_test.go (+71 -0)
📝 api/types.go (+15 -0)
📝 cmd/cmd.go (+20 -3)
cmd/tui/pull_menu.go (+269 -0)
cmd/tui/pull_menu_test.go (+322 -0)

📄 Description

Closes #286

What this does

Running ollama pull with no arguments now launches an interactive TUI
model browser. Use ↑/↓ to navigate, → to drill into available tags for
a model, ← to go back, and Enter to pull. The existing ollama pull <model> flow is completely unchanged — the menu only activates when no
arguments are provided.

This was inspired by the experience described in
https://github.com/ollama/ollama/issues/286#issuecomment-1785960671,
where a user wished they could interactively explore what's available
rather than having to already know what to type.

The honest caveat

There's a limitation worth calling out upfront: Ollama's public
/v1/models API (OpenAI-compatible) is the cloud models endpoint
it surfaces models available via Ollama's cloud service, not a general
registry catalog. Some of these are also locally pullable, but many are
cloud-only. Either way it is not a comprehensive list of what's
available to download locally.

This means the browser won't show you everything — and some of what it
does show may not be locally pullable at all. It's a significant
limitation and does reduce the usefulness of this feature. That said,
the plumbing is here: if Ollama ever exposes a proper registry endpoint
that returns locally-pullable models and their full tag lists, this menu
could be updated quickly to take advantage of it. For now the full tag
list for any model is always accessible at ollama.com/library/<model>/tags.

Details

  • 5-second timeout on the remote fetch; error state instructs the user
    to fall back to ollama pull <model> directly
  • Tag grouping is done client-side from the single API response — no
    additional network calls during navigation
  • Pull progress display is untouched; after selection the existing
    progress bars render identically to ollama pull <model>
  • Non-interactive environments (piped stdin/stdout) skip the menu and
    return an error asking for an explicit model name

Files changed

  • api/types.goRemoteModel and RemoteListResponse types
  • api/client.goListRemote() with 5s timeout
  • cmd/cmd.go — relaxes cobra.ExactArgs(1) to cobra.MaximumNArgs(1);
    adds zero-arg path in PullHandler
  • cmd/tui/pull_menu.go — new file; Bubble Tea pull menu

🔄 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/15492 **Author:** [@jtslear](https://github.com/jtslear) **Created:** 4/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `jts/pull-menu` --- ### 📝 Commits (2) - [`c2dcbc8`](https://github.com/ollama/ollama/commit/c2dcbc80dfdcc36608d60f0484b3bae2a989c73c) cmd/tui: add interactive model browser for pull command - [`c488f62`](https://github.com/ollama/ollama/commit/c488f62a329bfcc4d16b93dd6425675da3c4bd15) cmd/tui: add tests for pull menu and ListRemote ### 📊 Changes **6 files changed** (+727 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+30 -0) 📝 `api/client_test.go` (+71 -0) 📝 `api/types.go` (+15 -0) 📝 `cmd/cmd.go` (+20 -3) ➕ `cmd/tui/pull_menu.go` (+269 -0) ➕ `cmd/tui/pull_menu_test.go` (+322 -0) </details> ### 📄 Description Closes #286 ## What this does Running `ollama pull` with no arguments now launches an interactive TUI model browser. Use ↑/↓ to navigate, → to drill into available tags for a model, ← to go back, and Enter to pull. The existing `ollama pull <model>` flow is completely unchanged — the menu only activates when no arguments are provided. This was inspired by the experience described in https://github.com/ollama/ollama/issues/286#issuecomment-1785960671, where a user wished they could interactively explore what's available rather than having to already know what to type. ## The honest caveat There's a limitation worth calling out upfront: Ollama's public `/v1/models` API (OpenAI-compatible) is the **cloud models endpoint** — it surfaces models available via Ollama's cloud service, not a general registry catalog. Some of these are also locally pullable, but many are cloud-only. Either way it is not a comprehensive list of what's available to download locally. This means the browser won't show you everything — and some of what it does show may not be locally pullable at all. It's a significant limitation and does reduce the usefulness of this feature. That said, the plumbing is here: if Ollama ever exposes a proper registry endpoint that returns locally-pullable models and their full tag lists, this menu could be updated quickly to take advantage of it. For now the full tag list for any model is always accessible at `ollama.com/library/<model>/tags`. ## Details - 5-second timeout on the remote fetch; error state instructs the user to fall back to `ollama pull <model>` directly - Tag grouping is done client-side from the single API response — no additional network calls during navigation - Pull progress display is untouched; after selection the existing progress bars render identically to `ollama pull <model>` - Non-interactive environments (piped stdin/stdout) skip the menu and return an error asking for an explicit model name ## Files changed - `api/types.go` — `RemoteModel` and `RemoteListResponse` types - `api/client.go` — `ListRemote()` with 5s timeout - `cmd/cmd.go` — relaxes `cobra.ExactArgs(1)` to `cobra.MaximumNArgs(1)`; adds zero-arg path in `PullHandler` - `cmd/tui/pull_menu.go` — new file; Bubble Tea pull menu --- <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-05-05 10:08:04 -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#77469