---
title: "Deploy Langfuse vs LangSmith"
description: "Self-hosted MIT LLM tracing vs LangChain LangSmith"
category: "AI/ML"
url: https://railway.com/deploy/deploy-langfuse-vs-langsmith-on-railway
---

# Deploy Langfuse vs LangSmith

Self-hosted MIT LLM tracing vs LangChain LangSmith

**[Deploy Langfuse vs LangSmith on Railway](https://railway.com/template/deploy-langfuse-vs-langsmith-on-railway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-langfuse-vs-langsmith-on-railway/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### langfuse-worker

- **Image:** langfuse/langfuse-worker:3

### langfuse-web

- **Image:** langfuse/langfuse:3
- **Public domain:** Yes

### ClickHouse

- **Image:** clickhouse/clickhouse-server:24.8

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Buckets

- **langfuse-bucket**

## Documentation

# Deploy and Host self hosted Langfuse vs LangSmith (Open-Source Prompt Versioning) on Railway

Teams weighing LangChain's LangSmith often hit a wall: closed-source SaaS, enterprise-only self-hosting. Langfuse flips that. It's MIT-licensed, framework-agnostic, and runs as a self-hosted stack with Postgres, ClickHouse, Redis, and S3-compatible storage. This guide compares the two, then shows how to deploy Langfuse v3 on Railway.

## About Hosting Langfuse vs LangSmith open-source software on Railway (self hosted Langfuse prompt management template)

Langfuse stores prompts as versioned objects outside your codebase. You create a prompt in the UI or SDK, label it `production`, and fetch it at runtime. Every save is immutable. LangSmith's Prompt Hub does similar work but only inside LangChain's ecosystem and closed-source SaaS.

## Why Deploy Langfuse vs LangSmith, the PromptLayer alternative on Railway (Railway Free Trial)

Self-hosting Langfuse means you own prompt history, traces, and evals. LangSmith ties you to LangChain and their cloud. Langfuse works with OpenAI SDK, LangChain, LlamaIndex, LiteLLM, and raw OpenTelemetry. You can move the `production` label without a code deploy.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Langfuse vs LangSmith on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Langfuse vs LangSmith self hosting

| Provider | Notes for Langfuse vs LangSmith |
|---|---|
| DigitalOcean | You manage Docker Compose, ClickHouse, and S3 yourself. Fine for one VM but you babysit upgrades. |
| AWS | ECS or EKS plus RDS, ElastiCache, and ClickHouse on EC2. More moving parts, more cost, more control. |
| Hetzner | Cheap bare metal or VPS, but no managed ClickHouse or S3. You run MinIO and ClickHouse containers by hand. |

## Common Use Cases for hosted Langfuse vs LangSmith

- **Versioned prompt iteration:** Keep every wording change as an immutable version, diff them, and roll back by moving a label.
- **Model config in prompts:** Store `model`, `temperature`, `max_tokens`, and `response_format` in the prompt's `config` JSON, so switching models needs no code change.

## Dependencies for Langfuse vs LangSmith Docker hosted on Railway

The Langfuse v3 stack is six services. `langfuse-web` serves UI and API on port 3000; `langfuse-worker` handles async ingestion and evals on port 3030. Postgres stores transactional data, Redis queues and caches prompts, ClickHouse 24.8 stores traces and observations, and Railway Storage Bucket replaces MinIO for raw events and media.

### Deployment Dependencies for Managed Langfuse vs LangSmith Service (Prompt Versioning)

- **langfuse-web:** `langfuse/langfuse:3`, public, port 3000, UI plus API.
- **langfuse-worker:** `langfuse/langfuse-worker:3`, port 3030, async ingestion and evals.
- **Postgres:** Transactional data and schema migrations.
- **Redis:** Ingestion queue plus prompt cache.

### Implementation Details for Langfuse vs LangSmith (Using Langfuse official docker images)

Core Langfuse repo is MIT licensed. `ee` folders need a license key, but the free OSS build includes tracing, prompt management, datasets, evals, and cost tracking. Use the official `langfuse/langfuse:3` and `langfuse/langfuse-worker:3` images.

## How does Langfuse vs LangSmith compare against other prompt management tools

### Langfuse vs LangSmith Prompt Hub

- **License:** Langfuse is MIT open source; LangSmith Prompt Hub is closed source, self-host only on Enterprise.
- **Framework lock-in:** Langfuse works with any LLM framework via OpenTelemetry or native SDKs; LangSmith is built for LangChain and LangGraph first.

### Langfuse vs PromptLayer

- **Open source:** Langfuse is MIT licensed and self-hostable. PromptLayer is closed-source SaaS; no self-host option for the prompt registry.
- **Versioning model:** Langfuse versions every save; labels point to versions. PromptLayer uses versions and tags but API and UI differ.

### Langfuse vs Agenta

- **Scope:** Langfuse covers tracing, prompts, evals, and cost. Agenta is an open-source LLMOps platform with prompt playground and evals, but less mature trace analytics.
- **Storage:** Langfuse uses ClickHouse for high-volume traces. Agenta typically uses Postgres and may struggle at scale.

### Langfuse vs prompts in Git

- **Deploy speed:** Moving a `production` label in Langfuse takes seconds, no code deploy. Changing a prompt in Git requires a PR, CI, and redeploy.
- **Trace metrics:** Langfuse shows latency, cost, and scores per prompt version. Git has no runtime linkage to traces unless you build it.

## How to use Langfuse vs LangSmith (the OSS prompt management platform)?

1. **Create API keys:** In Langfuse project settings, generate a public and secret key for your SDK. Store them in your app's environment.
2. **Create a prompt:** Use the UI or Python `langfuse.create_prompt(name, prompt, config)` with `{{double_braces}}` variables. A prompt is text or chat array; type cannot change later.

## How to self host Langfuse vs LangSmith on other VPS Services (Langfuse self hosting guide)

### Clone the Repository

Clone the official `langfuse/langfuse` repo. The root `docker-compose.yml` is for local and single-VM testing only. For production on a VPS, you need separate Postgres, ClickHouse, Redis, and S3-compatible storage.

### Install Dependencies

Install Docker and Docker Compose. Create a dedicated user for Langfuse. Provision Postgres 16, Redis 7, ClickHouse 24.8, and an S3 bucket (MinIO if self-hosted S3). Set up a reverse proxy like Caddy or Nginx for HTTPS.

### Configure Environment Variables

Copy `.env.example` to `.env` and fill in `DATABASE_URL`, `REDIS_CONNECTION_STRING`, `CLICKHOUSE_URL`, `CLICKHOUSE_MIGRATION_URL`, `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, `CLICKHOUSE_CLUSTER_ENABLED=false`, `LANGFUSE_S3_EVENT_UPLOAD_BUCKET`, `LANGFUSE_S3_EVENT_UPLOAD_REGION`, `LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID`, `LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY`, `LANGFUSE_S3_MEDIA_UPLOAD_*` equivalents, `SALT`, `ENCRYPTION_KEY` (64 hex chars), `NEXTAUTH_SECRET`, and `NEXTAUTH_URL`.

### Start the Langfuse vs LangSmith Application

Run `docker compose up -d`. The web service runs migrations on startup. The worker may need a manual restart after first web boot. Access the UI on port 3000. For production, set `NEXTAUTH_URL` to your public domain and use proper TLS termination.

## Official Pricing of Langfuse vs LangSmith (Langfuse pricing)

Langfuse Cloud: Hobby free (50k units/mo, 30 days retention, 2 users), Core $29/mo (100k units, 90 days), Pro $199/mo (3 years), Enterprise $2,499/mo. Extra units $8 per 100k. Self-hosted Langfuse OSS is free with no usage limits. LangSmith pricing is not quoted here; check their pricing page.

## Langfuse vs LangSmith cloud vs self hosted comparison (Pricing, features, costs, and more)

### Monthly cost of self hosting Langfuse vs LangSmith on Railway

On Railway, the six-service stack with ClickHouse runs roughly $15 to $40 per month at low traffic, depending on CPU and RAM allocations. The $5 Railway trial covers a short evaluation. Langfuse Cloud starts free, then $29/mo for Core. LangSmith's hosted pricing is separate and not quoted here.

### System Requirements for Hosting Langfuse vs LangSmith on a VPS

Official guidance for a single VM: 4 CPU cores, 16 GiB RAM, 100 GiB disk. ClickHouse needs the most memory and disk for trace volume. Postgres and Redis are lighter. For production on Railway, allocate at least 2 vCPU and 4 GiB to ClickHouse, 1 vCPU and 2 GiB to Postgres, and 512 MiB to Redis. The web and worker can run on 1 vCPU and 1 GiB each.

## Frequently Asked Questions (FAQs)

### What happens if Langfuse is down?

The Python and JS SDKs cache prompts client-side with default TTL 60 seconds. If Langfuse is unreachable, cached prompts still work. You can also pass a fallback prompt when calling `get_prompt`, so your app never crashes from a missing prompt service.

### How fast do prompt changes reach production?

Moving the `production` label in UI or API takes effect on the next prompt fetch. Because SDKs cache prompts for 60 seconds by default, first requests after a label move can still use the old version. Set `cache_ttl_seconds=0` in dev or pre-fetch on startup to reduce staleness.

### What's the difference between labels and versions?

Every save creates an immutable version number. Labels are mutable pointers to versions. `production` is the default label served when you pass none. `latest` always points to the newest version. Custom labels like `staging` or `tenant-a` let you serve different versions to different environments or users.

### Can I protect the production label from accidental moves?

Protected prompt labels, which stop non-admins from moving `production`, are an Enterprise Edition feature when self-hosted. The free MIT build does not include label protection. You can implement access control via your own auth layer or restrict UI access.

### Does Langfuse add latency to my LLM calls?

The SDK flushes traces asynchronously, so it should not block your LLM request. Prompt fetching is a local cache lookup after the first call. If you disable caching, each fetch hits the Langfuse API, adding network latency. For production, keep caching on and pass a fallback prompt.

### Can I keep using Langfuse for tracing while managing prompts elsewhere?

Yes. Langfuse's tracing works independently of prompt management. You can use it purely as an OpenTelemetry backend and ignore prompts, or adopt prompts gradually. LangSmith requires LangChain for full integration; Langfuse accepts any framework or raw SDK.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/deploy-langfuse-vs-langsmith-on-railway
