mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #22316] [CLOSED] fix: make prompt optional in /api/generate for Ollama model unload #65464
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22316
Author: @atian8179
Created: 3/6/2026
Status: ❌ Closed
Base:
main← Head:fix/ollama-generate-optional-prompt📝 Commits (1)
b824dbafix: make prompt optional in /api/generate for model unload support📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/ollama.py(+1 -1)📄 Description
Problem
Sending
keep_alive: 0to/ollama/api/generatethrough the Open WebUI proxy fails with:The same request works when sent directly to Ollama.
Root Cause
GenerateCompletionFormdefinesprompt: stras required, but Ollama's/api/generateAPI allows omittingpromptfor model management operations (load/unload viakeep_alive).Fix
One-line change:
prompt: str→prompt: Optional[str] = NoneFixes #22260
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.