From c901bc39d31eb85af289743850f92848529d422b Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 20 Oct 2026 19:01:29 +0200 Subject: [PATCH] fix: embeddings API fails for connections with a Prefix ID (#32724) Calling the embeddings API with a model from a connection that has a Prefix ID sent the prefixed model name to the provider, which rejected it as an unknown model. The prefix is now removed before the request goes out, the same way chat requests already do it, so every model on such a connection works through the embeddings API again. Fixes #32715 --- backend/open_webui/routers/openai.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/openai.py b/backend/open_webui/routers/openai.py index ee96e53c99..d076e0423f 100644 --- a/backend/open_webui/routers/openai.py +++ b/backend/open_webui/routers/openai.py @@ -1695,8 +1695,6 @@ async def embeddings(request: Request, form_data: dict, user): dict: OpenAI-compatible embeddings response. """ idx = 0 - # Prepare payload/body - body = JSONCodec.dumps(form_data) # Find correct backend url/key based on model model_id = form_data.get('model') # Check if model is already in app state cache to avoid expensive get_all_models() call @@ -1709,6 +1707,10 @@ async def embeddings(request: Request, form_data: dict, user): url, key, api_config = await get_openai_connection(idx) + form_data['model'] = strip_provider_model_prefix(form_data['model'], api_config.get('prefix_id')) + # Prepare payload/body + body = JSONCodec.dumps(form_data) + r = None streaming = False