← All sessions, cheat sheets & labs
Week 5 · Field guide · Observability

Langfuse

The open-source default for LLM observability: full tracing, prompt versioning, and evals, on infrastructure you own.

tracing + evalsopen source (MIT)self-hostable

What it is

Open-source tracing, prompts, and evals.

Langfuse is the open-source observability leader, with 28,000+ GitHub stars and an MIT licence. It gives you full tracing so you can see every request, prompt management and versioning with a built-in playground, and evaluation via LLM-as-judge, user feedback, or custom metrics, with multi-turn support. You can self-host it freely, so nothing about your traces or prompts leaves infrastructure you control.

The one job

See, version, and evaluate, on your own infrastructure.

See every request as a trace, version your prompts over time, and run evals against them, all in one place you own. No vendor holds your data hostage.

Reach for it when

Skip it when

A minimal look

Wrap the call in a trace.

import { Langfuse } from "langfuse";
import OpenAI from "openai";

const lf = new Langfuse();          // points at your self-hosted host
const openai = new OpenAI();
const trace = lf.trace({ name: "answer" });

const gen = trace.generation({ name: "chat", model: "gpt-4o" });
const res = await openai.chat.completions.create({
  model: "gpt-4o", messages,
});
gen.end({ output: res.choices[0].message });  // span is now in Langfuse

The principle it teaches

Course principle

You cannot operate what you cannot see (Session 10). Langfuse is the open-source default for that visibility: traces, prompt versions, and evals on infrastructure you own, so nothing about how your system behaves is a black box.

Where it fits your labs

This is a Week 5 tool. When you instrument your agent for tracing and wire up graders in Lab 5, Langfuse is where the traces land and where your evals run.

Use in
Week 5 tracing and evals, and Lab 5 where you grade agent runs.
week 5
Pairs with
OpenTelemetry, since Langfuse is OTel-compatible and can ingest OTel-shaped spans.