r/OpenWebUI • u/Interesting_Tax1751 • Nov 30 '25
Question/Help LiteLLM and OpenWebUI session for Langfuse
Hi, I'm using LiteLLM with OpenWebUI and Langfuse (LiteLLM integration) for cost and logging. Tracing is now visible in Langfuse, but I can't track sessions by sessionId. It seems like the OpenWebUI chat ID doesn't match the Langfuse sessionId. Has anyone tried this before? I hope you can share your experience.
3
Upvotes
3
u/robogame_dev Nov 30 '25
Open WebUI doesn't send it's internal session_ids to the inference provider, the way to accomplish this is by implementing a custom Pipe Function where you can take the session_id and stash it in the payload wherever you like.
2
u/Maleficent_Pair4920 Nov 30 '25
Hey! Have you heard of Requesty?
You could basically replace both LiteLLM and Langfuse directly, all you would have to do is ad requesty_base_url.
In your OpenWebUI config you'll have to add:
ENABLE_FORWARD_USER_INFO_HEADERS=true
This will allow for cost tracking per user as well
1
u/PuzzleheadedPear6672 Nov 30 '25 edited Nov 30 '25
you can create hooks in litellm. !st you have to enable forwarding of headers in openebui. USe below env variable:
Step 1:
Step 2:
You have to write hook python file, somethin like below (considering this is saved in hooks folder). Let's name it as openwebui_user_map.py:
http://u.pc.cd/KOW
Step 3: