Repository navigation
feat(chat): Open WebUI Function for provider-agnostic Langfuse tracing - #37
Merged
Merged
Conversation
Also fixes the missed bump from the 0.5.13 release (pyproject was still at 0.5.12). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The pipelines stub's filter seam already traced chat without touching providers, but wiring it required either changing a connection's base URL (connection mode) or running the full open-webui/pipelines sidecar. Add the bundled 'Studio Langfuse Capture' filter function instead: it runs inside Open WebUI's own backend, fires on every chat turn for every connection (OpenAI, Anthropic-compatible, local), and pure-taps inlet/outlet to the stub. No base URL changes, no extra containers, tracing failures never break chat. Smoke-tested against the running stub. docs/chat.md now presents this as the recommended wiring (the official Pipelines README itself recommends Functions over Pipelines for basic filters). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No manual Open WebUI step: push_now() now also installs (or updates when the bundled file changed) 'Studio Langfuse Capture' via Open WebUI's functions API, granting access to all users. Runs at startup and after each connection change; idempotent (content compared, only pushed when changed); best-effort and never raises, so tracing can't block connection sync or startup. The startup report line includes the tracing outcome. Default target is http://helsedir-studio:9099 (studio container name on the shared Docker network); override with STUDIO_PIPELINES_URL or the function's pipelines_url valve. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The functions endpoints require id/name/content/meta on both create
and update, and function ids allow only alphanumerics and underscores:
use a stable slug id, send meta {}, and drop the redundant access-rights
call (new functions are active for all users by default). Verified
against a running Open WebUI instance.
The bundled default pointed at the Azure container name, which never resolves on a dev machine — every tap failed silently. Probe the container hostname at load time and fall back to loopback; explicit STUDIO_PIPELINES_URL still wins.
The subpath Open WebUI build requests /chat/static/favicon.png, which Caddy rewrote to a nonexistent static/favicon.png (only logo.png existed), so the tab icon 404'd. Ship a 64x64 PNG derived from the logo.
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tracing chat to Langfuse via the pipelines stub required either pointing a connection's base URL at the stub (only traces that one OpenAI-compatible connection) or running the full
open-webui/pipelinessidecar — neither of which is "trace everything without touching my connections."What this does
Adds the bundled Studio Langfuse Capture filter function (
chat/openwebui_functions/studio_langfuse_capture.py). Open WebUI Functions run inside OWUI's own backend, so:/filter/inletbefore the model call, reply →/filter/outletafter; payloads return untouchedSetup: paste the file into Open WebUI admin → Functions, set its
pipelines_urlvalve to the studio service base (e.g.http://helsedir-studio:9099). Stub side staysSIMPLEAUDIT_PIPELINES=on+ the threeLANGFUSE_*vars.Smoke-tested both endpoints against the running stub with function-shaped payloads (200, body passed through unchanged).
Docs:
docs/chat.mdnow lists this as the recommended wiring.