langfuse/langfuse-python

🪢 Langfuse Python SDK

What it solves

Langfuse provides a way to monitor and evaluate LLM-powered applications. It helps developers track how their applications perform by capturing detailed traces of LLM interactions, managing prompts, and running experiments to test changes before they go live.

How it works

The SDK uses OpenTelemetry to record the execution of your code. You can instrument your application using decorators like @observe or context managers to create "spans" and "generations" that represent specific parts of your logic or LLM calls. This data is then sent to the Langfuse platform for analysis, evaluation, and prompt management.

Who it’s for

This tool is designed for developers building applications with Large Language Models who need visibility into their system's behavior, want to perform regression testing, or need to manage and version their prompts effectively.

Highlights

  • OpenTelemetry-based observability and tracing.
  • Built-in support for datasets and experiments to test prompt or model changes.
  • Tools for LLM-as-a-judge and custom evaluation scoring.
  • Centralized prompt management.
  • Full REST API client for interacting with the Langfuse platform.

Related

  • Project
  • Project
  • Project
  • Project
  • Project