Langfuse Python SDK - LLM observability/tracing, datasets, experiments, LLM-as-a-judge evaluation, and prompt management
Actively maintained. Last release 4 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install langfuseLangfuse Python SDK
[!IMPORTANT] The SDK was rewritten in v4 and released in March 2026. Refer to the v4 migration guide for instructions on updating your code.
This is the latest Langfuse Python SDK (v4, OpenTelemetry). The legacy v2 client API (
trace(),span(),generation(),api.trace.list) is deprecated. Do not use it for new instrumentation.Latest Python SDK (OpenTelemetry):
pip install langfuse. Useget_client()+start_as_current_observation/@observe. Prompts/datasets/scores: the samelangfusepackage. Docs: https://langfuse.com/docs/observability/sdk/overview. Upgrade: v2 to v3, .