Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Langfuse is an open-source LLM observability platform that provides tracing, evaluation, prompt management, and cost tracking for production LLM applications. With over 24,000 GitHub stars and MIT licensing, it has become the leading open-source alternative for monitoring and debugging AI applications in production.
| Repository | github.com/langfuse/langfuse |
| License | MIT |
| Language | TypeScript, Python |
| Stars | 24K+ |
| Category | LLM Observability |
Langfuse V4 (March 2026) employs an observations-first, immutable data model aligned with OpenTelemetry spans:
The V4 architecture shifted to an observations-first model where traces are correlation IDs (like session_id) rather than top-level entities, with immutable spans ingested via OTel protocols.
Langfuse captures the full request lifecycle with rich detail:
Langfuse supports multiple evaluation approaches:
Langfuse provides native integrations with the major LLM frameworks:
from langfuse import Langfuse from langfuse.decorators import observe, langfuse_context from openai import OpenAI langfuse = Langfuse( public_key="pk-lf-...", secret_key="sk-lf-...", host="https://cloud.langfuse.com" # or self-hosted URL ) client = OpenAI() @observe() def retrieve_context(query: str) -> str: """Retrieve relevant context for the query.""" # Your retrieval logic here langfuse_context.update_current_observation( metadata={"retriever": "hybrid", "top_k": 5} ) return "Retrieved context about the topic..." @observe() def generate_answer(query: str) -> str: """Full RAG pipeline with automatic tracing.""" context = retrieve_context(query) response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": f"Context: {context}"}, {"role": "user", "content": query} ] ) # Score the trace langfuse_context.score_current_trace( name="relevance", value=0.9, comment="High relevance to query" ) return response.choices[0].message.content answer = generate_answer("How does RAG work?") print(answer) langfuse.flush() # Ensure all events are sent