langfuse

Instrument LLM applications with tracing, prompt management, and evaluation using Langfuse.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/bilacchi/agents-skills --skill langfuse-bilacchi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: langfuse
Source: https://github.com/bilacchi/agents-skills/tree/main/skills/langfuse
Command: npx skills add https://github.com/bilacchi/agents-skills --skill langfuse-bilacchi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires langfuse, openai, langchain-openai, langchain-core.

What problem does it solve? LLM applications in production lack visibility into cost, latency, and output quality, making debugging and prompt iteration guesswork. This Skill instruments your LLM calls with Langfuse so every trace, generation, and score is captured and analyzable. ## Core Features & Use Cases - LLM Tracing & Observability: Capture traces, spans, and generations with user IDs, sessions, tags, and token usage via the Python/JS SDKs, the OpenAI drop-in wrapper, or the LangChain callback handler. - Prompt Management: Version prompts, assign labels like production or staging, and link generations to specific prompt versions for regression tracking. - Evaluation & Datasets: Score traces manually or with LLM-as-judge, build evaluation datasets, and run systematic quality comparisons. - Use Case: A support chatbot team traces every conversation, scores response quality with an LLM judge, compares two prompt versions on a labeled dataset, and ships the winner to production. ## Quick Start Ask the AI to add Langfuse tracing to your OpenAI or LangChain application with session tracking and quality scoring.

Frequently Asked Questions about langfuse

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Langfuse tracing to an OpenAI application?▼

Import openai from langfuse.openai instead of the standard SDK and use it as a drop-in replacement. All chat completions are automatically traced, and you can pass name, session_id, user_id, tags, and metadata as extra parameters.

How to trace LangChain chains and agents with Langfuse?▼

Create a Langfuse CallbackHandler with your keys and pass it via config={"callbacks": [handler]} when invoking chains, agents, or retrievers. Every LLM call and tool use becomes a nested span in the trace.

Does Langfuse support self-hosted deployment?▼

Yes, Langfuse offers both a managed cloud and a self-hosted option. Self-hosting requires your own infrastructure, and you point the SDK to your instance by setting the host parameter instead of the cloud URL.

How do I evaluate LLM outputs with Langfuse?▼

Attach scores to traces manually, or use an LLM-as-judge pattern where a cheaper model rates responses. You can also create datasets with expected outputs, run evaluations per item, and link traces to dataset runs for comparison.

Why are my Langfuse traces missing in serverless functions?▼

Traces go missing when the process exits before data is sent. Call langfuse.flush() before the function returns to force delivery of queued events, which is essential in serverless and short-lived environments.