Overview
Pydantic Logfire is an observability platform from the team behind Pydantic Validation. Its open-source SDK instruments your Python application and sends traces, metrics, and logs to a dashboard where you can see how your code runs, including the LLM calls, agent runs, and tool invocations in an AI app.
It is built as an opinionated wrapper around OpenTelemetry, so it works with existing OTel tooling and instrumentation for many common Python packages. You query the collected data using standard SQL, which means BI tools and ordinary database libraries can read it too.
It fits the LLM observability category by giving developers a single place to inspect request latency, token use, and the flow of data through Pydantic models, while staying useful for general Python services like FastAPI apps and database queries.
What it does
- Built on OpenTelemetry with full support for traces, metrics, and logs, so you can reuse existing OTel instrumentation
- Query your telemetry with standard SQL, usable from BI tools and database libraries
- Manual tracing API with spans and structured log calls (logfire.info, logfire.span, logfire.debug)
- One-line integrations for popular packages, including instrument_fastapi for FastAPI apps
- Pydantic integration that shows the data flowing through your validation models plus built-in validation analytics
- Open-source SDKs for Python, TypeScript, and Rust that can export to any OTel-compatible backend
Getting started
Install the SDK, authenticate the CLI, then add either manual tracing or a one-line integration to your app.
Install the SDK
Install the logfire package from PyPI.
pip install logfireAuthenticate
Run the auth command to connect the SDK to your Logfire account.
logfire authAdd manual tracing
Call configure() once, then log messages and wrap work in spans.
import logfire
logfire.configure()
logfire.info('Hello, {name}!', name='world')
with logfire.span('Asking the user their {question}', question='age'):
user_input = input('How old are you? ')Or integrate a framework
Skip manual calls and instrument a supported package, such as FastAPI, with one line.
from fastapi import FastAPI
import logfire
app = FastAPI()
logfire.configure()
logfire.instrument_fastapi(app)Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Trace LLM calls and agent runs in a Python AI app to inspect latency, token use, and tool invocations
- Instrument a FastAPI service to see request spans, database queries, and errors in one dashboard
- Debug Pydantic models by watching the data that flows through them and reviewing validation analytics
- Send OpenTelemetry traces, metrics, and logs to Logfire or any OTel-compatible backend and query them with SQL
How Pydantic Logfire compares
Pydantic Logfire alongside other open-source observability & llmops tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Langfuse | ★ 36.2k | A self-hostable platform for tracing LLM and agent calls, managing prompts, and running evaluations to debug and improve AI applications. |
| Opik | ★ 22.8k | An open-source platform from Comet for tracing, evaluating, and monitoring LLM applications, RAG systems, and agent workflows with dashboards and LLM-as-judge metrics. |
| RagaAI Catalyst | ★ 16.2k | Python SDK that combines agentic tracing, metric evaluation, dataset and prompt management, guardrails and red-teaming for LLM and multi-agent applications. |
| TensorZero | ★ 11.7k | An open-source LLMOps platform that puts a single gateway in front of every major LLM provider and adds observability, evaluation, optimization, and A/B testing. |
| CodeBurn | ★ 11.6k | Reads the session files 41 AI coding tools already write to disk and breaks token spend down by model, project and task — no API keys or proxy — then flags waste and correlates spend with git commits. |
| Evidently | ★ 8k | A monitoring and evaluation framework for ML and LLM systems that tracks output quality, drift, and test results over time with reports and dashboards. |
| Star Office UI | ★ 7.5k | A self-hosted pixel-art office that shows an AI agent's live work state, with a character moving between desk, sofa and bug corner as it writes, idles or hits errors; built for OpenClaw but drivable by any HTTP client. |
| Pydantic Logfire | ★ 4.5k | Observability for Python apps and LLM calls, built on OpenTelemetry by the Pydantic team |
