From c864e3ae7ce63bd1135e41688f9da814be1e8003 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Mon, 21 Sep 2026 10:23:21 -0400 Subject: [PATCH] fix: stop asking for chat variables a model's system prompt no longer declares (#30173) --- backend/open_webui/routers/models.py | 2 ++ backend/open_webui/utils/models.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index f9437b5b87..f8b89ea5e8 100644 --- a/backend/open_webui/routers/models.py +++ b/backend/open_webui/routers/models.py @@ -62,6 +62,8 @@ def add_chat_variables_schema(model_dict: dict) -> dict: schema = get_chat_variables_schema(system) if schema: model_dict.setdefault('meta', {})['chat_variables_schema'] = schema + elif isinstance(model_dict.get('meta'), dict): + model_dict['meta'].pop('chat_variables_schema', None) return model_dict diff --git a/backend/open_webui/utils/models.py b/backend/open_webui/utils/models.py index 3926bfa9be..0bd933115b 100644 --- a/backend/open_webui/utils/models.py +++ b/backend/open_webui/utils/models.py @@ -187,6 +187,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) schema = get_chat_variables_schema(custom_model.params.model_dump().get('system')) if schema: model['info'].setdefault('meta', {})['chat_variables_schema'] = schema + elif isinstance(model['info'].get('meta'), dict): + model['info']['meta'].pop('chat_variables_schema', None) action_ids = [] filter_ids = [] @@ -239,6 +241,8 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) schema = get_chat_variables_schema(custom_model.params.model_dump().get('system')) if schema: info.setdefault('meta', {})['chat_variables_schema'] = schema + elif isinstance(info.get('meta'), dict): + info['meta'].pop('chat_variables_schema', None) if 'params' in info: # Remove params to avoid exposing sensitive info del info['params']