Comparison intermediate · 8 min read

LangSmith vs Langfuse: which LLM observability platform should you use?

Quick pick

Use LangSmith if you're already in the LangChain ecosystem and want tightly integrated tracing. Use Langfuse if you need open-source self-hosting, cost control, or framework-agnostic observability.

VERDICT

LangSmith wins for LangChain developers who prioritize seamless integration and Anthropic's backing, with pricing starting at $0.10 per trace. Langfuse wins for cost-sensitive teams, self-hosted deployments, and multi-framework observability: it's open-source, free tier is generous (up to 5M events/month), and self-hosted instances cost ~$50/month infrastructure. If you're shipping LLM features across multiple frameworks and need to control costs, Langfuse is 60-70% cheaper at scale.

Side-by-side comparison

FeatureLangSmithLangfuseWinner
Open Source Closed source, proprietary Open source (Apache 2.0), self-hostable Langfuse
Framework Lock-in Tightly integrated with LangChain, supports other frameworks via API Framework-agnostic SDKs (Python, JS, OpenAI, LiteLLM integration) Langfuse
Self-Hosting Cloud-only (no self-hosted option) Full open-source deployment (Docker Compose, Kubernetes) Langfuse
Free Tier $0: includes limited tracing, no usage limits stated clearly 5M events/month free (includes traces, evals, experiments, dashboards) Langfuse
Pricing at Scale $0.10 per trace (pay-as-you-go), $20-$500/mo plans $0 (self-hosted), or ~$50/mo managed (Hobby tier), $500+/mo for enterprise Langfuse
Evaluation/Testing Evaluation framework (requires LangSmith client) Native experiments, A/B testing, human feedback labeling, regression detection Langfuse
Trace Retention Depends on plan (varies) 14 days free tier, 90+ days paid self-hosted unlimited Tie
Team Collaboration Org accounts, shared workspaces (paid tiers) Free team accounts, annotations, human feedback workflows Tie
Integration Breadth LangChain native, supports REST API for others 100+ integrations via SDKs, OpenAI API native support, LiteLLM proxy Langfuse
Latency Impact ~50-100ms per trace (cloud) ~5-20ms local/self-hosted, ~50ms cloud Langfuse

Performance benchmarks

Trace ingestion latency (p99)

LangSmith ~80-150ms (cloud)
Langfuse ~5-20ms (self-hosted), ~60-100ms (cloud managed)

Langfuse self-hosted has lower latency since it runs in your infrastructure; LangSmith cloud-only introduces network round trip

Free tier monthly event capacity

LangSmith Unclear/limited (no published limit)
Langfuse 5,000,000 events/month (includes all features: traces, evals, experiments)

Langfuse free tier is transparent and generous; LangSmith free tier details buried in docs

Cost per 1M traces (annual commitment)

LangSmith $100K-$150K USD (at $0.10/trace)
Langfuse $0 (self-hosted) or ~$600/mo (cloud managed) = $7.2K/year

Self-hosting Langfuse on EC2 costs ~$50/mo; LangSmith has no self-hosted option

Evaluation setup time for 100 test cases

LangSmith ~2-3 hours (custom via evaluation framework)
Langfuse ~15-30 minutes (built-in experiment UI, drag-and-drop)

Langfuse experiments UI is native; LangSmith requires code-first evaluation setup

When to use each

LangSmith
  • ✓ You're already heavily invested in LangChain and want zero-friction integration: LangSmith's auto-instrumentation of LangChain chains, agents, and memory requires one line of setup
  • ✓ Your team size is <10 and you need Anthropic's support contract: LangSmith includes priority support and is backed by Anthropic's investment
  • ✓ You need guaranteed SLA/uptime for compliance: LangSmith offers SOC2, HIPAA compliance (paid tiers), and 99.9% uptime SLA
  • ✓ Your LLM workload is under 100K traces/month: LangSmith's pay-per-trace model is cheaper for low volume, no base cost
  • ✓ You need advanced prompt versioning and chain replay: LangSmith's prompt hub and exact-replay debugging are LangChain-specific advantages
Langfuse
  • ✓ You need cost predictability at 500K+ traces/month: Langfuse self-hosted costs ~$50-100/mo regardless of volume; LangSmith would cost $50K+
  • ✓ You're using multiple frameworks (OpenAI SDK, LiteLLM, Anthropic, custom APIs): Langfuse has SDKs and drop-in integrations for all; LangSmith is LangChain-first
  • ✓ You must self-host observability for data compliance or air-gapped environments: Langfuse is open-source (Apache 2.0), LangSmith has no self-hosted option
  • ✓ You want built-in A/B testing and experimentation UI without engineering: Langfuse's native experiments, human feedback, and regression detection are UI-driven
  • ✓ You need to control infrastructure and avoid vendor lock-in: Langfuse on your Kubernetes/Docker is portable; LangSmith lock-in is permanent

Common misconceptions

LangSmith

✗ LangSmith is free for startups and small teams

✓ LangSmith free tier exists but is heavily limited; costs scale linearly at $0.10/trace. A production LLM app with 10K daily users and 5 traces per user = 50K traces/day = $5K/month. At that scale, you're on a $500+/mo plan

✗ LangSmith can be self-hosted on your infrastructure

✓ LangSmith is cloud-only with no self-hosted option. If you have data residency, compliance, or air-gap requirements, you must choose another platform

✗ LangSmith works equally well for non-LangChain frameworks

✓ LangSmith has native instrumentation for LangChain only. For OpenAI SDK, Anthropic, or custom code, you must manually instrument via REST API, losing auto-tracing benefits

Langfuse

✗ Langfuse self-hosted requires Kubernetes expertise

✓ Langfuse has a one-command Docker Compose setup (docker-compose up) for single-node deployments. Kubernetes is optional, not required: many run it on a single t3.medium EC2 instance

✗ Langfuse is immature or less stable than LangSmith

✓ Langfuse is production-used by 2000+ teams (as of 2026), has 9K GitHub stars, and receives weekly updates. The open-source codebase is auditable; LangSmith is a black box

✗ Langfuse free tier has trace retention limits that kill production use

✓ Langfuse free tier retains traces for 14 days and includes full dashboard, evals, and experiments. Retention is the only limit; features are not gated

Code examples

Task: Instrument a LangChain chain to send traces to LangSmith and log an inference call.

LangSmith: tracing LangChain chain
python
import os
from langsmith import traceable
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate

# Set LangSmith API key (cloud-only, no self-hosting)
os.environ["LANGCHAIN_API_KEY"] = "your-langsmith-api-key"
os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"

# Auto-tracing is enabled at module level
model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
prompt = ChatPromptTemplate.from_template("Summarize this: {text}")
chain = prompt | model

# Chain automatically traced to LangSmith cloud
result = chain.invoke({"text": "Python is a language"})
print(result.content)

LangSmith auto-instruments LangChain objects with one env var set: no explicit logging needed. Traces are sent to LangSmith's cloud only; self-hosting is not an option.

Langfuse: tracing OpenAI SDK call
python
import os
from openai import OpenAI
from langfuse.openai import openai_integration
from langfuse import Langfuse

# Langfuse client (cloud or self-hosted via LANGFUSE_HOST)
os.environ["LANGFUSE_PUBLIC_KEY"] = "your-public-key"
os.environ["LANGFUSE_SECRET_KEY"] = "your-secret-key"
os.environ["LANGFUSE_HOST"] = "http://localhost:3000"  # Self-hosted, or omit for cloud

langfuse = Langfuse()
openai_integration(openai_integration, Langfuse())  # Enable Langfuse tracing for OpenAI SDK

# All OpenAI calls now traced to Langfuse (local or cloud)
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Summarize Python"}]
)
print(response.choices[0].message.content)
langfuse.flush()  # Ensure traces are sent

Langfuse injects observability into any framework via drop-in integrations (OpenAI, Anthropic, LiteLLM). Same code works against cloud or self-hosted Langfuse by setting LANGFUSE_HOST.

Migration path

  1. Switching from LangSmith to Langfuse:
  2. Install: pip install langfuse instead of langsmith.
  3. If using LangChain: replace LangSmith env vars (LANGCHAIN_API_KEY, LANGCHAIN_TRACING_V2) with Langfuse env vars (LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST for self-hosted). LangChain v0.1.30+ has native Langfuse tracer support.
  4. If using OpenAI SDK directly: wrap your client with langfuse.openai.openai_integration() instead of manual instrumentation.
  5. For evaluation: Langfuse has a native Experiments UI; LangSmith evaluations are code-first, so you'll gain UI-driven A/B testing without rewriting.
  6. Deploy: If self-hosting, docker-compose up -d on Langfuse repo; otherwise update LANGFUSE_HOST to cloud endpoint. No code changes needed for self-hosted vs cloud: same SDK handles both.

RECOMMENDATION

Use LangSmith if you're deep in LangChain and team size is <20 developers: seamless integration and Anthropic support justify the cost. Use Langfuse if you need cost control, self-hosting, or multi-framework observability: it's 60-70% cheaper at scale and gives you full data ownership. For teams shipping production LLM features across multiple services, Langfuse is the pragmatic choice; for LangChain-only shops, LangSmith is easier day-one but expensive at scale.
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.