Repository navigation
Conversation
This branch has not been deployed
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.
Cancel an Ollama model download and uninstall models
Backend for #753.
Why
ollama rminside the container.What changed
DELETE /api/v1/system/llm/modelstakes a JSON body{"model": "...", "provider": "ollama"}(provideris optional and defaults toollama). The name goes in the body because it can contain/or:. It checks the name, the provider, theOLLAMA_MODELSrestrictions and that the model is installed. It refuses the global default model, Ollama's default model and a model with an active pull. On success it refreshes the Ollama catalog cache and returns{"model": "...", "deleted": true}.OLLAMA_MODELS; 404LLM_MODEL_NOT_INSTALLED; 409LLM_MODEL_IN_USE; 503LLM_UNAVAILABLEif Ollama cannot be reached or fails; 502LLM_BAD_RESPONSEfor an unexpected answer.OllamaLLM.delete_model()calls Ollama'sDELETE /api/delete. Everything stays Ollama specific, so other providers andregistry.resolve()are unchanged.docs/multi-llm-support/updated.Notes
GUNICORN_WORKERS) the check for a download in progress is best effort.POST /system/llm/pull. After cancelling, Ollama kept the partial download and a new pull resumed from where it stopped.Testing
python -m pytest: 431 passed (413 before). Ruff passes on the modified files.Closes #753