langfuse/langfuse-python

🪢 Langfuse Python SDK

What it solves

It provides a unified interface for developers to monitor, evaluate, and manage their LLM applications. It solves the problem of "black box" LLM calls by providing observability (tracing), prompt management, and evaluation tools to ensure quality and prevent regressions during model or prompt updates.

How it works

The SDK uses an OpenTelemetry-based approach to capture traces, spans, and generations. Developers can instrument their code using context managers (like start_as_current_observation) or decorators to track the flow of data and LLM responses. It also provides a REST API client to manage prompts, datasets, and scores for offline evaluation and regression testing.

Who it’s for

Developers building LLM-powered applications who need to track performance, debug traces, and perform systematic evaluation of prompt and model changes.

Highlights

  • Observability and Tracing: OpenTelemetry-based tracing with built-in integrations for OpenAI and LangChain.
  • Prompt Management: Tools to manage and version prompts outside of the code.
  • Datasets and Experiments: Support for offline evaluation and regression testing, including CI integration via GitHub Actions.
  • Evaluation: Support for LLM-as-a-judge and custom scoring systems to measure output quality.

Related

  • Project
  • Project
  • Project
  • Project
  • Project