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.
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).
- Current SDK (v4): https://langfuse.com/docs/observability/sdk/overview
- Upgrade from this major: https://langfuse.com/docs/observability/sdk/upgrade-path/python-v2-to-v3
- Machine-readable docs index (for AI agents): https://langfuse.com/llms.txt
- REST API reference (Observations API v2, Metrics API v2, Scores API v3): https://api.reference.langfuse.com
- Data freshness and real-time ingestion: https://langfuse.com/docs/compatibility#faq-delay
Integrations (legacy)
