← Back to Leaderboard
Lpydantic

pydantic/logfire-js

OpenTelemetry SDK for JavaScript observability and agent evaluation

AI FrameworkQuickstart ↓
Engineering Health (Methodology)
A+ · 90/100
Maintenance Activity
● Updated yesterday
Latest Release
@pydantic/logfire-browser@0.42.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption15/25
Release Cadence20/20
License Clarity20/20
API
Total Stars
★ 72
24h Growth
+0
7d Growth
+0
Forks
19

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

pydantic/logfire-js Star History (2025-03-23 - 2026-12-04) ALL-TIME STAR HISTORY (2025-03 – 2026-12) +71 in 621d · avg +0/day 76 38 0 2025-03-23: ★ 12025-05-03: ★ 262025-06-14: ★ 352025-07-26: ★ 402025-09-06: ★ 462025-10-18: ★ 522025-11-29: ★ 522026-01-10: ★ 562026-02-21: ★ 582026-04-04: ★ 602026-05-16: ★ 672026-06-27: ★ 682026-08-08: ★ 702026-09-19: ★ 712026-10-31: ★ 722026-12-04: ★ 72 ★ 72 2025-03 2026-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Logfire JS is a TypeScript SDK, not an agent runtime. Its pnpm workspace separates the shared logfire API from runtime-specific integration packages. @pydantic/logfire-node provides configure() for Node.js, @pydantic/logfire-cf-workers wraps a Worker handler with instrument(), and @pydantic/logfire-browser is released separately. OpenTelemetry is the protocol boundary for traces, metrics, and logs; Vercel and Deno can use their existing exporters.

Evaluation lives at logfire/evals. Dataset.evaluate() runs a task for each Case, applies case-specific evaluators before shared ones, then runs report evaluators once all cases complete. The resulting EvaluationReport contains results, failures, aggregates, and analyses. Online evaluation takes a different path: withOnlineEvaluation() wraps an async task and evaluates sampled calls in the background, emitting results as OpenTelemetry log events and optionally sending them to in-process sinks.

Key Capabilities & Differentiators

The SDK combines telemetry with code-first assessment of application functions, including LLM and agent tasks. Cases can be authored in TypeScript or loaded from YAML/JSON using the serialized dataset format shared with Python pydantic-evals. Built-in checks cover expected outputs, containment, runtime types, duration, and span matching through SpanQuery. LLMJudge accepts a callback per evaluator or a default registered through setDefaultJudge(); it does not bundle a client or prescribe a provider or model family.

Custom evaluators can return booleans, numeric scores, labels, explained scalar values, or multiple named results. An exception is recorded against its case rather than stopping the experiment. Report evaluators add confusion matrices, precision-recall analysis, ROC AUC, and Kolmogorov–Smirnov analysis to report.analyses; when Logfire is configured, those analyses are also attached to the experiment span. The Logfire backend provides SQL querying, while the offline runner returns a report directly to the caller.

Trade-offs & Limitations

Compared with wiring OpenTelemetry directly to an existing backend, Logfire JS adds runtime setup helpers, evaluation primitives, and a way to inspect evaluation results alongside traces in Logfire. Direct OpenTelemetry remains a better fit when standard signals are enough and the team already owns its collection and analytics stack. Although the SDK is MIT-licensed, the Logfire ingestion and dashboard server is closed source and is not shipped here. OpenTelemetry compatibility does not make Logfire's SQL interface or evaluation views portable to a different backend.

The SDK also leaves model selection, credentials, retries, and judge cost to the application rather than bundling a model client. Online evaluation is sampled and runs in the background, but still consumes resources: budget for telemetry volume, concurrent evaluations, and any judge API calls. No accelerator is needed for ordinary instrumentation or deterministic checks; a local model behind a custom judge changes that sizing. Before enabling export, review which task attributes and evaluation results may leave the environment.

Hardware & Deployment Guide

The root manifest pins Node.js 24 for development of the pnpm workspace; that does not establish a minimum for every published package. For Node.js applications, install @pydantic/logfire-node, supply a write token, and call configure() before loading modules you want automatically instrumented. Add logfire directly when importing logfire/evals. Await shutdown() in short-lived Node.js scripts. Offline experiments can run in process without exporting to Logfire.

Cloudflare Workers requires nodejs_compat and uses LOGFIRE_TOKEN, which can be set as a Wrangler secret in production. Next.js on Vercel can use @vercel/otel with the Logfire OTLP trace and metric endpoints and an authorization header; browser-side fetch requires separate instrumentation. Deno can export through its native OpenTelemetry support. Browser 0.41.6 and Workers 2.3.3 are patch releases that update the shared logfire dependency to 0.26.5; they do not establish new runtime capabilities.

Runtime integration: Dedicated Node.js, browser, and Cloudflare Workers packages, plus export paths via @vercel/otel and Deno's native OpenTelemetry support.
Dataset portability: logfire/evals mirrors the Python pydantic-evals data model and serialized YAML/JSON dataset format.
Trace-aware checks: HasMatchingSpan applies a SpanQuery to task instrumentation, while MaxDuration checks execution time.
Evaluator contracts: Sync and async checks return assertions, scores, labels, or named results; thrown evaluator errors are recorded per case.
Production monitoring: Sampled async calls emit gen_ai.evaluation.result OpenTelemetry log events and can forward results to in-process sinks.
Report analysis: Built-in confusion matrix, precision-recall, ROC AUC, and Kolmogorov–Smirnov evaluators run once after all cases complete.
Best For

TypeScript teams that want runtime traces, pre-release evaluation of application or agent tasks, and sampled production checks without adopting an agent runtime.

Skip If

You need a fully open-source, self-hostable ingestion and dashboard stack, a bundled judge model, or only standard OpenTelemetry export to an existing backend.

Reviewed on 2026-11-30 · Grounded in GitHub README, root file tree & releases · Newer release @pydantic/logfire-browser@0.42.0 (2026-12-02) shipped after this reviewMethodology

Quick Start & Installation

API
mkdir test-logfire-js
cd test-logfire-js
npm init -y es6 # creates package.json with `type: module`
npm install @pydantic/logfire-node

Comparison vs. Top Agents & Frameworks Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
logfire-js ★72—TypeScriptMITOpenTelemetry SDK for JavaScript observability and agent evaluation
ag-ui22.6k+611TypeScriptMITA typed event protocol and SDKs that connect agent backends to interactive apps
ruflo82.8k+342TypeScriptMITA TypeScript orchestration layer for coding agents, with shared memory and MCP
browser-use122.7k+477PythonMITPython REPL and CDP for adaptive browser automation

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/pydantic/logfire-js.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

pydantic/logfire-js Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about logfire-js

Where should Logfire initialization sit in a Node.js application?

Install @pydantic/logfire-node and call configure() before importing Express so automatic instrumentation can initialize first. Declare logfire as a direct dependency if you import logfire/evals. For one-shot scripts, await shutdown() before exiting.

Does the SDK need a GPU, and what drives runtime overhead?

The SDK does not run a model by itself, so basic instrumentation and deterministic evaluators have no inherent GPU or VRAM requirement. Size for telemetry volume, evaluation sampling, and concurrent work. If a custom judge calls an external model, account for API usage and timeouts; if it calls a local model, hardware requirements depend on that model. No fixed resource baseline is established.

Can we use the SDK commercially and self-host the complete Logfire stack?

The MIT license permits commercial use of the SDK subject to its notice requirements. It does not grant rights to the closed-source Logfire ingestion and dashboard server, which is not included in this repository. For restricted-data environments, review exported attributes and evaluation events, the ingestion destination, and the service terms separately.

When is Logfire JS a better fit than integrating OpenTelemetry directly?

If you already operate a collector and backend and only need traces, metrics, and logs, direct OpenTelemetry can be the simpler dependency choice. Logfire JS adds value when you also want typed evaluation datasets, trace-aware assertions, and sampled production checks tied to Logfire's UI. Dataset.evaluate() returns a report in process, so offline checks do not require the dashboard.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining pydantic/logfire-js? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature pydantic/logfire-js on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare