mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[GH-ISSUE #9386] Model system prompts not being templated #15481
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?
Originally created by @ProjectMoon on GitHub (Feb 5, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9386
Bug Report
Installation Method
Docekr
Environment
Open WebUI Version: 0.5.8
Ollama (if applicable): 0.5.7
Operating System: Gentoo Liunx
Browser (if applicable): Firefox 135
Confirmation:
Expected Behavior:
Templating of variables in system prompts to work.
Actual Behavior:
Templating of variables does not seem to occur when using the regular (non-native) tool calling.
Description
Bug Summary:
If a model has a variable in its system prompt like
{{USER_LOCATION}}, this should be replaced by the variable name. But it seems that in 0.5.8, the templating is not happening. I saw this by the OSM tool searching for stores near{{USER_LOCATION}}instead of an address or a GPS coordinate.Docker Container Logs:
This is a tiny bit of the container log, which includes the output from the OSM tool:
Additional Information
The model's system prompt is something like
The user's location is: {{USER_LOCATION}}.Native tool calling could not be tested. This was tested only with default function calling.
@thiswillbeyourgithub commented on GitHub (Feb 5, 2025):
This might be due to an error I'm getting since updating from 0.5.7 to 0.5.9 : I get
'UserModel' object has no attribute 'get'and the latest error log I get until that is:apply_model_system_prompt_to_body: metadata id=XXX etcThis indicates to me that both errors are probably around those functions:
ab94468ffa/backend/open_webui/utils/payload.py (L10)ab94468ffa/backend/open_webui/utils/task.py (L35)Open-WebUI is unusable in this state so I'll try rolling back to 0.5.7
@spammenotinoz commented on GitHub (Feb 5, 2025):
Ahh BUG #9402 may be related. Models with system prompts are no longer usable via API.
{
"detail": "'NoneType' object has no attribute 'items'"
}
@oatmealm commented on GitHub (Feb 5, 2025):
Can confirm. It works when I remove the models system prompt. Hope this is a regression and not by design. One of the coolest features of OWUI.
@IgorFZ commented on GitHub (Feb 5, 2025):
When attempting to use a custom model, such as Google's Gemini 1.5 Flash Latest, to perform a RAG (Retrieval Augmented Generation) with a custom prompt, the following error occurred:
This error did not occur after removing the prompt from the model.
@oatmealm commented on GitHub (Feb 5, 2025):
No running into issue with the embedding function. Downgrading since it's a mess at this stage.
@tjbck commented on GitHub (Feb 5, 2025):
Addressed with
ff84c120f5and7ba717d171, 0.5.10 will be released shortly