What is Langfuse? Langfuse (GitHub) is an open-source platform for LLM engineering. It provides tracing and monitoring capabilities for AI agents, helping developers debug, analyze, and optimize their products. Langfuse integrates with various tools and frameworks via native integrations, OpenTelemetry, and SDKs.
openai
library to interact with OpenAI’s API and traceloop-sdk
for enabling OpenLLMetry instrumentation.
traceloop-sdk
. It is advisable to use disable_batch=True
if you are executing this code in a notebook, as traces are sent immediately without waiting for batching. Once initialized, any action performed using the OpenAI SDK (such as a chat completion request) will be automatically traced and forwarded to Langfuse.