Langfuse โ Open-Source Observability
Lesson 6: Langfuse โ Open-Source Observability
Langfuse is the open-source challenger on the observe layer: an independent, self-hostable platform for LLM tracing, evaluation, prompt management, and cost tracking. If LangSmith is the Apple of LLMOps (polished, hosted, integrated), Langfuse is the Linux โ open-source core, run it on your own hardware, no vendor lock-in. (The Langfuse team is now part of ClickHouse, and v4 shipped in August 2026 with major performance and real-time ingestion upgrades.)
What Langfuse gives you
| Feature | What it does |
|---|---|
| Tracing | Full run traces with token usage, latency, and cost per model call |
| Sessions | Group traces by user or conversation for end-to-end analysis |
| Prompt management | Versioned prompts with labels (production/staging), deployable from the UI |
| Evals & datasets | LLM-as-judge, custom scoring functions, and curated test sets |
| Cost tracking | Per-project, per-model spend analytics |
| Feedback & guardrails | User thumbs-up/down, annotation queues, moderation checks |
| Experiments | A/B-ish comparison of prompts/models against datasets |
Deployment options
- Langfuse Cloud โ hosted SaaS with a free tier; zero ops.
- Self-hosted (Docker) โ the popular choice:
docker compose upgets a full stack (app + Postgres + ClickHouse for analytics) running locally. - Enterprise / Kubernetes โ for large-scale self-hosting with SSO and RBAC.
# Self-host with Docker
git clone https://github.com/langfuse/langfuse.git
cd langfuse
cp .env.example .env # set secrets, then:
docker compose up -d
Hooking it up
Langfuse integrates with LangChain through a callback handler โ again, near-zero code changes:
from langfuse.callback import CallbackHandler
langfuse_handler = CallbackHandler(
public_key="pk-...", secret_key="sk-...",
host="http://localhost:3000" # or https://cloud.langfuse.com
)
result = chain.invoke({"topic": "RAG"}, config={"callbacks": [langfuse_handler]})
Beyond LangChain, Langfuse supports plain OpenAI/Anthropic SDKs, its own Python/JS SDKs, and โ importantly โ the OpenTelemetry GenAI semantic conventions, meaning any OTel-instrumented app can send traces to it. This is the same OTel story LangSmith adopted, and it's what makes the observe layer genuinely swappable.
๐ง Knowledge Check
1. What's the headline difference between Langfuse and LangSmith?
2. How do you integrate Langfuse with a LangChain app?
3. What standard makes observability platforms swappable?