Feature Request: Pass Through Additional Metadata (id, chat_id, session_id) to Custom Backend #2669

Closed
opened 2025-11-11 15:11:38 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @GregorBiswanger on GitHub (Nov 18, 2024).

Important Notes

As a .NET developer and enthusiastic user of Open WebUI, I’ve developed a NuGet package, OllamaApiFacade, that allows .NET developers to integrate Open WebUI as a ready-to-use frontend UI while implementing their own backend logic in C#. I also plan to create a similar package for Node.js, enabling developers to focus on building AI solutions without worrying about frontend or communication logic.

Open WebUI already provides excellent features for communicating with backends like Ollama or OpenAI. However, these backends are stateless, and adding the ability to pass metadata such as id, chat_id, and session_id through to custom backends would simplify state management and enhance the developer experience.


Currently, when Open WebUI forwards requests to custom backends, critical metadata such as id, chat_id, and session_id is not included. For developers building stateful backend logic, the absence of this information makes it difficult to maintain user or session context.

As a fan of Open WebUI, I find it challenging to handle state management in my backend effectively without these fields. This makes the development process more complex and detracts from focusing on core AI logic.


Describe the solution you'd like

I propose that Open WebUI includes an option or standard behavior to forward additional metadata (id, chat_id, session_id) when sending requests to custom backends. This would allow developers to:

  1. Retain session and user context across requests.
  2. Implement robust state management with minimal effort.
  3. Focus on their own logic instead of building complex workarounds for tracking state.

This feature would make Open WebUI even more developer-friendly and powerful for integrating custom backends.


Describe alternatives you've considered

  • Manual Injection of session_id or chat_id: I have attempted to explore workarounds to manually inject these fields into requests or simulate them. However, without native support from Open WebUI, this approach is infeasible, as it is almost impossible to reliably identify and process requests.

  • Custom Pipelines: While Open WebUI allows building custom pipelines, this approach feels overly complex for someone without Python experience. It would require significant effort to implement a pipeline just to pass these fields. A built-in solution would greatly simplify the process and make it accessible to a broader audience.

In summary, I have not found any viable alternative that would allow me to handle identifiable requests or manage state efficiently.


Additional context

I am a big fan of Open WebUI and deeply impressed by its capabilities and flexibility. Adding support for metadata pass-through would align with its vision of empowering developers to create innovative AI solutions. This feature would make Open WebUI even more valuable for developers across different platforms, whether in .NET, Node.js, or others.

Thank you for considering this request! I would be happy to contribute to further discussions or testing this feature.

Originally created by @GregorBiswanger on GitHub (Nov 18, 2024). ## Important Notes As a .NET developer and enthusiastic user of Open WebUI, I’ve developed a NuGet package, [OllamaApiFacade](https://github.com/GregorBiswanger/OllamaApiFacade), that allows .NET developers to integrate Open WebUI as a ready-to-use frontend UI while implementing their own backend logic in C#. I also plan to create a similar package for Node.js, enabling developers to focus on building AI solutions without worrying about frontend or communication logic. Open WebUI already provides excellent features for communicating with backends like Ollama or OpenAI. However, these backends are stateless, and adding the ability to pass metadata such as `id`, `chat_id`, and `session_id` through to custom backends would simplify state management and enhance the developer experience. --- ### **Is your feature request related to a problem? Please describe.** Currently, when Open WebUI forwards requests to custom backends, critical metadata such as `id`, `chat_id`, and `session_id` is not included. For developers building stateful backend logic, the absence of this information makes it difficult to maintain user or session context. As a fan of Open WebUI, I find it challenging to handle state management in my backend effectively without these fields. This makes the development process more complex and detracts from focusing on core AI logic. --- ### **Describe the solution you'd like** I propose that Open WebUI includes an option or standard behavior to forward additional metadata (`id`, `chat_id`, `session_id`) when sending requests to custom backends. This would allow developers to: 1. Retain session and user context across requests. 2. Implement robust state management with minimal effort. 3. Focus on their own logic instead of building complex workarounds for tracking state. This feature would make Open WebUI even more developer-friendly and powerful for integrating custom backends. --- ### **Describe alternatives you've considered** - **Manual Injection of `session_id` or `chat_id`:** I have attempted to explore workarounds to manually inject these fields into requests or simulate them. However, without native support from Open WebUI, this approach is infeasible, as it is almost impossible to reliably identify and process requests. - **Custom Pipelines:** While Open WebUI allows building custom pipelines, this approach feels overly complex for someone without Python experience. It would require significant effort to implement a pipeline just to pass these fields. A built-in solution would greatly simplify the process and make it accessible to a broader audience. In summary, I have not found any viable alternative that would allow me to handle identifiable requests or manage state efficiently. --- ### **Additional context** I am a big fan of Open WebUI and deeply impressed by its capabilities and flexibility. Adding support for metadata pass-through would align with its vision of empowering developers to create innovative AI solutions. This feature would make Open WebUI even more valuable for developers across different platforms, whether in .NET, Node.js, or others. Thank you for considering this request! I would be happy to contribute to further discussions or testing this feature.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#2669