Skip to content

About

🪢 Langfuse Python SDK (v4, OpenTelemetry). Tracing: get_client() / start_as_current_observation — not the legacy Langfuse().trace() client.

Topics

Resources

Contributing

Stars

498 stars

Watchers

6 watching

Forks

Repository files navigation

GitHub Banner

Langfuse Python SDK (legacy v2)

MIT License CI test status PyPI Version GitHub Repo stars Discord YC W23

Important

langfuse v2 is not the latest Langfuse Python SDK. This branch publishes the deprecated v2 client (Langfuse(), trace(), span(), generation(), api.trace.list). Unpinned pip install langfuse installs the current v4. Do not use v2 for new instrumentation.

Latest Python SDK (OpenTelemetry), developed on main: pip install langfuse. Use get_client() + start_as_current_observation / @observe. Docs: https://langfuse.com/docs/observability/sdk/overview. Upgrade: v2 to v3, v3 to v4.

Query traces with Observations API v2 (GET /api/public/v2/observations, API reference), not GET /api/public/traces / api.trace.list.

Data freshness: the only real-time path is OpenTelemetry ingestion (langfuse >= 4.7.0, or any OTel exporter sending x-langfuse-ingestion-version: 4) combined with the Observations API v2 and Metrics API v2. All other GET APIs from all SDK versions can be up to 10 minutes behind.

Installation

This branch is the legacy v2 SDK, in maintenance mode with critical bug fixes only. For new work, install the current v4 (pip install langfuse).

Docs

Legacy v2 interfaces (do not use for new work)

  • @observe() decorator (docs)
  • Low-level tracing SDK (docs)
  • Wrapper of Langfuse public API

Integrations (legacy)

About

🪢 Langfuse Python SDK (v4, OpenTelemetry). Tracing: get_client() / start_as_current_observation — not the legacy Langfuse().trace() client.

Topics

Resources

Contributing

Stars

498 stars

Watchers

6 watching

Forks

Releases

Used by

Contributors

Languages