Langfuse

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/cloud/features/10_AI_ML/langfuse.md)

## What is Langfuse?[​](#what-is-langfuse "Direct link to What is Langfuse?")

[Langfuse](https://langfuse.com) is an open-source LLM engineering platform that helps teams collaboratively debug, analyze, and iterate on their LLM applications. It is part of the ClickHouse ecosystem and relies on **ClickHouse** at its core to provide a scalable, high-performance observability backend.

By leveraging ClickHouse's columnar storage and fast analytical capabilities, Langfuse can handle billions of traces and events with low latency, making it suitable for high-throughput production workloads.

## Why Langfuse?[​](#why-langfuse "Direct link to Why Langfuse?")

- **Open source:** Fully open source with public API for custom integrations
- **Production optimized:** Designed with minimal performance overhead
- **Best-in-class SDKs:** Native SDKs for Python and JavaScript
- **Framework support:** Integrated with popular frameworks like OpenAI SDK, LangChain, and LlamaIndex
- **Multi-modal:** Support for tracing text, images and other modalities
- **Full platform:** Suite of tools for the complete LLM application development lifecycle

## Deployment options[​](#deployment-options "Direct link to Deployment options")

Langfuse offers flexible deployment options to meet different security and infrastructure needs.

**[Langfuse Cloud](https://cloud.langfuse.com)** is a fully managed service powered by a managed ClickHouse cluster for optimal performance. It is SOC 2 Type II and ISO 27001 certified, GDPR compliant, and available in US (AWS us-west-2) and EU (AWS eu-west-1) data regions.

**[Self-hosted](https://langfuse.com/self-hosting)** Langfuse is fully open-source (MIT license) and free to deploy on your own infrastructure using Docker or Kubernetes. You run your own ClickHouse instance (or use ClickHouse Cloud) to store observability data, ensuring complete control over your data.

## Architecture[​](#architecture "Direct link to Architecture")

Langfuse only depends on open source components and can be deployed locally, on cloud infrastructure, or on-premises:

- **ClickHouse**: Stores high-volume observability data (traces, spans, generations, scores). It enables fast aggregation and analytics for dashboards.
- **Postgres**: Stores transactional data like user accounts, project configurations, and prompt definitions.
- **Redis**: Handles event queuing and caching.
- **S3/Blob Storage**: Stores large payloads and raw event data.

## Features[​](#features "Direct link to Features")

### Observability[​](#observability "Direct link to Observability")

[Observability](https://langfuse.com/docs/observability/overview) is essential for understanding and debugging LLM applications. Unlike traditional software, LLM applications involve complex, non-deterministic interactions that can be challenging to monitor and debug. Langfuse provides comprehensive tracing capabilities that help you understand exactly what's happening in your application.

*📹 Want to learn more? [**Watch end-to-end walkthrough**](https://langfuse.com/watch-demo?tab=observability) of Langfuse Observability and how to integrate it with your application.*

- Trace Details- Sessions- Timeline- Users- Agent Graphs- Dashboard

Traces allow you to track every LLM call and other relevant logic in your app.

[](https://static.langfuse.com/docs-videos/trace-new-ui.mp4)

Sessions allow you to track multi-step conversations or agentic workflows.

[](https://static.langfuse.com/docs-videos/sessions-new-ui.mp4)

Debug latency issues by inspecting the timeline view.

[](https://static.langfuse.com/docs-videos/timeline-new-ui.mp4)

Add your own `userId` to monitor costs and usage for each user. Optionally, create a deep link to this view in your systems.

[](https://static.langfuse.com/docs-videos/users-new-ui.mp4)

LLM agents can be visualized as a graph to illustrate the flow of complex agentic workflows.

[](https://static.langfuse.com/docs-videos/langgraph-new-ui.mp4)

See quality, cost, and latency metrics in the dashboard to monitor your LLM application.

[](https://static.langfuse.com/docs-videos/dashboard.mp4%20MOVED%20TO%20R2.mp4)

### Prompt management[​](#prompt-management "Direct link to Prompt management")

[Prompt Management](https://langfuse.com/docs/prompt-management/overview) is critical in building effective LLM applications. Langfuse provides tools to help you manage, version, and optimize your prompts throughout the development lifecycle.

*📹 Want to learn more? [**Watch end-to-end walkthrough**](https://langfuse.com/watch-demo?tab=prompt) of Langfuse Prompt Management and how to integrate it with your application.*

- Create- Version Control- Deploy- Metrics- Test in Playground- Link with Traces- Track Changes

Create a new prompt via UI, SDKs, or API.

[](https://static.langfuse.com/docs-videos/create-update-prompts.mp4%20MOVED%20TO%20R2.mp4)

Collaboratively version and edit prompts via UI, API, or SDKs.

[](https://static.langfuse.com/docs-videos/create-prompt-version.mp4%20MOVED%20TO%20R2.mp4)

Deploy prompts to production or any environment via labels - without any code changes.

[](https://static.langfuse.com/docs-videos/deploy-prompt.mp4)

Compare latency, cost, and evaluation metrics across different versions of your prompts.

[](https://static.langfuse.com/docs-videos/prompt-metrics.mp4)

Instantly test your prompts in the playground.

[](https://static.langfuse.com/docs-videos/prompt-to-playground.mp4)

Link prompts with traces to understand how they perform in the context of your LLM application.

[](https://static.langfuse.com/docs-videos/linked-generations.mp4)

Track changes to your prompts to understand how they evolve over time.

[](https://static.langfuse.com/docs-videos/track-changes.mp4)

### Evaluation & datasets[​](#evaluation "Direct link to Evaluation & datasets")

[Evaluation](https://langfuse.com/docs/evaluation/overview) is crucial for ensuring the quality and reliability of your LLM applications. Langfuse provides flexible evaluation tools that adapt to your specific needs, whether you're testing in development or monitoring production performance.

*📹 Want to learn more? [**Watch end-to-end walkthrough**](https://langfuse.com/watch-demo?tab=evaluation) of Langfuse Evaluation and how to use it to improve your LLM application.*

- Analytics- User Feedback- LLM-as-a-Judge- Experiments- Annotation Queue- Custom Evals

Plot evaluation results in the Langfuse Dashboard.

[](https://static.langfuse.com/docs-videos/scores-dashboard.mp4)

Collect feedback from your users. Can be captured in the frontend via our Browser SDK, server-side via the SDKs or API. Video includes example application.

[](https://static.langfuse.com/docs-videos/scores-user-feedback.mp4)

Run fully managed LLM-as-a-judge evaluations on production or development traces. Can be applied to any step within your application for step-wise evaluations.

[](https://static.langfuse.com/docs-videos/scores-llm-as-a-judge.mp4%20MOVED%20TO%20R2.mp4)

Evaluate prompts and models on datasets directly in the user interface. No custom code is needed.

[](https://static.langfuse.com/docs-videos/prompt-experiments.mp4)

Baseline your evaluation workflow with human annotations via Annotation Queues.

[](https://static.langfuse.com/docs-videos/scores-annotation-queue.mp4)

Add custom evaluation results; supports numeric, boolean, and categorical values.

```
POST /api/public/scores
```

Add scores via Python or JS SDK.

```
langfuse.score(
  trace_id="123",
  name="my_custom_evaluator",
  value=0.5,
)
```

## Quickstarts[​](#quickstarts "Direct link to Quickstarts")

Get up and running with Langfuse in minutes. Choose the path that best fits your current needs:

- [Integrate LLM Application/Agent Tracing](https://langfuse.com/docs/observability/get-started)
- [Integrate Prompt Management](https://langfuse.com/docs/prompt-management/get-started)
- [Setup Evaluations](https://langfuse.com/docs/evaluation/overview)

## Learn more[​](#learn-more "Direct link to Learn more")