[PR #608] feat: migrate Langfuse filter pipeline to SDK v4 #484

Open
opened 2026-10-18 21:06:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/pipelines/pull/608
Author: @hassiebp
Created: 8/12/2026
Status: 🔄 Open

Base: main ← Head: hassiebbot/openwebui-langfuse-v4


📝 Commits (2)

  • ac2bb6e feat: migrate Langfuse filter pipeline to SDK v4
  • 9e17e69 chore: remove Langfuse filter pipeline tests

📊 Changes

2 files changed (+312 additions, -406 deletions)

View changed files

➖ examples/filters/langfuse_v3_filter_pipeline.py (+0 -406)
➕ examples/filters/langfuse_v4_filter_pipeline.py (+312 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/pipelines/pull/608 **Author:** [@hassiebp](https://github.com/hassiebp) **Created:** 8/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `hassiebbot/openwebui-langfuse-v4` --- ### 📝 Commits (2) - [`ac2bb6e`](https://github.com/open-webui/pipelines/commit/ac2bb6eb26be61b86c44ec6ccb0180fdaa45be3d) feat: migrate Langfuse filter pipeline to SDK v4 - [`9e17e69`](https://github.com/open-webui/pipelines/commit/9e17e69bd8e8fdd4b71f93bd372777a1a4a0ae0a) chore: remove Langfuse filter pipeline tests ### 📊 Changes **2 files changed** (+312 additions, -406 deletions) <details> <summary>View changed files</summary> ➖ `examples/filters/langfuse_v3_filter_pipeline.py` (+0 -406) ➕ `examples/filters/langfuse_v4_filter_pipeline.py` (+312 -0) </details> ### 📄 Description ## 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](https://linear.app/clickhouse/issue/LFE-14968/outreach-openwebui-upgrade-langfuse-filter-pipeline-to-python-sdk-v4) Related Langfuse docs PR: [langfuse/langfuse-docs#3503](https://github.com/langfuse/langfuse-docs/pull/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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#484
No description provided.