Langfuse v4 self-hosting preview #14157
Replies: 6 comments 7 replies
-
|
If I'm using langfuse v4 SDK, latest langfuse self-hosted version. |
Beta Was this translation helpful? Give feedback.
-
|
@Steffen911 thank you for the update, |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the continued work on v4, and especially for committing to support it on the OSS. I've been looking forward to this update! I have two questions about the preview:
Thanks again! |
Beta Was this translation helpful? Give feedback.
-
|
If we have this deployment, will we be able to continue with in future, e.g get updates to GA version, or it will be a new deployment again? |
Beta Was this translation helpful? Give feedback.
-
|
It currently shows: - name: LANGFUSE_MIGRATION_v4_WRITE_MODEbut it should be: - name: LANGFUSE_MIGRATION_V4_WRITE_MODE(V4 needs to be uppercase.) Since environment variables are case-sensitive, using the lowercase v4 causes Langfuse to ignore the setting and fall back to the default legacy mode, which then results in the following startup error:
It took me a while to spot this, so hopefully this helps anyone else who copies the example. |
Beta Was this translation helpful? Give feedback.
-
|
We're really looking forward to updating to v4, thanks for all the work to make it available to OSS as well 😄 We're running in production ( To confirm my understanding: can we update to the latest version and as long as we leave the new environment variables unset it will stay stable until the migrations for existing data are available? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
In https://github.com/orgs/langfuse/discussions/12518 we've shared out plans for a new data model and subsequently published https://langfuse.com/blog/2026-03-10-simplify-langfuse-for-scale with more implementation details.
Today, we want to share how to run a Langfuse v4 preview in self-hosted environments.
Recap / What is new?
We are moving to an observation-centric data model based on a new, wide, (mostly) immutable ClickHouse table. This eliminates joins and deduplication at read-time and optimizes for the most performant ClickHouse access patterns.
Who can use this?
At this time, you can use a Langfuse v4 setup for completely new deployments only and you must use the Langfuse Python v4 or JavaScript v5 SDK versions or any external OpenTelemetry-based instrumentation.
Additionally, you must use the following minimum versions of the Langfuse infrastructure components:
How to use this?
Start with a regular Langfuse v3 deployment using release v3.179.1 or later.
1. ClickHouse Schema Migrations
Connect to your ClickHouse warehouse and execute the following migrations.
Initial Migration Statements
On non-cloud, multi-node clusters, tables must be created as `ReplicatedReplacingMergeTree` instead of `ReplacingMergeTree`. Replace those below. Also add `ON CLUSTER ‘default’` to the first row of each statement except the `MATERIALIZED VIEW`.
Schema Updates
For any updates to the schema, we will publish dedicated
ALTERstatements here including the release that they need to be applied for. Make sure to check this discussion for any upgrade as the application may break otherwise.We recommend to apply all of the given upgrades in order before upgrading to the version being referenced.
v3.184.0
v3.204.0
ClickHouse Cloud Settings
ClickHouse Cloud implements specific settings that are not available for open source projects. We use the following settings on top of the data schema declared above:
cache_populated_by_fetch = 1: Add this to the settings for the events_core table.ClickHouse User Permissions
In addition to the standard ClickHouse User Permissions the user should receive:
2. Environment Variable Changes
To switch an existing Langfuse v3 deployment with a suitable ClickHouse schema (see previous point) to a Langfuse v4 preview, set the following environment variables:
LANGFUSE_MIGRATION_V4_WRITE_MODE=events_only: Configures the backend to push all tracing information into the neweventstables.LANGFUSE_MIGRATION_V4_ALLOW_PREVIEW_OPT_IN=true: Forces the UI to read from the neweventstables.LANGFUSE_MIGRATION_V4_NATIVE_OTEL_BEHAVIOUR=direct: Write all OpenTelemetry spans directly into theeventstables without attribute propagation as this is not supported in the new mode.CLICKHOUSE_DISABLE_LAZY_MATERIALIZATION=true: Needs to be disabled due to ongoing compatibility issues.Limitations
The following endpoints and functionality will not be present on a Langfuse v4 preview deployment. Support for those features and endpoints may become available for the full Langfuse v4 rollout.
Endpoints
Replaced with OpenTelemetry-based ingestion:
Replaced with GET /api/public/v2/observations [link]:
Replaced with GET /api/public/v3/scores [link]:
Replaced with GET /api/public/v2/metrics [link]:
Features
Trace-based & legacy-dataset-based LLM as a Judge evaluations:
Batch exports / integrations:
TRACE_OBSERVATIONSexport option won’t produce any data.FAQ & Troubleshooting
Please ask any questions within this thread or contact the maintainers. We will publish guides or frequently appearing questions here.
What is coming next?
Internally, we work on migrations for existing Langfuse v3 deployments including historic data migrations.
We will provide updates once we have more things to share.
Changelog
Beta Was this translation helpful? Give feedback.
All reactions