Open WebUI tracing and cost tracking with Langfuse

Open WebUI can send every model reply to a self-hosted Langfuse through a filter function, giving traces, token use, latency and cost by user and model. This page covers the setup, the data mapping and the privacy review it requires.

On this page

Open WebUI tracing and cost tracking with Langfuse: what it does and how it connects

A shared Open WebUI deployment often reaches a point where nobody can say which user or model is driving token spend, or why replies slowed down on a given afternoon. The supported way to answer those questions is a filter function inside Open WebUI that sends every model reply to a Langfuse instance. Langfuse then records traces with full input and output, token usage, latency, cost broken down by user and model, chat sessions and evaluations. The Open WebUI Langfuse integration documents this filter function approach, so the team does not need to patch the Open WebUI code to get the data.

The privacy consequence is the part to plan first. Because the trace captures full prompts and completions, Langfuse becomes a store of user conversations, not just telemetry. Before enabling the filter, confirm which users and models are in scope, who can open traces in the Langfuse interface, how long traces are kept, and whether any content must be masked. Several controls in this area, including data retention policies, audit logs and server-side data masking, are Enterprise license features in self-hosted Langfuse, so check which of them your organization needs before you choose a license tier. Langfuse's core features and APIs are available in the MIT-licensed open source version, and the Langfuse self-hosting documentation describes the deployment this integration depends on.

DeployOpen deploys and configures both sides in your infrastructure: the self-hosted Langfuse stack with its database, analytics store and blob storage, and the Open WebUI filter that sends replies to it. The work includes the public keys and host settings, which user identities appear in the reports, and the access model for the Langfuse projects. Confirm with your platform team which environment the trace store will run in and whether it falls under the same data handling rules as the chat data it receives.

What you need in place before connecting Open WebUI to Langfuse

The Langfuse integration adds a filter function to a running Open WebUI, so the work starts with a working deployment and a reachable Langfuse. Each card below is a piece that must be decided or confirmed before the filter is installed, because gaps here usually show up later as missing traces or unexplained data exposure.

Running Open WebUI deployment

Confirm which Open WebUI release line you run and check the Langfuse integration page on the Open WebUI docs for the filter function's stated compatibility with that release. If you run several replicas, the scaling guide requires PostgreSQL instead of SQLite and Redis for shared state, plus shared file storage. Without Redis, signing out does not revoke tokens, so trace data tied to sessions can outlive the user's access.

Latest release noted
v0.12.3
Langfuse integration docs

Self-hosted Langfuse web and worker

Langfuse runs as two application containers. Langfuse Web serves the UI and APIs that Open WebUI calls, and Langfuse Worker processes events asynchronously. Decide whether a single VM with Docker Compose is acceptable for testing, or whether production needs Kubernetes with Helm or Terraform, since the Compose path is documented without high availability.

Langfuse self-hosting docs

Data stores and blob storage

Plan PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage before deployment. The scaling guide lists minimum sizing, including 2 CPU and 8 GiB for ClickHouse, and at least 16 GiB of ClickHouse memory for larger deployments. Ask who operates backups for each store, since full trace content lands in these systems.

Network path between the two

Open WebUI's server, not the user's browser, must reach the Langfuse host URL, so confirm routing, DNS, certificates and any egress or proxy rules between the Open WebUI container and Langfuse Web. Check that the path stays inside your network and does not depend on an external hosted Langfuse endpoint unless that is an approved decision.

Project API keys and secret handling

Create a Langfuse project with a public and secret key pair for the Open WebUI filter, and store the secret key in your secrets system rather than in shared configuration. Decide who may rotate the keys. Anyone holding the secret key can write traces into the project, so scope the project to this workload only.

Public and secret per project
2 keys

Privacy review scope

Because the filter sends full input and output of every reply, the privacy review must cover user prompts, uploaded content and model answers in Langfuse. Confirm which roles can read traces, whether data retention policies are needed (an Enterprise license key feature in self-hosted Langfuse), and whether server-side masking is required, since that also needs the Enterprise license.

Langfuse license key docs

How to configure the Langfuse filter function step by step

This sequence takes a team from an empty test environment to a verified trace in Langfuse for each Open WebUI reply, with user and model attributes visible before any production data flows. Each step closes with a check so problems surface early.

  1. Stand up Langfuse in a test environment

    Deploy self-hosted Langfuse in a non-production environment that you control, using the Docker Compose path for testing or a Kubernetes deployment if your platform team already runs one. Langfuse needs PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage alongside its web and worker containers, so confirm each dependency is reachable before you continue. The step is done when the Langfuse UI loads over HTTPS and you can create a first account. Confirm the version you deploy against the current Langfuse self-hosting documentation, since v3 to v4 has its own ClickHouse, PostgreSQL and Redis minimums.

  2. Create a Langfuse project and API keys

    In the Langfuse UI, create a project dedicated to this Open WebUI environment so that test and production traces stay separate. Generate a public and secret key pair for that project and store the secret in your organization's secrets manager rather than in a shared document. The check is that the keys are listed in the project settings and that you can record which project they belong to. Keep this project separate from any other team's data, because the traces will contain full prompts and responses.

  3. Install the Langfuse filter function in Open WebUI

    Sign in to Open WebUI as an administrator and add the Langfuse filter function from the function settings, following the Open WebUI Langfuse integration documentation for the exact source and installation steps. Review the function code before enabling it, because it runs server-side and sees every prompt and response. The check is that the function appears in the administrator function list with its enabled state visible. Record the function version and the date you reviewed it so the change is traceable.

  4. Set the connection values in the filter

    Open the Langfuse filter's valves or settings and enter the Langfuse host address and the project keys from the previous step, using the setting names shown in the Open WebUI Langfuse documentation. Make sure the Open WebUI container can reach the Langfuse web endpoint over the network path you intend to use in production, and that the host address is the internal one if Langfuse is not public. The check is that the function saves without error and that Open WebUI logs show no connection failure on the next request. Store keys as secrets, not as plain text in configuration exports.

  5. Send a test chat as a named test user

    Sign in to Open WebUI as a dedicated test user, choose a model, and send a short chat with a recognizable prompt so you can find the trace later. Repeat with a second model and a second test user if your deployment will report cost by model and by user. The check is that the reply completes normally in Open WebUI, which confirms the filter does not block chat. If the reply fails or stalls, disable the filter and fix the connection before testing further.

  6. Confirm the trace in Langfuse

    In the Langfuse project, open the traces list and find the test prompts you sent. Check that each trace shows the full input and output, the model name, a latency value, and token counts for input and output. Filter or inspect the trace to confirm the user attribute matches the test user. The step is done when every test reply has a trace with these fields populated. If token counts are missing for a model, note which provider or model it is, because cost calculation depends on those counts.

  7. Verify cost views and attributes before production

    Check that the cost-by-user and cost-by-model views in Langfuse reflect the test sessions, and that the model pricing Langfuse applies matches the models you actually use. Where a model is not in Langfuse's price list or is a private model, confirm how the cost will be recorded and whether you need to set custom pricing. Document the result as a short test record: versions, test users, models, and what was verified. This record becomes the evidence for the privacy review and the baseline for production rollout.

How each reply flows from Open WebUI into Langfuse

Every reply follows the same path. A user sends a message to Open WebUI, Open WebUI forwards it to the configured model, and the model returns a reply. The Langfuse filter function, running inside Open WebUI, then sends the input, the output, token usage and timing to Langfuse Web, which accepts the event and returns. Langfuse Worker picks the event up asynchronously, processes it and writes it into ClickHouse, with PostgreSQL and blob storage holding the rest of the application data. The user sees the reply before Langfuse has finished processing it, so trace data can appear in the Langfuse UI a short time after the chat turn ends. Confirm the exact delivery behavior of the filter (batching, retries and whether it blocks the response) in the Open WebUI Langfuse documentation and in your own test environment before you rely on it.

The trust boundary sits at the network call from Open WebUI to the Langfuse Web endpoint. Everything on the Open WebUI side, including the prompt, the reply and the user identity passed along, leaves that process once the filter sends it. Anything Langfuse stores is therefore data you have copied out of the chat system, so the privacy review should treat Langfuse as a second store of prompts and answers with its own retention, access and backup rules. Keep both systems inside your infrastructure, restrict the path between them to the required endpoints, and decide who can open traces in Langfuse before the filter is switched on for all users.

If Langfuse is slow or unreachable, the outcome depends on how the filter handles failed sends, which you must verify rather than assume. Test the failure directly: stop Langfuse Web, send chat messages, and check whether replies still reach users, whether latency rises, and whether events are lost or queued. Also test a slow Worker, because Langfuse Web can accept events faster than Worker and ClickHouse can write them, which delays visibility without failing the chat. Record the result as an accepted risk or a monitoring requirement, and make sure the Langfuse health checks feed the same alerting your team uses for Open WebUI.

Request and trace flow between Open WebUI, the model and Langfuse

A user's prompt starts in Open WebUI, where the Langfuse filter function captures the request and the model reply. The model provider answers through the same path, and the filter sends the trace to Langfuse Web, which hands it to Langfuse Worker for asynchronous processing. Worker writes to ClickHouse and PostgreSQL, while Redis or Valkey and S3-compatible blob storage support the rest of the stack. Check that the trust boundary matches where your prompts, replies and model keys actually travel, because the trace carries full input and output.

Trace path from Open WebUI through the filter to the self-hosted Langfuse stack.

How Open WebUI users, models and usage map to Langfuse fields

This table shows how each Open WebUI data point is expected to land in Langfuse as a trace, observation, session, user or cost value. Use it to plan the filter configuration and to decide which fields need review before go-live. Confirm every field name against the filter version you deploy, because the mapping can change between releases.

Open WebUI dataLangfuse destinationWhat to confirm
User identityUser field on the trace, used to group cost and usage by personWhether the filter sends user ID, email or display name, and whether that is configurable
Model nameModel field on the generation, used for cost and usage by modelThe model string matches a Langfuse price definition, or cost will not calculate
Chat identifierSession ID that groups replies from the same conversationThe chat ID is passed on every reply, so multi-turn chats appear as one session
Input and output contentInput and output on the observationWhether full prompts and answers are stored, and whether masking or truncation applies
Token usageInput and output token counts on the generationThe provider returns usage data; some local or compatible servers report none
LatencyStart and end timestamps on the observationHow streaming responses are timed, and whether time to first token is captured
CostCost calculated from model prices defined in Langfuse, or supplied by the filterWho maintains price definitions for local and private models that have no list price
Trace boundaryOne trace per model reply, with observations nested insideWhether retries, tool calls or task-generated requests create extra traces

Where to host Langfuse for testing and production

Docker Compose on a single virtual machine is the documented path for testing Langfuse. It runs the whole stack on one host, which makes it quick to evaluate whether the Open WebUI filter sends the traces, token counts and costs your team expects. The trade-off is that the setup has no high availability. If the VM stops, tracing stops with it, and any upgrade or disk problem affects the only copy of the service.

  • Sizing: The stack still needs the documented minimums: 2 CPU and 4 GiB each for Langfuse Web, Langfuse Worker and PostgreSQL, 1 CPU and 1.5 GiB for Redis or Valkey, and 2 CPU and 8 GiB for ClickHouse. Plan one host large enough to hold all of them at once.
  • Backups: Snapshots of the VM disk are the simplest recovery path. Confirm how PostgreSQL, ClickHouse and blob storage are each captured, because they must be restored to a consistent point.
  • Upgrades: Minor updates within a major version apply database migrations at startup, so test them on this VM first. Major upgrades follow separate migration guides and need a rehearsal.
  • Data scope: Keep test data in this environment only. Do not point real production traffic at it without a privacy review.
  • Cost: Costs are the VM, its storage and your team's time. No vendor fee applies to the open source version.

Before you rely on this setup for anything more than evaluation, confirm the minimums against your expected trace volume with the Langfuse self-hosting documentation.

What the privacy review needs to cover before full input and output are logged

Sending every Open WebUI reply to Langfuse copies prompts, answers and user identities into a second system with its own retention and access rules. The cards below separate the decisions your privacy and security teams own from the controls DeployOpen can help configure and document as evidence.

Purpose and lawful basis

Full capture is a processing activity in its own right, separate from the chat service that users already rely on. Your privacy team should record why traces are kept, which purposes are covered (cost allocation, debugging, quality review), and the lawful basis for each. Capturing input and output for cost tracking alone is often harder to justify than capturing token counts and latency, so ask whether the filter can be scoped to metadata for some models or groups.

Retention periods for traces

Traces hold the full prompt and reply, so they carry the same sensitivity as the chats themselves, often in a second location. Decide how long traces live, who deletes them, and how deletion reaches backups. Data retention policies are an Enterprise-only feature in self-hosted Langfuse, so confirm whether a retention limit can be enforced without it or whether it must be handled in your own database and storage procedures.

Who can view traces

Anyone with access to the Langfuse project can read other users' prompts and replies. Map which roles need trace content, which need only cost dashboards, and which need neither. Project-level RBAC roles are an Enterprise-only feature, so without an Enterprise license, confirm whether your access model is acceptable with the organization-level roles available in the free version, and document the answer before rollout.

Masking before data leaves Open WebUI

Masking inside Langfuse happens after data has already been sent, so it does not limit what the platform receives. Identify the fields most likely to carry personal data, such as names, account numbers, health details or credentials pasted into a prompt, and decide whether to redact them in the Open WebUI filter before transmission. Server-side data masking is an Enterprise-only feature, so the client-side approach may be the only option under the free license.

Audit logs and access evidence

Auditors and privacy reviewers will ask who viewed or exported trace content and when. Audit logs are an Enterprise-only feature in self-hosted Langfuse. Decide whether that record is required for your review, and if the free version does not provide it, plan how access to the Langfuse database, ClickHouse and blob storage will be logged at the infrastructure layer instead.

Controls DeployOpen can evidence

DeployOpen can configure the filter, deploy Langfuse inside your infrastructure, restrict network paths, set up access and backup procedures, and prepare documentation that your privacy and security teams and independent assessors can review. DeployOpen does not issue audit reports or certifications, and the legal basis, retention periods and risk acceptance remain decisions for your organization.

Langfuse license key docs

Why traces go missing or costs look wrong

This table lists the failures teams hit most often when Open WebUI sends replies to self-hosted Langfuse, with the likely cause, the check to run and the fix for each. Work down the rows in order, since a missing trace usually comes from configuration before anything else. Items marked as checks should be confirmed in your own environment against the Open WebUI and Langfuse documentation.

SymptomLikely causeCheckFix
No traces appear in LangfuseThe Langfuse filter function is not installed or not enabled for the modelConfirm the filter is listed under functions in the Open WebUI admin panel and turned on for the models in useEnable the filter globally or per model, then send a test message and look for a new trace
No traces appear, and Open WebUI logs show connection errorsWrong Langfuse host, or the Open WebUI container cannot reach the Langfuse Web addressFrom the Open WebUI container, make a request to the configured Langfuse host and check the responseCorrect the host value, use an address reachable from the Open WebUI network, and open the firewall or proxy path
Traces rejected or absent after a key changePublic or secret keys copied from the wrong project or environmentCompare the keys with the project settings in Langfuse and check for stray spacesRegenerate keys in the correct project, update the filter valves, and retest
Traces missing user or model fieldsUser or model metadata not passed through the filter, or the chat is run by an API client that skips the filterOpen one trace and check which attributes are empty, then compare with a chat sent from the browserConfirm the filter reads user and model details from the request, and document which access paths (browser, API, integrations) are covered
Cost shows as zero for a modelThe model has no pricing entry in Langfuse, so token counts are recorded without a costCheck the model definitions in Langfuse for the model name and whether a price is attachedAdd the model name and per-token prices in Langfuse, then note that earlier traces may need reprocessing to show cost
Model names differ from pricing namesProvider model identifiers or aliases do not match the name stored in LangfuseCompare the model name on a trace with the entries in the Langfuse model listMap the exact identifier, including any version suffix, to a defined model entry
Latency spikes and traces arrive lateLangfuse Worker is lagging behind ingestion, often under heavy loadCheck Worker CPU use and queue behavior against the Langfuse scaling guidance, and compare trace timestamps with reply timesScale worker containers on CPU load, and split langfuse-web into ingestion and user interface deployments if ingestion stays high
Storage fills during a historic backfillBackfilling old data needs extra ClickHouse disk headroom while it runsWatch ClickHouse disk use before and during the backfill and confirm headroom against the v3 to v4 upgrade guidePlan backfills in batches with spare disk space, and confirm the headroom figure in the upgrade guide before starting

Questions buyers ask about Langfuse tracing for Open WebUI

What drives the cost of Langfuse tracing for Open WebUI?

The cost is mostly the infrastructure you run plus the people who build and operate it. Infrastructure scales with how many replies you trace, how long you keep them and how much data each trace carries, since full inputs and outputs are stored by default. Labor covers the Open WebUI filter setup, deploying Langfuse with its supporting services, sizing storage, backups, the privacy review and handover. Ask any quote to separate one-time build work from recurring items such as hosting, storage growth, upgrades and support retainers, and to state which Langfuse features are assumed to be on the free open source tier.

Does Langfuse tracing need an Enterprise license?

No. Langfuse states that all core features and APIs are available in the MIT-licensed open source version without limits, and the Open WebUI filter sends traces to that core. An Enterprise license key is only needed for features such as project-level RBAC roles, data retention policies, audit logs, server-side data masking, SCIM provisioning for the organization and the instance management API. Decide early which of these your privacy or security review requires, because that choice decides whether you need a custom-priced Self-Hosted Enterprise plan, and ask for that line item in the quote.

How many resources does a self-hosted Langfuse deployment need?

Langfuse's scaling guide lists minimum values of 2 CPU and 4 GiB for Langfuse Web, Langfuse Worker and PostgreSQL, 1 CPU and 1.5 GiB for Redis or Valkey, and 2 CPU and 8 GiB for ClickHouse. The guide also recommends at least 16 GiB of ClickHouse memory for larger deployments. These are starting points, not sizing for your workload. Ask the implementer to size workers on measured CPU load, and to plan for splitting langfuse-web into separate ingestion and user interface deployments if ingestion becomes heavy.

How much storage should I plan for trace retention?

Storage grows with the number of replies traced, the average size of prompts and responses, and how long traces are kept. ClickHouse holds the analytical data and blob storage holds the rest, so both need capacity planning. For historic backfills, the Langfuse v3 to v4 upgrade guide advises about 3x ClickHouse disk headroom, so a backfill needs roughly three times the disk space of the data being loaded. Ask the quote to state the retention period, the expected reply volume, the backup target and the disk headroom assumed for any backfill.

What does the privacy review cover for Langfuse traces?

Because the filter stores every model reply with full input and output, the review centers on what personal and confidential data enters prompts, where traces are stored, who can read them and how long they live. Reviewers usually ask about access control by user and project, retention and deletion, masking of sensitive fields, encryption in transit and at rest, backups, and the location of ClickHouse and blob storage. DeployOpen prepares systems, controls and evidence for that review. It does not issue audit reports or certifications, which independent auditors or certification bodies provide.

Can my own team set up Langfuse tracing for Open WebUI?

Yes, if you have engineers who run Kubernetes or Docker, PostgreSQL, ClickHouse and S3-compatible storage. Langfuse documents Docker Compose on a single VM for testing, without high availability, and Kubernetes with Helm or Terraform for production on AWS, Azure and GCP. The Open WebUI side is a filter function, so the integration itself is small. The larger effort is operating the data stores, upgrades and the review evidence. A partner is useful when the team lacks that operations depth or needs the work delivered as a fixed scope.

What does the client need to provide for this engagement?

Expect to provide a target environment with compute, PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible storage, plus network paths from Open WebUI to Langfuse. You will also need named owners for the privacy review, an Open WebUI administrator account to install the filter, the list of user groups and models to be traced, the retention rule and access to your identity provider if SSO is required. Ask for these as written prerequisites in the quote so timing is not lost waiting for access.

What should I ask for in a written quote for this work?

Ask for a fixed scope listing the deployment target, the Langfuse version and its planned upgrade path, the Open WebUI filter configuration, the sizing basis for compute and storage, the retention and backup design, and the privacy review deliverables. Also ask which Enterprise features are included or excluded, what is one-time and what recurs, what the client must provide, how acceptance is tested, and what support or retainer terms apply after handover. DeployOpen does not publish a price list, so the quote follows from that written scope.

How DeployOpen scopes and delivers the Langfuse tracing integration

DeployOpen plans, builds, tests and hands over the Open WebUI to self-hosted Langfuse tracing path inside your own infrastructure. We agree the scope in writing first, then document the filter function, the Langfuse hosting and the privacy review so your team can run and audit the integration.

How we scope

  • Engagements are fixed-scope, with the Open WebUI and Langfuse versions, hosting model and reporting goals agreed in writing before work starts.
  • The written scope names which models, user groups and reply types the filter function will send to Langfuse, and which will be excluded.
  • We confirm with your security and privacy teams what full input and output capture means for your data before any tracing is enabled.

How we build

  • We deploy the Langfuse services in your infrastructure, including PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible blob storage, sized to your expected volume.
  • We install and configure the Open WebUI filter function, then test that traces, token use, latency and cost appear by user and model.
  • We test masking, retention and access settings, including which Langfuse features your Enterprise license key must unlock, and record the results.

How we hand over

  • You receive written documentation covering the filter configuration, data flows, retention settings, backup steps and the decisions behind them.
  • We prepare the evidence your privacy review asks for, such as data inventory notes, access lists and logging settings, for your own reviewers and auditors.
  • Your operators walk through the runbook for upgrades, including the Langfuse migration guides for major versions, before the handover closes.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover, covering Open WebUI and Langfuse version changes.
  • Retainers can cover reviewing new Open WebUI releases and Langfuse upgrades before they reach production, with the filter function retested each time.
  • Ask any quote to state which Langfuse components, storage tiers and support plan are included, since Langfuse prices its self-hosted Enterprise plan separately.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.