feat(models): add /model manager#83
Merged
Merged
Conversation
Summary: - Turn `/model` into a model-management flow instead of a simple switcher. - Support three actions: switch installed models, download models, and delete installed models. - Keep navigation explicit with parent/sub-screens, `Back`, and keyboard shortcuts. Implemented Behavior: - Parent menu: - `Switch model` - `Download model` - `Delete model` - `Cancel` - Switch flow: - List installed models from Ollama. - Keep the current model first. - Selecting a model updates config/session and returns to chat. - Download flow: - Show curated local model options plus `Enter custom model…`. - Support typed custom entry with inline suggestions. - Suggestion rows render raw model ids only, for example `gemma4:latest`. - Start downloads with Ollama pull streaming. - Show status text, numeric progress, and a progress bar when total/completed data is available. - `Esc` or `Ctrl+C` cancels an active download. - Show explicit `Cancel download` while pulling. - Do not auto-switch after download completes. - Delete flow: - List installed models. - Block deleting the active model. - Require a confirmation step before deletion. Shared Components: - Reuse `Suggestions` component for keyboard navigation and selection in: - model suggestions Curated Model List: - Keep the curated list local in `src/constants/models.ts`. - Current curated entries are: - `gemma4:latest` - `granite4.1:8b` - `qwen2.5-coder:latest` - `deepseek-coder-v2:latest` - Order models by recommendation rather than alphabetically. Verification: - Manual test modal `smollm:135m`
- Remove optional includeCurrentModelNote parameter - Always append (current model) to current model label - Remove defaultValue from SelectPrompt in ModelSwitchView
- src/components/ModelManager/utils.ts
- buildDownloadOptions(installedModels) now filters curated entries when
installedModels contains the entry’s exact value or exact alias.
- src/components/ModelManager/ModelDownloadView.tsx
- now accepts installedModels and passes them into buildDownloadOptions(...).
- src/components/ModelManager/ModelManager.tsx
- now passes installedModels into ModelDownloadView.
Error: ``` Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. ``` Fixed in `src/components/ModelManager/ModelDeleteView.tsx` by removing the current model from the delete Select entirely. The delete screen now shows it as informational text and only renders actually deletable models as options. That avoids the update loop you were hitting when the active model stayed in the selectable list.
/model manager
ab331ab to
681ca95
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
c1bea24 to
badb110
Compare
ede2377 to
ebf338a
Compare
ebf338a to
871a4b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the motivation for this pull request?
Add a
/modelcommand that opens a model manager TUI, allowing users to switch, download, and delete Ollama models from within the chat interface.What is the current behavior?
There is no way to manage models from within the CLI. Users must run separate
ollamacommands outside the tool.What is the new behavior?
/modelopens a ModelManager component with three views:plan.md
What is the test strategy?
Download and delete model:
Checklist: