AI/TLDR

Pydantic Logfire

Observability for Python apps and LLM calls, built on OpenTelemetry by the Pydantic team

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.

bashbash
pip install logfire

Authenticate

Run the auth command to connect the SDK to your Logfire account.

bashbash
logfire auth

Add manual tracing

Call configure() once, then log messages and wrap work in spans.

pythonpython
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.

pythonpython
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.

ToolStarsWhat it does
Langfuse★ 29.4kA self-hostable platform for tracing LLM and agent calls, managing prompts, and running evaluations to debug and improve AI applications.
Opik★ 19.7kAn open-source platform from Comet for tracing, evaluating, and monitoring LLM applications, RAG systems, and agent workflows with dashboards and LLM-as-judge metrics.
TensorZero★ 11.7kAn 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.
Evidently★ 7.6kA monitoring and evaluation framework for ML and LLM systems that tracks output quality, drift, and test results over time with reports and dashboards.
OpenLLMetry★ 7.2kAn OpenTelemetry-based SDK that auto-instruments LLM providers, vector databases, and frameworks so traces flow into any existing observability backend.
Helicone★ 5.8kA proxy-based observability platform that logs, monitors, and evaluates LLM API calls by routing requests through its endpoint with one line of code.
AgentOps★ 5.6kAn SDK for monitoring AI agents that tracks LLM cost, session replays, and performance across frameworks like CrewAI, LangChain, and the OpenAI Agents SDK.
Pydantic Logfire★ 4.3kObservability for Python apps and LLM calls, built on OpenTelemetry by the Pydantic team