[GH-ISSUE #8661] Send X-OpenWebUI-Request-Type, e.g. "retrieval" or "web_search" or X-OpenWebUI-Should-Cache as an optional header to improve prompt caching #53874

Closed
opened 2026-05-05 15:28:43 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @crizCraig on GitHub (Jan 17, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8661

Feature Request

Is your feature request related to a problem? Please describe.
RAG prompts starting with "### Task:\nRespond to the user query using the provided context are not amenable to prompt caching as they don't persist in the message history. So writing them to cache ends up increasing costs, since they are never read back.

Describe the solution you'd like
I provide a custom openai compatible API which currently gets user info via headers like X-OpenWebUI-User-Name and it'd be great to get the prompt type in a header like X-OpenWebUI-Prompt-Type or X-OpenWebUI-Request-Type or even a should cache header like X-OpenWebUI-Should-Cache.

Describe alternatives you've considered
I will just check for the RAG template for now when caching, but wanted to bring this up as prompt caching seems to be a popular request, see https://github.com/open-webui/open-webui/issues/4887

Originally created by @crizCraig on GitHub (Jan 17, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8661 # Feature Request **Is your feature request related to a problem? Please describe.** RAG prompts starting with `"### Task:\nRespond to the user query using the provided context` are not amenable to prompt caching as they don't persist in the message history. So writing them to cache ends up increasing costs, since they are never read back. **Describe the solution you'd like** I provide a custom openai compatible API which currently gets user info via headers like `X-OpenWebUI-User-Name` and it'd be great to get the prompt type in a header like `X-OpenWebUI-Prompt-Type` or `X-OpenWebUI-Request-Type` or even a should cache header like `X-OpenWebUI-Should-Cache`. **Describe alternatives you've considered** I will just check for the RAG template for now when caching, but wanted to bring this up as prompt caching seems to be a popular request, see https://github.com/open-webui/open-webui/issues/4887
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#53874