Skip to content
Stribog

Sovereign AI

All writing

Langfuse vs LangSmith: Where Your Prompts and Traces Live

Langfuse vs LangSmith: Langfuse's MIT core self-hosts on Postgres and ClickHouse; LangSmith self-hosting is an Enterprise add-on. Who holds your prompts.

By 13 min read

Most comparisons line up screenshots and prices. Every trace holds the full text a user typed, the context your retrieval step pulled in, and the model's complete answer. A trace store is therefore a second copy of every sensitive input your application ever handled, kept for as long as its retention policy says. The question that matters to a platform or security lead is who holds that copy, where, and who can delete it.

The question is where the transcript lives

Application logs are usually designed to avoid payloads. LLM observability is designed to capture them, because the payload is the thing you debug. When an agent gives a wrong answer, the engineer needs the exact prompt, retrieved chunks and completion. Both Langfuse and LangSmith capture inputs and outputs unless you tell them otherwise, and both document ways to mask or hide them.

So treat the trace store the way you would treat a replica of your production database. If your inference runs on private data, perhaps behind a self-hosted gateway of the kind Stribog compared in LiteLLM alternatives, keeping the model on your hardware achieves little if every prompt is then copied to a third-party tracing service. The gateway decides where requests go; the trace store decides where their contents stay.

The verdict up front: the two products have near-identical data models and different hosting models. Langfuse is built to be self-hosted from its open-source core, with a commercial licence key for some governance features. LangSmith is a managed service first, with self-hosting sold to Enterprise customers. Everything below is dated as of 2026-12-02, because both products ship releases almost daily.

What each one records per trace

Langfuse's data model has three nested levels. A trace represents a single request or operation, such as one chatbot interaction from question to answer, and groups all observations that share the same trace_id. Observations are the individual steps inside it: LLM calls, tool calls, retrieval steps. Sessions group traces that belong to the same user interaction. Evaluation results attach as scores, which take one of four data types: Numeric, Categorical, Boolean or Text.

LangSmith uses different words for the same shape. A run is a single unit of work, such as calling an LLM, formatting a prompt or retrieving documents, and its documentation says to think of a run as an OpenTelemetry span. A trace is a collection of runs for a single operation. A thread is a sequence of traces representing one multi-turn session. Evaluation results and human judgements are recorded as feedback on runs.

  • Langfuse observation ↔ LangSmith run — one step, one span.
  • Langfuse trace ↔ LangSmith trace — one request end to end.
  • Langfuse session ↔ LangSmith thread — one conversation.
  • Langfuse score ↔ LangSmith feedback — an evaluation attached to the data.

So moving between the tools is translation, not redesign, provided your instrumentation is not welded to one SDK. Neither tool requires a particular framework. LangSmith is made by the LangChain team but works without LangChain: wrap_openai wraps the OpenAI client so its calls are traced, and the @traceable decorator marks your own functions as runs. Langfuse's SDK sits on OpenTelemetry directly.

Two self-hosted architectures and where they diverge

Self-hosted Langfuse runs a web container and a worker container against four stateful services. ClickHouse stores the observability data: traces, observations and scores. Postgres stores transactional data such as users, organizations, projects and API keys. Redis (or Valkey) carries the queue, and S3-compatible blob storage holds raw events. Langfuse v4 needs ClickHouse 25.12 at minimum, a compatibility floor rather than a version to pin. The latest release when this was written was v4.91.0, published on 2026-12-01.

The web container receives traces in batches and writes them to S3 immediately; only a reference goes into Redis for queueing, and the worker later picks the events up from S3 and ingests them into ClickHouse. Langfuse's documentation states the consequence: because every tracing and evaluation event lands in blob storage before the database, events are not lost while the database is temporarily unavailable. It also means raw payloads pass through two stores, both of which belong in your data inventory.

Langfuse's Docker Compose file is explicitly for local use and a single test VM: it runs all seven services on one machine with no high availability, scaling or backup. Production means the Helm chart or the AWS, Azure or GCP deployment guides.

Self-hosted LangSmith runs in your own Kubernetes cluster and bundles its storage services by default; the documentation tells you to use external storage services in production. PostgreSQL is the primary store for transactional and operational data, which LangSmith describes as almost everything besides runs. Redis backs queuing and caching, with Valkey officially supported as a drop-in replacement. Blob storage is required as of v0.18, and when you do not configure your own, the Helm chart deploys RustFS in the cluster.

The trace store is where LangSmith is changing under your feet. ClickHouse is still documented as the primary store for traces and feedback, bundled by default as a stateful set in the same cluster. But on LangSmith 0.17 and later a new installation can run SmithDB without ClickHouse. SmithDB is an optional columnar datastore built for agent traces; it needs a dedicated PostgreSQL 18 or later database for its metastore and its own object storage bucket, separate from the main Postgres and blob storage. LangSmith's SmithDB page states that ClickHouse support ends in v0.19. As of the self-hosted changelog on 2026-12-02, the newest Stable changelog entry is langsmith-0.18.6 (2026-11-27), and 0.19 exists only as release candidates such as 0.19.0-rc.11.

Same instrumentation, three destinations. Only the dashed path takes prompts and completions outside your boundary; LangSmith BYOC, not drawn, is covered in the closing section.

LangSmith Cloud mirrors this split. Of its five regions, GCP US, GCP EU, GCP APAC and AWS US store trace data in ClickHouse Cloud, while Azure US uses SmithDB with data in Azure Blob Storage and does not use ClickHouse Cloud. So the accurate summary is not that the two stacks are the same underneath. Langfuse's trace store is ClickHouse; LangSmith is moving its trace store to SmithDB, and anyone self-hosting it today should plan for that migration before choosing their ClickHouse operating model.

Licensing and the self-hosting line

The Langfuse repository is licensed MIT ("MIT Expat") for everything outside four directories, ee/, web/src/ee/, worker/src/ee/ and packages/shared/src/server/ee/, which fall under a separate ee/LICENSE. Langfuse states that all core features and APIs are available in the open-source edition without a licence key, and that Enterprise and Government keys unlock additional self-hosted features.

That line moved in June 2025. From v3.65.0, LLM-as-a-Judge evaluations, the Playground, Prompt Experiments, Annotation/Data Labeling and S3 Exports went from commercial to MIT. What still needs a key, as of 2026-12-02, includes:

  • Project-level roles and protected prompt labels.
  • Data retention policies and server-side data masking.
  • Audit logs, including read-access logs.
  • UI customization and organization creation restrictions.
  • The Organization Management API and SCIM, plus the Instance Management API.
  • External media storage, and IAM role authentication for S3 and Amazon Bedrock LLM connections.

The pattern is clear even though the list moves: analytics and evaluation are open, while most governance features, the ones an auditor asks about, are commercial. A regulated deployment should budget for a key or for building equivalent controls, and should check the current licence-key page before designing, because this list is a dated snapshot, not the complete set.

Ownership changed too. ClickHouse acquired Langfuse, announced in January 2026, and the licence file's copyright line now reads ClickHouse, Inc. Langfuse's announcement says it stays open source and self-hostable, that there are no planned changes to licensing, and that self-hosting is a first-class path. Treat that as a statement of intent, not a contract. The protection that does not depend on intent is the licence itself: code already published under MIT can be forked and run under those terms whatever a future owner decides about later versions.

LangSmith's line is drawn differently. Self-hosted LangSmith is an add-on to the Enterprise plan, which LangChain describes as designed for its largest, most security-conscious customers. The client SDK repository is MIT-licensed. If you cannot buy the Enterprise plan, the self-hosted option is not available to you, and your traces go to LangSmith Cloud.

Evaluations and prompt versioning compared

Both products cover the same evaluation loop: collect production traces, curate them into datasets, run experiments against new prompts or models, score the outputs with an LLM judge or a human, and watch the scores over time. LangSmith runs online evaluations on runs and threads from production traffic, and its annotation queues collect structured human feedback on runs. Langfuse has had LLM-as-a-Judge, Prompt Experiments and annotation in its MIT core since v3.65.0, with results stored as typed scores beside the traces.

Prompt management is where the operational difference shows. In Langfuse, prompt versions carry labels, and when your code asks for a prompt without naming a label, Langfuse serves the version labelled production. The SDKs cache prompts client-side, so after first use a fetch adds no latency and no availability dependency. In LangSmith, every saved prompt update creates a commit with a unique hash, and commit tags are human-readable labels that, unlike hashes, can be moved to point at a different commit.

Use movable labels where the blast radius is small. Pin immutable versions wherever an auditor may later ask which exact prompt produced a given answer on a given date.

OpenTelemetry as the exit ramp

The cheapest insurance against either vendor is to instrument with OpenTelemetry and treat the backend as an exporter setting. Langfuse makes this natural: its SDK is a thin layer on the official OpenTelemetry client, and the server accepts OTLP at /api/public/otel. It supports OTLP over HTTP, both HTTP/JSON and HTTP/protobuf; gRPC is not supported. Authentication is Basic auth, with the public key as username and the secret key as password. LangSmith Cloud accepts OTLP at /otel on its regional API host, such as eu.api.smith.langchain.com for the EU region, authenticated with an x-api-key header.

One Langfuse detail is easy to miss. Its OpenTelemetry guide says spans sent directly over OTLP should carry the header x-langfuse-ingestion-version: 4, so that data appears in real time on the v4 data model; without it, the same guide says, directly ingested data can be delayed by up to 10 minutes. (A Langfuse compatibility page gives 15 minutes for the same case, so treat the figure as approximate and set the header.)

yaml
receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch: {}

exporters:
  # Self-hosted Langfuse. otlphttp appends /v1/traces to this base path.
  otlphttp/langfuse:
    endpoint: http://langfuse-web:3000/api/public/otel
    headers:
      Authorization: "Basic ${env:LANGFUSE_AUTH}"
      x-langfuse-ingestion-version: "4"
  # LangSmith Cloud, EU region. Only enable for data allowed to leave.
  # The agent must already exist. Send both agent headers or neither:
  # one without the other is rejected with HTTP 400.
  otlphttp/langsmith:
    endpoint: https://eu.api.smith.langchain.com/otel
    headers:
      x-api-key: "${env:LANGSMITH_API_KEY}"
      Langsmith-Agent-Id: "${env:LANGSMITH_AGENT_ID}"
      # One of: local, development, staging, production
      Langsmith-Agent-Environment: "${env:LANGSMITH_AGENT_ENVIRONMENT}"

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/langfuse, otlphttp/langsmith]
An OpenTelemetry Collector that fans traces out to both backends. Run it during an evaluation or migration, then delete one exporter. The application never changes.

An application can also export straight to self-hosted Langfuse without a collector. Build the Basic credential from the key pair (on GNU base64, -w 0 stops long keys being wrapped) and set the standard OTLP variables:

bash
#!/usr/bin/env bash
set -euo pipefail

# Both values come from your secret store; nothing is written inline.
: "${LANGFUSE_PUBLIC_KEY:?set LANGFUSE_PUBLIC_KEY}"
: "${LANGFUSE_SECRET_KEY:?set LANGFUSE_SECRET_KEY}"

AUTH_STRING="$(echo -n "${LANGFUSE_PUBLIC_KEY}:${LANGFUSE_SECRET_KEY}" | base64 -w 0)"

export OTEL_EXPORTER_OTLP_ENDPOINT="http://langfuse-web:3000/api/public/otel"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic ${AUTH_STRING},x-langfuse-ingestion-version=4"
Direct OTLP export to self-hosted Langfuse over HTTP/protobuf. gRPC is not accepted.

Two cautions. The collector config above sends every span to LangSmith Cloud as well, so use dual-write only for data that is allowed to leave, and remove the exporter when the comparison is done. LangSmith files OTLP traces under a registered agent and environment, so create the agent first and set both headers together. Self-hosted LangSmith uses https://<host>/api/v1/otel, not the Cloud path, and none of these base paths takes a /v1/traces suffix. The broader argument for owning the telemetry pipeline itself, independent of any one backend, is made in Stribog's piece on observability versus monitoring.

Retention, masking and what an auditor is shown

Retention defaults point in opposite directions. On self-hosted Langfuse, without a retention policy, event data (traces, observations, scores and media assets) is stored indefinitely. Retention is configured per project, with a minimum of three days, and on a self-hosted instance data retention policies are one of the licence-key features. Without a key, expiring old transcripts is your own job against your own ClickHouse and blob storage.

LangSmith assigns every trace to one of two tiers, base or extended. On Cloud those are 14 and 180 days; traces ingested into LangSmith SaaS with extended retention on or after 14 September 2026 are kept for at most 180 days, while Cloud traces ingested before that date keep the retention they had when ingested. Self-hosted LangSmith uses Helm chart defaults of 14 and 400 days. On Cloud, trace and application data are stored in the cloud location of the region where you signed up, with two documented exceptions: authentication and authorization data live on Supabase and can sit in a different location, and payment and billing data are stored in the US.

Masking before export is the control that works regardless of backend. Langfuse's JavaScript SDK accepts a mask function on LangfuseSpanProcessor, applied to the input, output and metadata of every observation before data is sent. It is not on the licence-key list; server-side masking is.

typescript
import { NodeSDK } from "@opentelemetry/sdk-node";
import { LangfuseSpanProcessor } from "@langfuse/otel";

const EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;
const CARD = /\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/g;

const spanProcessor = new LangfuseSpanProcessor({
  // data is the stringified JSON of input, output or metadata.
  mask: ({ data }) =>
    data.replace(EMAIL, "***MASKED_EMAIL***").replace(CARD, "***MASKED_CARD***"),
});

const sdk = new NodeSDK({
  spanProcessors: [spanProcessor],
});

sdk.start();
Client-side redaction in the Langfuse JS SDK. Regex masking is a floor, not a guarantee: it misses anything it was not written for.

LangSmith offers a blunter switch. Setting LANGSMITH_HIDE_INPUTS and LANGSMITH_HIDE_OUTPUTS to true suppresses inputs and outputs entirely, and the anonymizer is skipped for whatever is hidden. The trace keeps its structure and metadata and loses its transcript, which is often the right trade for a regulated workload on a managed service.

bash
#!/usr/bin/env bash
set -euo pipefail

: "${LANGSMITH_API_KEY:?set LANGSMITH_API_KEY}"

export LANGSMITH_TRACING=true
# Placeholders: the agent must already exist. Set both or nothing is sent.
export LANGSMITH_AGENT_ID="my-agent"
export LANGSMITH_AGENT_ENVIRONMENT="production"

# EU region; traces then carry run structure and metadata, no transcript.
export LANGSMITH_ENDPOINT="https://eu.api.smith.langchain.com"
export LANGSMITH_HIDE_INPUTS=true
export LANGSMITH_HIDE_OUTPUTS=true
LangSmith for a regulated workload: timings and structure leave, payloads do not.

Then ask what you can take with you. Langfuse can schedule exports to Amazon S3, S3-compatible storage, Google Cloud Storage or Azure Blob Storage every 20 minutes, hourly, daily or weekly, and self-hosted, the tables are yours anyway. LangSmith bulk export, for customers who signed up after 3 August 2026, is only available on the Enterprise plan; customers who signed up earlier can use it on Plus or Enterprise until 1 February 2027. None of this is a legal conclusion. It is the evidence an assessor will ask for under frameworks such as those covered in Stribog's EU AI Act high-risk systems guide and its HIPAA on-prem inference piece: where the data is, how long it lives, who can read it, and how it is deleted.

Langfuse alternatives worth knowing

Three other self-hostable projects come up as Langfuse alternatives. Check each licence first; it decides what you may do with the code in five years.

  • Arize Phoenix is licensed under the Elastic License 2.0 (ELv2). That makes it source-available; read its terms before offering it as a service to anyone.
  • Opik, from Comet, is Apache-2.0 and describes itself as tracing, automated evaluation and monitoring for LLM applications, RAG systems and agentic workflows.
  • MLflow is Apache-2.0, with copyright held by Databricks, Inc., and is often already present in teams that run classical ML.

Features change too fast for a ranking to survive the quarter. Shortlist on licence and on which stateful services you are prepared to run, then test with the same OpenTelemetry instrumentation shown above.

Choosing for the long game

Three questions settle most cases. First: may full prompts and completions leave your network? If not, the options are self-hosted Langfuse, self-hosted LangSmith on an Enterprise contract, LangSmith BYOC, or LangSmith Cloud with inputs and outputs hidden, which keeps the tracing and loses the debugging. BYOC is also Enterprise-only: the data plane, holding traces and other sensitive application data, runs in your cloud while LangChain operates it, but the control plane (users, roles, billing, organization and SSO configuration, API keys) stays in LangChain's cloud, in the US. BYOC data planes created on or after 21 October 2026 run SmithDB only. Second: who is on call for ClickHouse? Self-hosting Langfuse means owning a ClickHouse cluster, S3, Redis and Postgres with backups and upgrades, and self-hosting LangSmith means planning its move to SmithDB. Third: what does leaving cost? Owning the tables makes exit a query; on LangSmith Cloud, check your bulk-export eligibility before you need it.

A staged path keeps every option open. Instrument with OpenTelemetry and mask at the SDK from day one. Run the collector with both exporters on non-sensitive traffic while you compare. Pick the backend whose hosting model matches your data, and keep the collector in place so the choice remains reversible. Stribog's analysis of what leaving an observability vendor costs applies here with one addition: in LLM tracing, the data you would be leaving behind is your users' words.

§FAQ/Common questions

Frequently asked

What is the main difference between Langfuse and LangSmith?

Hosting, not data model. Both record nested spans, scores, datasets and versioned prompts. Langfuse's MIT-licensed core self-hosts on Postgres, ClickHouse, Redis and S3, with a licence key for governance features such as retention policies and audit logs. LangSmith is a managed service, and its self-hosted form is an add-on to the Enterprise plan.

Does self-hosted LangSmith use ClickHouse?

By default, yes: ClickHouse is documented as the primary store for traces and feedback. On LangSmith 0.17 and later a new installation can use SmithDB instead, which needs its own PostgreSQL 18 or later metastore and object storage bucket, and LangSmith states that ClickHouse support ends in v0.19. As of 2026-12-02, 0.19 is available only as release candidates.

Can I send OpenTelemetry traces to both Langfuse and LangSmith?

Yes. Use an OpenTelemetry Collector with two otlphttp exporters: Langfuse at /api/public/otel with Basic auth and the x-langfuse-ingestion-version: 4 header, and LangSmith at its regional /otel endpoint with x-api-key plus both agent headers. Langfuse accepts OTLP over HTTP only, not gRPC.

How long does each tool keep trace data?

Self-hosted Langfuse keeps event data indefinitely unless a project retention policy is set, and those policies need a licence key. LangSmith Cloud uses 14-day base and 180-day extended tiers, with extended-retention traces ingested into SaaS on or after 14 September 2026 kept for at most 180 days, while traces ingested earlier keep the retention they had at ingestion; self-hosted LangSmith defaults to 14 and 400 days in its Helm chart.

Is Langfuse still open source after the ClickHouse acquisition?

The repository remains MIT outside its ee directories, and Langfuse's acquisition announcement says there are no planned changes to licensing and that self-hosting remains a first-class path. Code already released under MIT stays usable under those terms.

langfuse vs langsmithlangsmith vs langfuselangfuse alternativesself-hosted llm observabilitylangfuse self-hosted clickhouselangsmith self-hosted enterprise

Executive Briefing

Thirty minutes to clarify your infrastructure risk

Walk us through your vendor footprint and regulatory constraints. We will tell you honestly where sovereignty creates leverage — and where it does not. No pitch deck. No obligation.