← Back to all projects

Langfuse

Tracing, prompt management and evaluation for LLM applications

OfficialMIT
Stars
33.2k
Forks
3.6k
Open issues
781
Last commit
15 Aug 2026

Overview

Records what an agent actually did — every call, tool invocation and cost — and turns those traces into evaluation datasets. The managed service runs the same codebase you can self-host with Docker Compose, so migrating in either direction stays cheap. Some enterprise features sit outside the MIT core; check which tier you need before committing.

What can you do with Langfuse?

  • Instrument an app function by functionImporting from langfuse.openai import openai captures each OpenAI call with its model parameters, and every function you wrap in @observe() is recorded as its own nested step — the README's main() and story() pair — so retrieval and agent code appears in the trace only once it is decorated too.
  • Version prompts outside your codePrompt Management holds prompts centrally with version control, and caching on both server and client means fetching the current version adds no latency to your application.
  • Turn traces into test setsDatasets build benchmarks for pre-deployment testing, scored with LLM-as-a-judge, code evaluators, manual labelling or collected user feedback.
  • Retry failures in the playgroundFrom a bad result in a trace you can jump straight into the LLM Playground and re-run it against a different prompt or model configuration.
  • Self-host on your own infrastructuredocker compose up for a local instance, a Helm chart as the preferred production path on Kubernetes, and Terraform templates for AWS, Azure and GCP.

Documentation

Reproduced from the langfuse/langfuse README, published under MIT. Read the original ↗

Langfuse is an open source LLM engineering platform. It helps teams collaboratively develop, monitor, evaluate, and debug AI applications. Langfuse can be self-hosted in minutes and is battle-tested. Proudly made with ClickHouse open source database.

🧑‍💻 We’re hiring

Langfuse is growing fast (we doubled the team in the last 6 months) - since January 2026 we’re part of ClickHouse, we’re hiring engineering hybrid across the EU. We hire engineers who love open source and great developer experiences. See open roles →

✨ Core Features

  • LLM Application Observability: Instrument your app and start ingesting traces to Langfuse, thereby tracking LLM calls and other relevant logic in your app such as retrieval, embedding, or agent actions. Inspect and debug complex logs and user sessions. Try the interactive demo to see this in action.

  • Prompt Management helps you centrally manage, version control, and collaboratively iterate on your prompts. Thanks to strong caching on server and client side, you can iterate on prompts without adding latency to your application.

  • Evaluations are key to the LLM application development workflow, and Langfuse adapts to your needs. It supports LLM-as-a-judge, Code evaluators, user feedback collection, manual labeling, and custom evaluation pipelines via APIs/SDKs.

  • Datasets enable test sets and benchmarks for evaluating your LLM application. They support continuous improvement, pre-deployment testing, structured experiments, flexible evaluation, and seamless integration with frameworks like LangChain and LlamaIndex.

  • LLM Playground is a tool for testing and iterating on your prompts and model configurations, shortening the feedback loop and accelerating development. When you see a bad result in tracing, you can directly jump to the playground to iterate on it.

  • Comprehensive API: Langfuse is frequently used to power bespoke LLMOps workflows while using the building blocks provided by Langfuse via the API. OpenAPI spec, Postman collection, and typed SDKs for Python, JS/TS are available.

📦 Deploy Langfuse

Langfuse Cloud

Managed deployment by the Langfuse team, generous free-tier, no credit card required.

Self-Host Langfuse

Run Langfuse on your own infrastructure:

  • Local (docker compose): Run Langfuse on your own machine in 5 minutes using Docker Compose.

    # Get a copy of the latest Langfuse repository
    git clone --depth=1 https://github.com/langfuse/langfuse.git
    cd langfuse
    
    # Run the langfuse docker compose
    docker compose up
  • VM: Run Langfuse on a single Virtual Machine using Docker Compose.

  • Kubernetes (Helm): Run Langfuse on a Kubernetes cluster using Helm. This is the preferred production deployment.

  • Terraform Templates: AWS, Azure, GCP

See self-hosting documentation to learn more about architecture and configuration options.

[!TIP] Self-hosting Langfuse? Subscribe to the self-hosting update list to get an email about important features and new releases for open source Langfuse — self-hosting updates only, no marketing.

🔌 Integrations

Main Integrations:

IntegrationSupportsDescription
SDKPython, JS/TSManual instrumentation using the SDKs for full flexibility.
OpenAIPython, JS/TSAutomated instrumentation using drop-in replacement of OpenAI SDK.
LangchainPython, JS/TSAutomated instrumentation by passing callback handler to Langchain application.
LlamaIndexPythonAutomated instrumentation via LlamaIndex callback system.
HaystackPythonAutomated instrumentation via Haystack content tracing system.
LiteLLMPython, JS/TS (proxy only)Use any LLM as a drop in replacement for GPT. Use Azure, OpenAI, Cohere, Anthropic, Ollama, VLLM, Sagemaker, HuggingFace, Replicate (100+ LLMs).
Vercel AI SDKJS/TSTypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js.
MastraJS/TSOpen source framework for building AI agents and multi-agent systems.
APIDirectly call the public API. OpenAPI spec available.

Packages integrated with Langfuse:

NameTypeDescription
InstructorLibraryLibrary to get structured LLM outputs (JSON, Pydantic)
DSPyLibraryFramework that systematically optimizes language model prompts and weights
MirascopeLibraryPython toolkit for building LLM applications.
OllamaModel (local)Easily run open source LLMs on your own machine.
Amazon BedrockModelRun foundation and fine-tuned models on AWS.
AutoGenAgent FrameworkOpen source LLM platform for building distributed agents.
FlowiseChat/Agent UIJS/TS no-code builder for customized LLM flows.
LangflowChat/Agent UIPython-based UI for LangChain, designed with react-flow to provide an effortless way to experiment and prototype flows.
DifyChat/Agent UIOpen source LLM app development platform with no-code builder.
OpenWebUIChat/Agent UISelf-hosted LLM Chat web ui supporting various LLM runners including self-hosted and local models.
PromptfooToolOpen source LLM testing platform.
LobeChatChat/Agent UIOpen source chatbot platform.
VapiPlatformOpen source voice AI platform.
InferableAgentsOpen source LLM platform for building distributed agents.
GradioChat/Agent UIOpen source Python library to build web interfaces like Chat UI.
GooseAgentsOpen source LLM platform for building distributed agents.
smolagentsAgentsOpen source AI agents framework.
CrewAIAgentsMulti agent framework for agent collaboration and tool use.

🚀 Quickstart

Instrument your app and start ingesting traces to Langfuse, thereby tracking LLM calls and other relevant logic in your app such as retrieval, embedding, or agent actions. Inspect and debug complex logs and user sessions.

1️⃣ Create new project

  1. Create Langfuse account or self-host
  2. Create a new project
  3. Create new API credentials in the project settings

2️⃣ Log your first LLM call

The @observe() decorator makes it easy to trace any Python LLM application. In this quickstart we also use the Langfuse OpenAI integration to automatically capture all model parameters.

[!TIP] Not using OpenAI? Visit our documentation to learn how to log other models and frameworks.

pip install langfuse openai
LANGFUSE_SECRET_KEY="sk-lf-..."
LANGFUSE_PUBLIC_KEY="pk-lf-..."
LANGFUSE_BASE_URL="https://cloud.langfuse.com" # 🇪🇺 EU region
# LANGFUSE_BASE_URL="https://us.cloud.langfuse.com" # 🇺🇸 US region
from langfuse import observe
from langfuse.openai import openai # OpenAI integration

@observe()
def story():
    return openai.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": "What is Langfuse?"}],
    ).choices[0].message.content

@observe()
def main():
    return story()

main()

3️⃣ See traces in Langfuse

See your language model calls and other application logic in Langfuse.

Public example trace in Langfuse

💭 Support

Finding an answer to your question:

  • Our documentation is the best place to start looking for answers. It is comprehensive, and we invest significant time into maintaining it. You can also suggest edits to the docs via GitHub.
  • Langfuse FAQs where the most common questions are answered.
  • Use “Ask AI” to get instant answers to your questions.

Support Channels:

  • Ask any question in our public Q&A on GitHub Discussions. Please include as much detail as possible (e.g. code snippets, screenshots, background information) to help us understand your question.
  • Request a feature on GitHub Discussions.
  • Report a Bug on GitHub Issues.
  • For time-sensitive queries, ping us via the in-app chat widget.

🤝 Contributing

Your contributions are welcome!

  • Vote on Ideas in GitHub Discussions.
  • Raise and comment on Issues.
  • Open a PR - see CONTRIBUTING.md for details on how to setup a development environment.

🥇 License

This repository is MIT licensed, except for the ee folders. See LICENSE and docs for more details.

Dependencies

We deploy this code base in Docker containers based on the Linux Alpine Image (source). You may find the Dockerfiles in web/Dockerfile and worker/Dockerfile.

⭐️ Star History