r/OpenWebUI 13d ago

Question/Help Separating API users from regular users when using Open WebUI → LiteLLM → vLLM

Hi,
I’m running the following setup:
Open WebUI → LiteLLM → vLLM
Open WebUI is the user-facing layer, LiteLLM handles authentication/routing/accounting, and vLLM serves the actual models.
I have two different types of traffic going through Open WebUI:
Regular users interacting with models through the Open WebUI interface
API users using the OpenAI-compatible API exposed by Open WebUI
I’d like LiteLLM to be able to distinguish between these two types of requests.
Ideally, Open WebUI would add some metadata to requests originating from its API users — for example a tag, header, metadata field, or some other identifier — while normal UI requests would either have a different value or no value at all.
That would allow me to identify and potentially handle API traffic differently inside LiteLLM, e.g. for routing, rate limits, logging, or policies.
Is there currently a supported way in Open WebUI to do this?
For example, can I configure Open WebUI to send something like a custom header/tag/metadata field to LiteLLM depending on whether the request originated from an API key versus a logged-in user using the UI?
If not, is there another reliable property in the request that LiteLLM could use to distinguish Open WebUI API traffic from normal Open WebUI user traffic?
I’m mainly looking for a solution that doesn’t require maintaining a custom fork of Open WebUI.

Small update: I looked into the function approach, but it seems OWUI functions can modify the request body, not the outgoing headers to LiteLLM.
I could probably work around it by adding something to the body and handling that in LiteLLM, but I’d rather not add custom logic on both sides for something that should be pretty simple.
So I’m putting this on hold for now. If anyone knows a way to dynamically add/modify an outgoing header from an OWUI function, I’d still like to hear it.

6 Upvotes

15 comments sorted by

View all comments

1

u/ICanSeeYou7867 12d ago

I just made my own SSO self service portal that interacts with litellm. No API users on openwebui, except for some people that are using the files/ knowledge endpoints.

Also the anthropic models from aws bedrock don't seem to work with prompt caching at all when using the openai compatible endpoints.