Skip to content

feat: migrate Langfuse filter pipeline to SDK v4 - #608

Draft
hassiebp wants to merge 2 commits into
open-webui:mainfrom
hassiebp:hassiebbot/openwebui-langfuse-v4
Draft

feat: migrate Langfuse filter pipeline to SDK v4#608
hassiebp wants to merge 2 commits into
open-webui:mainfrom
hassiebp:hassiebbot/openwebui-langfuse-v4

Conversation

@hassiebp

@hassiebp hassiebp commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • replace the Langfuse v3 filter example with a Python SDK v4 implementation
  • preserve one logical trace per OpenWebUI chat with deterministic trace IDs
  • propagate user, session, tags, and trace metadata before creating observations
  • record parented user-input spans and model generations with model, input, output, and v4 usage_details
  • close turn roots on outlet, replacement, valve updates, and shutdown, then flush pending data

The filter declares langfuse~=4.7, which pip resolves as >=4.7,<5. Pipelines splits frontmatter requirements on commas, so this compatible-release spelling preserves the upper bound without being parsed as two packages.

Linear: LFE-14968

Related Langfuse docs PR: langfuse/langfuse-docs#3503

Validation

  • Ruff formatting: 1 file already formatted
  • python3 -m py_compile examples/filters/langfuse_v4_filter_pipeline.py — passed
  • Langfuse Python SDK v4.14.2 in-memory OpenTelemetry smoke test:
    • Requirement range passed: langfuse~=4.7 accepts 4.x and rejects 5.0
    • OTel continuity/propagation passed: 3 spans, 1 trace, 2 direct children

Scope

This does not address unrelated historical OpenWebUI tokenization, model-prefix, or tool-calling behavior.

@hassiebp
hassiebp marked this pull request as draft August 12, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant