close
Skip to content
langfusePublic

Latest commit

 

History

9,996 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hero-b (1)

MIT License Y Combinator W23 Docker Pulls langfuse Python package on PyPi langfuse npm package
chat on Discord follow on X(Twitter) follow on LinkedIn Commits last month Issues closed Discussion posts

README in English 简体中文版自述文件 日本語のREADME README in Korean

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

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

deploy

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.

Docker log rotation

The default docker-compose.yml inherits the Docker daemon's logging configuration. Docker's default json-file driver does not rotate logs unless configured, which can exhaust disk space. Set its max-size and max-file options, or keep your chosen logging backend and configure retention there. Do not rotate or truncate Docker-managed JSON log files with external tools.

After changing daemon logging defaults, restart Docker and recreate existing containers to apply them; restarting containers alone is insufficient. Plan for interruption and preserve data volumes. These settings cover container stdout/stderr, not database data volumes or ClickHouse's internal log files.

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

integrations

Main Integrations:

Integration Supports Description
SDK Python, JS/TS Manual instrumentation using the SDKs for full flexibility.
OpenAI Python, JS/TS Automated instrumentation using drop-in replacement of OpenAI SDK.
Langchain Python, JS/TS Automated instrumentation by passing callback handler to Langchain application.
LlamaIndex Python Automated instrumentation via LlamaIndex callback system.
Haystack Python Automated instrumentation via Haystack content tracing system.
LiteLLM Python, 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 SDK JS/TS TypeScript toolkit designed to help developers build AI-powered applications with React, Next.js, Vue, Svelte, Node.js.
Mastra JS/TS Open source framework for building AI agents and multi-agent systems.
API Directly call the public API. OpenAPI spec available.

Packages integrated with Langfuse:

Name Type Description
Instructor Library Library to get structured LLM outputs (JSON, Pydantic)
DSPy Library Framework that systematically optimizes language model prompts and weights
Mirascope Library Python toolkit for building LLM applications.
Ollama Model (local) Easily run open source LLMs on your own machine.
Amazon Bedrock Model Run foundation and fine-tuned models on AWS.
AutoGen Agent Framework Open source LLM platform for building distributed agents.
Flowise Chat/Agent UI JS/TS no-code builder for customized LLM flows.
Langflow Chat/Agent UI Python-based UI for LangChain, designed with react-flow to provide an effortless way to experiment and prototype flows.
Dify Chat/Agent UI Open source LLM app development platform with no-code builder.
OpenWebUI Chat/Agent UI Self-hosted LLM Chat web ui supporting various LLM runners including self-hosted and local models.
Promptfoo Tool Open source LLM testing platform.
LobeChat Chat/Agent UI Open source chatbot platform.
Vapi Platform Open source voice AI platform.
Inferable Agents Open source LLM platform for building distributed agents.
Gradio Chat/Agent UI Open source Python library to build web interfaces like Chat UI.
Goose Agents Open source LLM platform for building distributed agents.
smolagents Agents Open source AI agents framework.
CrewAI Agents Multi 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.

example-trace-for-github

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

Star History Chart

❤️ Open Source Projects Using Langfuse

Top open-source Python projects that use Langfuse, ranked by stars (Source):

Repository Stars
BERJAYA   langflow-ai / langflow 116251
BERJAYA   open-webui / open-webui 109642
BERJAYA   abi / screenshot-to-code 70877
BERJAYA   lobehub / lobe-chat 65454
BERJAYA   infiniflow / ragflow 64118
BERJAYA   firecrawl / firecrawl 56713
BERJAYA   run-llama / llama_index 44203
BERJAYA   FlowiseAI / Flowise 43547
BERJAYA   QuivrHQ / quivr 38415
BERJAYA   microsoft / ai-agents-for-beginners 38012
BERJAYA   chatchat-space / Langchain-Chatchat 36071
BERJAYA   mindsdb / mindsdb 35669
BERJAYA   danny-avila / LibreChat 33142
BERJAYA   BerriAI / litellm 28726
BERJAYA   onlook-dev / onlook 22447
BERJAYA   NixOS / nixpkgs 21748
BERJAYA   kortix-ai / suna 17976
BERJAYA   anthropics / courses 17057
BERJAYA   mastra-ai / mastra 16484
BERJAYA   langfuse / langfuse 16054
BERJAYA   Canner / WrenAI 11868
BERJAYA   promptfoo / promptfoo 8350
BERJAYA   The-Pocket / PocketFlow 8313
BERJAYA   OpenPipe / ART 7093
BERJAYA   topoteretes / cognee 7011
BERJAYA   awslabs / agent-squad 6785
BERJAYA   BasedHardware / omi 6231
BERJAYA   hatchet-dev / hatchet 6019
BERJAYA   zenml-io / zenml 4873
BERJAYA   refly-ai / refly 4654
BERJAYA   coleam00 / ottomator-agents 4165
BERJAYA   JoshuaC215 / agent-service-toolkit 3557
BERJAYA   colanode / colanode 3517
BERJAYA   VoltAgent / voltagent 3210
BERJAYA   bragai / bRAG-langchain 3010
BERJAYA   pingcap / autoflow 2651
BERJAYA   sourcebot-dev / sourcebot 2570
BERJAYA   open-webui / pipelines 2055
BERJAYA   YFGaia / dify-plus 1734
BERJAYA   TheSpaghettiDetective / obico-server 1687
BERJAYA   MLSysOps / MLE-agent 1387
BERJAYA   TIGER-AI-Lab / TheoremExplainAgent 1385
BERJAYA   trailofbits / buttercup 1223
BERJAYA   wassim249 / fastapi-langgraph-agent-production-ready-template 1200
BERJAYA   alishobeiri / thread 1098
BERJAYA   dmayboroda / minima 1010
BERJAYA   zstar1003 / ragflow-plus 993
BERJAYA   openops-cloud / openops 939
BERJAYA   dynamiq-ai / dynamiq 927
BERJAYA   xataio / agent 857
BERJAYA   plastic-labs / tutor-gpt 845
BERJAYA   trendy-design / llmchat 829
BERJAYA   hotovo / aider-desk 781
BERJAYA   opslane / opslane 719
BERJAYA   wrtnlabs / autoview 688
BERJAYA   andysingal / llm-course 643
BERJAYA   theopenconversationkit / tock 587
BERJAYA   sentient-engineering / agent-q 487
BERJAYA   NicholasGoh / fastapi-mcp-langgraph-template 481
BERJAYA   i-am-alice / 3rd-devs 472
BERJAYA   AIDotNet / koala-ai 470
BERJAYA   phospho-app / text-analytics-legacy 439
BERJAYA   inferablehq / inferable 403
BERJAYA   duoyang666 / ai_novel 397
BERJAYA   strands-agents / samples 385
BERJAYA   FranciscoMoretti / sparka 380
BERJAYA   RobotecAI / rai 373
BERJAYA   ElectricCodeGuy / SupabaseAuthWithSSR 370
BERJAYA   souzatharsis / tamingLLMs 323
BERJAYA   aws-samples / aws-ai-ml-workshop-kr 295
BERJAYA   weizxfree / KnowFlow 285
BERJAYA   zenml-io / zenml-projects 276
BERJAYA   wxai-space / LightAgent 275
BERJAYA   Ozamatash / deep-research-mcp 269
BERJAYA   sql-agi / DB-GPT 241
BERJAYA   guyernest / advanced-rag 238
BERJAYA   bklieger-groq / mathtutor-on-groq 233
BERJAYA   plastic-labs / honcho 224
BERJAYA   OVINC-CN / OpenWebUI 202
BERJAYA   zhutoutoutousan / worldquant-miner 202
BERJAYA   iceener / ai 186
BERJAYA   giselles-ai / giselle 181
BERJAYA   ai-shifu / ai-shifu 181
BERJAYA   aws-samples / sample-serverless-mcp-servers 175
BERJAYA   celerforge / freenote 171
BERJAYA   babelcloud / LLM-RGB 164
BERJAYA   8090-inc / xrx-sample-apps 163
BERJAYA   deepset-ai / haystack-core-integrations 163
BERJAYA   codecentric / c4-genai-suite 152
BERJAYA   XSpoonAi / spoon-core 150
BERJAYA   chatchat-space / LangGraph-Chatchat 144
BERJAYA   langfuse / langfuse-docs 139
BERJAYA   piyushgarg-dev / genai-cohort 135
BERJAYA   i-dot-ai / redbox 132
BERJAYA   bmd1905 / ChatOpsLLM 127
BERJAYA   Fintech-Dreamer / FinSynth 121
BERJAYA   kenshiro-o / nagato-ai 119

🔒 Security & Privacy

We take data security and privacy seriously. Please refer to our Security and Privacy page for more information.

Telemetry

By default, Langfuse automatically reports basic usage statistics of self-hosted instances to a centralized server (PostHog).

This helps us to:

  1. Understand how Langfuse is used and improve the most relevant features.
  2. Track overall usage for internal and external (e.g. fundraising) reporting.

The telemetry does not include raw traces, prompts, observations, scores, or dataset contents. We document the exact fields that are collected, where they are sent, and the implementation reference in our telemetry docs.

For Langfuse OSS, you can opt out by setting TELEMETRY_ENABLED=false.

BERJAYA

Releases

Packages

Used by

Contributors

Languages