langfuse-python icon indicating copy to clipboard operation
langfuse-python copied to clipboard

🪢 Langfuse Python SDK - Instrument your LLM app with decorators or low-level SDK and get detailed tracing/observability. Works with any LLM or framework

GitHub Banner

Langfuse Python SDK

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

Installation

[!IMPORTANT] The SDK was rewritten in v2 and released on December 17, 2023. Refer to the v2 migration guide for instructions on updating your code.

pip install langfuse

Docs

  • Decorators: https://langfuse.com/docs/sdk/python/decorators
  • Low-level SDK: https://langfuse.com/docs/sdk/python/low-level-sdk
  • Langchain integration: https://langfuse.com/docs/integrations/langchain/tracing

Interfaces

Interfaces:

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

Integrations