Skip to content

Tool Guide · Observability

Langfuse Guide

The definitive guide to Langfuse for LLM observability — traces, prompt versions, evals, cost tracking, self-host setup, and when to pick it over Braintrust or Phoenix.

10 min readOpen-source self-host (free) + Langfuse Cloud hobby tier free, team from ~$49/moUpdated Jun 2026
LangfuseObservabilityEvalsOpen SourceProduction
Visit official site
Edited by The AIKnowHub team · Editorial team

Key takeaways

  • 1Distributed tracing for LLM and agent runs
  • 2Prompt versioning and A/B comparison
  • 3Cost and token dashboards per user/feature
  • 4Eval datasets built from production traces
  • 5Self-host or managed cloud
  • 6SDKs for Python, JS, OpenAI drop-in wrapper
  • 7Export to OpenTelemetry

Best for

  • Debugging agent tool loops in production
  • Tracking prompt changes over time
  • Cost attribution per feature or customer
  • Teams needing self-hosted observability
  • Converting bad traces into eval cases

Not for

  • Notebook-only prototypes with no users
  • Teams wanting evals-only SaaS (see Braintrust)
  • RAG retrieval forensics only (see Phoenix)

What it is

Langfuse is open-source observability for LLM applications. It answers: what prompt was used, what did the model return, what did it cost, and which tool calls failed.

The support triage case study logs every draft-to-sent diff in Langfuse — that diff log became their highest-ROI prompt improvement loop.

What to trace

Minimum fields per LLM call:

FieldWhy
trace_idTie multi-step agent runs together
user_id / session_idCost attribution
prompt_versionCompare v3 vs v4 quality
modelRoute debugging
input_tokens / output_tokensCost
latency_msSLA monitoring
tool_callsAgent debugging

Quick Python integration

from langfuse import Langfuse
from langfuse.decorators import observe

langfuse = Langfuse()

@observe()
def classify_ticket(body: str) -> dict:
    # your LLM call here
    ...

Wrap agent steps with @observe() or use the OpenAI drop-in client.

n8n integration

After HTTP LLM steps, POST trace payload to Langfuse ingestion API. June 2026 n8n 1.50 adds execution log export — pipe into Langfuse for canvas-level debugging. See automation changelog.

Prompt versioning workflow

  1. Tag production prompt as support-draft-v4
  2. Ship v5 to 10% traffic via feature flag
  3. Compare accept rate in Langfuse dashboard
  4. Promote winner, archive loser

Human-in-the-loop automation

Self-host sketch

Docker compose with Postgres + ClickHouse + Langfuse web. Deploy on Fly.io with persistent volumes. Budget 2-3 hours first setup.

When to add Braintrust or Phoenix

  • Braintrust — PM-led eval experiments, scoring rubrics, regression suites in CI
  • Phoenix — deep RAG retrieval debugging, embedding drift

Many teams run Langfuse in prod and Phoenix locally for RAG dev. See comparison.

Default rule

If you ship agents or customer-facing LLM features without tracing, you are flying blind. Langfuse is the default OSS fix.

Pros and cons

Pros

  • Best OSS all-round LLM observability in 2026
  • Framework-agnostic (LangGraph, n8n HTTP, raw SDK)
  • Generous self-host license
  • Traces link prompts to business outcomes

Cons

  • Self-host needs Postgres + ClickHouse appetite
  • Instrumentation is engineering work upfront
  • Eval UX less polished than Braintrust for PMs

Real workflows using this tool

Alternatives

BraintrustPhoenixLangSmithHelicone

Frequently asked questions

Langfuse for self-host tracing and cost. Braintrust when eval experiments are the primary workflow. [Full comparison](/comparisons/langfuse-vs-braintrust-vs-phoenix).

Watch

Hand-picked videos from official + trusted channels. Opens in a new tab.