Langfuse
Open-source observability and analytics for LLM apps
Langfuse is an open-source platform for tracing, evaluating, and monitoring LLM applications. It captures detailed traces, manages prompts, and provides analytics dashboards for production AI systems.
Langfuse setup guides & articles
Hands-on coverage of Langfuse from the blog.
Key features
- LLM tracing and analytics
- Prompt management
- Evaluation tooling
- Self-hostable
Pros & cons
Strengths
- Detailed LLM tracing
- Prompt management built in
- Many SDK integrations
Trade-offs
- ClickHouse and Redis required
- Some features enterprise
Langfuse replaces
Last reviewed Aug 26, 2026 · 780 words
Self-hosting Langfuse means running 6 containers, not 1: the web app, a worker, Postgres, ClickHouse, Redis, and S3-compatible blob storage (MinIO in the reference compose). Budget 2 GB of RAM as the floor and 4 GB before you feel comfortable, because ClickHouse alone idles at several hundred MB. That is the price of the v3 architecture, and it is worth paying if you are shipping an LLM feature to real users. It is not worth paying to trace a weekend chatbot, where the free cloud tier or a lighter tool wins.
The bill of materials, and why ClickHouse is there
Langfuse 2.x ran on Postgres alone. Version 3 moved traces and observations into ClickHouse because a busy app writes tens of thousands of spans an hour and Postgres queries over that got slow. Redis queues ingestion events for the worker, and blob storage holds raw event payloads and multi-modal attachments. The upstream docker-compose.yml in the langfuse/langfuse repository wires all of this with sane defaults; my only edits on a homelab are replacing every placeholder secret, setting NEXTAUTH_URL to the public address, and pinning image tags rather than latest. The self-hosting docs list every environment variable; the ones that matter are DATABASE_URL, CLICKHOUSE_URL, REDIS_CONNECTION_STRING, SALT, ENCRYPTION_KEY, and the S3 block. Generate ENCRYPTION_KEY with openssl rand -hex 32 and never rotate it casually, since stored provider keys are encrypted with it.
Tracing pays for itself the first time a user says "it gave me nonsense"
A trace is the full tree of one request: the user input, each retrieval call, each model call with its exact prompt, tokens, latency, and cost, and the final output. Without it you are debugging LLM behaviour from server logs that say 200 OK. The Python SDK makes instrumentation nearly free:
from langfuse import observe
from langfuse.openai import openai # drop-in wrapper, traces every call
@observe()
def answer(question: str) -> str:
docs = retrieve(question)
return openai.chat.completions.create(
model="gpt-4.1-mini",
messages=[{"role": "user", "content": f"{docs}\n\n{question}"}],
).choices[0].message.content
Set LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, and LANGFUSE_HOST=https://langfuse.example.com in the environment and traces appear within seconds. There are also integrations for LangChain, LlamaIndex, the Vercel AI SDK, and OpenTelemetry, and LiteLLM can forward every proxied call to Langfuse with 2 config lines, which is the lazy way to trace an app you cannot edit. I go deeper on what to log and what to redact in LLM observability and tracing.
Prompt management is the feature that changes how you work
Storing prompts in Langfuse rather than in code means a product person can edit the wording, label a version production, and the app fetches it at runtime with langfuse.get_prompt("support-reply"). Every trace records which prompt version produced it, so when quality drops you can see that it started with version 14. Pair that with the evaluation tools (LLM-as-judge scoring on live traces, human annotation queues, and datasets you replay against a new prompt before promoting it) and you have the loop I argue for in evals before vibes: change, measure, promote.
What the MIT license does and does not cover
The core (tracing, prompts, datasets, scores, the API, the SDKs) is MIT and fully usable self-hosted with no key. A handful of features are enterprise-gated even on your own hardware: SSO enforcement, some data retention and audit-log controls, and a few UI extras. For a homelab or a small team none of that matters. For a company with compliance needs, check the feature matrix before assuming self-hosting means everything is free.
Where it stands against LangSmith and the newcomers
LangSmith is the polished incumbent, but self-hosting it is an enterprise sales conversation. Langfuse is the open default with 33,713 GitHub stars, and Opik from Comet is the closest open rival, lighter to run and worth a look if the ClickHouse dependency is a dealbreaker. Langfuse's edge is breadth: more SDK integrations, more mature prompt management, and an ecosystem of tools that already export to it.
What I'd do
Deploy the upstream compose on a box with at least 4 GB free, pin versions, back up Postgres, ClickHouse, and the MinIO bucket nightly, and instrument through LiteLLM or the OpenAI wrapper first. Turn on prompt management the moment a second person needs to tweak wording. If you have one hobby project and no users, use the free cloud tier instead and skip the 6-container tax until it earns its keep.
Compare Langfuse
8 head-to-head comparisons.
Similar self-hosted ai apps
OpenClaw
Self-Hosted AIThe AI that actually does things
Hermes Agent
Self-Hosted AIThe AI agent that grows with you
OpenCode
Self-Hosted AIThe open source AI coding agent
Replaces Claude Code, Cursor
Hugging Face Transformers
Self-Hosted AIState-of-the-art machine learning model library
Replaces OpenAI API
Dify
Self-Hosted AIOpen-source platform for building production LLM apps
Replaces OpenAI Assistants, Vertex AI Agent Builder
Langflow
Self-Hosted AIVisual framework for building AI agents and RAG pipelines
Replaces Vertex AI Agent Builder