Forward user information when using openai for embedding #3453

Closed
opened 2025-11-11 15:32:02 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @df-cgdm on GitHub (Jan 27, 2025).

Feature Request

It is already possible to enable user information forwarding when doing a chat completion with ENABLE_FORWARD_USER_INFO_HEADERS.

b72150c881/backend/open_webui/routers/openai.py (L209)

                        {
                            "X-OpenWebUI-User-Name": user.name,
                            "X-OpenWebUI-User-Id": user.id,
                            "X-OpenWebUI-User-Email": user.email,
                            "X-OpenWebUI-User-Role": user.role,
                        }
                        if ENABLE_FORWARD_USER_INFO_HEADERS
                        else {}

But when an external openai compatible engine is used for RAG the information headers are not added to the embeddings method.

Note:

I think this should be done in generate_openai_batch_embeddings function:
b72150c881/backend/open_webui/retrieval/utils.py (L425)

Originally created by @df-cgdm on GitHub (Jan 27, 2025). # Feature Request It is already possible to enable user information forwarding when doing a chat completion with ENABLE_FORWARD_USER_INFO_HEADERS. https://github.com/open-webui/open-webui/blob/b72150c881955721a63ae7f4ea1b9ea293816fc1/backend/open_webui/routers/openai.py#L209 ``` python { "X-OpenWebUI-User-Name": user.name, "X-OpenWebUI-User-Id": user.id, "X-OpenWebUI-User-Email": user.email, "X-OpenWebUI-User-Role": user.role, } if ENABLE_FORWARD_USER_INFO_HEADERS else {} ``` But when an external openai compatible engine is used for RAG the information headers are not added to the embeddings method. # Note: I think this should be done in generate_openai_batch_embeddings function: https://github.com/open-webui/open-webui/blob/b72150c881955721a63ae7f4ea1b9ea293816fc1/backend/open_webui/retrieval/utils.py#L425
Author
Owner

@tjbck commented on GitHub (Jan 27, 2025):

PR Welcome.

@tjbck commented on GitHub (Jan 27, 2025): PR Welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3453