Skip to content

feat: cancel Ollama downloads and uninstall models from Settings - #59

Open
jansans04 wants to merge 1 commit into
mainfrom
57-cancel-download-uninstall-models
Open

jansans04 wants to merge 1 commit into
mainfrom
57-cancel-download-uninstall-models

Conversation

@jansans04

Copy link
Copy Markdown
Member

Cancel Ollama downloads and uninstall models from Settings

Frontend for #57. Needs the backend from fireform-core/FireForm#754.

Why

  • A download cannot be stopped once it starts, and an installed model cannot be removed from the app.
  • The backend now cancels a pull when the request is closed and has an endpoint to uninstall Ollama models.

What changed

  • Cancel: the download's AbortController lives in the global state and its signal goes to fetch. A Cancel button in the floating panel and next to the model being downloaded in the providers window is the only thing that aborts it; changing page does not. A cancelled download shows a neutral message, not an error. The model is not marked as installed or selected, and the catalog is reloaded.
  • Delete: only installed Ollama models that are not manual show a delete action. It is disabled, with an accessible reason, for the default models and for a model being downloaded. The user confirms in a dialog before DELETE /api/v1/system/llm/models is sent with provider: "ollama". On success the catalog is reloaded and the pinned models are updated. If the deleted model was the selected one, the selector moves to a valid selection and the user is told.
  • Errors for a model in use, a model that is not installed, an invalid configuration and Ollama being unreachable have their own messages.
  • The shared confirmation dialog now puts the initial focus on Cancel, keeps the focus inside the modal, closes with Esc and returns the focus when it closes. The other confirmations that use it get the same behaviour.
  • Files: lib/api.ts, store/index.ts, App.tsx, ProviderConfigModal.tsx and ConfirmDialog.tsx.

Notes

  • Needs the backend PR above. Against an older backend the delete endpoint does not exist.
  • Cancelling closes the request and the backend stops the pull. Ollama keeps the partial download, so downloading the model again resumes from where it stopped.

Testing

  • npm run typecheck and npm run build pass. npm run lint: 0 errors, 33 warnings (same count as before).
  • No automated UI/E2E test suite is configured in the project.
  • Checked by hand against the backend with Ollama running: cancelling a download from the UI left the model as not installed, and downloading it again resumed from where it stopped.

Closes #57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Cancel a model download and uninstall Ollama models from Settings

1 participant