Langfuse is the "what just happened?" layer for teams shipping anything more complex than a single chat completion. Traditional monitoring assumes deterministic code; LLM apps break that three ways — non-determinism (the same prompt returns different answers, so "it was weird yesterday" is unreproducible without a trace), hidden multi-step chains (one message fans out into a dozen calls, and the bug is usually three steps back), and cost/latency creep (token usage is invisible until the bill arrives). Langfuse gives you a searchable history of prompts, completions, latency, cost, retrieved docs, and tool calls as nested traces.
Is Langfuse really free? Cloud vs self-hosted
Self-hosted (free forever): the MIT core runs via the official docker compose (Postgres + ClickHouse + Redis + the web/worker) with no trace, seat, or feature caps beyond a few enterprise add-ons (SSO enforcement, fine-grained RBAC, audit logs) behind a commercial license. Cloud Hobby (free): 50,000 units/month, no credit card (a "unit" is roughly one ingested observation) — check the pricing page for the current number.
| Dimension | Self-Hosted (MIT) | Cloud Hobby (Free) |
|---|---|---|
| Price | $0 (you pay for the server) | $0, no credit card |
| Trace volume | Unlimited | 50,000 units/month |
| Team seats | Unlimited | Limited on free tier |
| Data residency | Your infrastructure | EU or US region |
| Setup | One docker compose up | Sign up, copy two keys |
| Enterprise extras (SSO, RBAC) | Commercial license | Paid tiers |
Rule of thumb: prototype on Cloud Hobby (ninety seconds to start), move to self-hosted the moment you exceed the free volume, need unlimited seats, or have data-residency rules that rule out a third party seeing your prompts.
Langfuse vs LangSmith vs Phoenix vs Helicone
| Tool | Open source | Free path | Integration | Best for |
|---|---|---|---|---|
| Langfuse | Yes (MIT core) | Self-host free + Cloud Hobby (50k/mo) | SDK + decorators + OpenTelemetry, framework-agnostic | A full platform you can also self-host |
| LangSmith | No (SaaS) | Free Developer (~5,000 traces/mo, 1 seat) | Tightest with LangChain/LangGraph | Teams all-in on LangChain |
| Arize Phoenix | Yes | Fully free to self-host | OpenTelemetry, notebook-first | Notebook debugging & evals |
| Helicone | Yes | Free tier (~10,000 req/mo) | Proxy — change one base URL | Lowest-effort drop-in logging |
(Free-tier numbers change often — verify on each vendor's page.) The dividing line is how they capture data. Helicone is a proxy (zero code, but only sees what flows through it). Langfuse and LangSmith use an SDK/instrumentation model, so they capture non-LLM steps (retrievals, tool calls, business logic) as spans in the same trace. Phoenix leans on OpenTelemetry — portable, slightly more setup. Langfuse's pitch is "open like Phoenix, full-featured like LangSmith, framework-agnostic unlike either." If you live entirely inside LangGraph, LangSmith's native hooks may win on convenience.
Core features
- Tracing & spans — one trace (a user request) contains nested spans (retrieval, each LLM call, each tool) with timing, tokens, and cost per node; grouped into sessions and attributed to users.
- Prompt management — prompts are versioned, named objects fetched at runtime; label a version
productionand it deploys with no redeploy, each version linked to the traces that used it. - Evaluations & scoring — attach scores from user feedback, LLM-as-a-judge, a custom function, or human annotation; chart quality over time.
- Datasets — turn a real failing trace into a permanent test case; re-run after every change.
- Playground & dashboards — re-run a failing trace with a tweaked prompt/model in-app; aggregate cost/latency/token views to find the endpoint eating 70% of spend.
Self-host for free in one command
On any Docker machine — including a free Oracle Cloud ARM VPS:
git clone https://github.com/langfuse/langfuse.git
cd langfuse
docker compose up -d
That serves the UI at http://localhost:3000. Create an account (stored in your own database), make a project, and copy the public/secret keys. For production, put it behind HTTPS and back up Postgres + ClickHouse; the self-hosting docs cover Kubernetes and managed databases.
Instrumenting your app: three ways
Set these once; every example works against Cloud or self-hosted:
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
# Cloud EU https://cloud.langfuse.com | US https://us.cloud.langfuse.com | self-host http://localhost:3000
export LANGFUSE_HOST="https://cloud.langfuse.com"
Way 1 — the OpenAI drop-in (zero refactor). Since Groq, Together, Mistral, and OpenRouter are all OpenAI-compatible, change one import line:
# before: from openai import OpenAI
from langfuse.openai import openai # drop-in replacement
client = openai.OpenAI(base_url="https://api.groq.com/openai/v1", api_key="YOUR_GROQ_KEY")
resp = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[{"role": "user", "content": "Explain LLM observability in one sentence."}],
)
# Now automatically traced: prompt, completion, tokens, latency, cost — zero other changes.
Way 2 — the @observe decorator captures your own functions; nested decorated functions become nested spans:
from langfuse import observe
from langfuse.openai import openai
@observe()
def retrieve(question): return "...retrieved context..." # child span
@observe()
def answer(question):
context = retrieve(question)
resp = openai.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "system", "content": f"Answer using:n{context}"},
{"role": "user", "content": question}])
return resp.choices[0].message.content
# One trace, three spans: answer -> retrieve, answer -> openai call.
Way 3 — the LangChain/LangGraph callback captures the whole chain:
from langfuse.langchain import CallbackHandler
handler = CallbackHandler()
result = chain.invoke({"question": "What is LLM observability?"}, config={"callbacks": [handler]})
A TypeScript drop-in exists too (observeOpenAI(new OpenAI({...}))), and because Langfuse v3 is built on OpenTelemetry, any OTel-instrumented library can feed it.
Where observability earns its keep: RAG
A wrong RAG answer can come from retrieval or generation, and the two look identical from outside. With each step wrapped in @observe, a single trace shows the query embedding, the vector-store documents retrieved with similarity scores, the reranked order after Cohere, the exact final prompt (which chunks made it into context), and the completion with token count and cost. When a user reports "it said we don't offer refunds, but we do," you open their trace and instantly see whether the refund chunk wasn't retrieved (retrieval problem) or was retrieved and ignored (prompt problem). Five seconds of looking replaces an hour of guessing.
Prompt management removes redeploys — fetch by name at runtime, cached client-side so it adds no hot-path latency:
from langfuse import Langfuse
langfuse = Langfuse()
prompt = langfuse.get_prompt("support-agent") # 'production' label by default
compiled = prompt.compile(customer_name="Ada", product="Widget Pro")
For evals, the judge can be any provider you connect — using free Gemini or a Llama model on Groq keeps the whole eval loop at $0, which matters because evaluation can run more model calls than production itself. Langfuse supports online (judge on live traffic), offline (against a fixed dataset before release), and human annotation.
When to use Langfuse vs alternatives
- One open-source platform for tracing + prompts + evals, self-hostable free → Langfuse
- All-in on LangChain/LangGraph, want the tightest native integration → LangSmith
- Debug mostly in notebooks, care most about evals → Arize Phoenix
- Lowest-effort logging, one OpenAI-compatible API → Helicone (proxy, one URL change)
- Strict data residency — prompts can't leave your network → self-hosted Langfuse or Phoenix
FAQ
Is Langfuse really free?
Yes, two ways. The MIT core self-hosts with no trace, seat, or feature caps (a few enterprise extras like SSO need a commercial license). Cloud has a free Hobby tier (50,000 units/month, no credit card). You only pay for managed hosting above the free volume or governance features.
Does it add latency?
Negligibly. Trace data is sent asynchronously after your response returns, and prompts are cached client-side, so users don't wait on Langfuse.
Do I have to use LangChain?
No — Langfuse is framework-agnostic. The OpenAI drop-in and @observe decorator work with plain SDK calls, CrewAI, LlamaIndex, raw HTTP, or custom orchestration.
Can I use it with free APIs like Gemini, Groq, or DeepSeek?
Yes. Any OpenAI-compatible endpoint works with the drop-in wrapper — just set base_url. Groq, Together, DeepSeek, Mistral, and OpenRouter all qualify, and Gemini works through its OpenAI-compatible layer.
Does it track cost, and does self-hosting need special databases?
Yes to cost — per-call token usage and a dollar estimate, aggregated by day/model/user/feature. Self-hosted uses Postgres (transactional), ClickHouse (trace analytics), and Redis (queuing), all provisioned by the official Docker Compose file.
Final verdict
Langfuse is the right default in 2026 for anyone shipping an LLM app who's been burned by a bug they couldn't reproduce: full trace tree, versioned prompts, and evaluations, as an open-source platform you can self-host free with no caps or run on a free Cloud tier in ninety seconds. LangSmith is smoother if you live in LangChain, Phoenix is the notebook-native evals choice, and Helicone wins on pure zero-effort logging — but for the broadest combination of openness, features, and a real free path, install Langfuse first. Change one import and watch your first trace appear.
Related Reads
- Free AI APIs in 2026: We Tested 10, Four Now Want a Card — pick the provider you'll trace with Langfuse
- CrewAI: Free Open-Source Multi-Agent AI Framework for Python — multi-agent systems that beg to be observed
- CrewAI vs AutoGPT vs LangGraph: Free Agent Frameworks — the orchestration layer Langfuse sits underneath
- MCP (Model Context Protocol): Connect AI Agents to Any Tool or API — the tool calls that show up as spans
- Cohere Free API: Embedding and Rerank for RAG — the RAG stack you'll be debugging trace-by-trace
- Dify: Free Open-Source AI App Builder for Chatbots and Workflows — another open-source layer in the free AI stack