Skip to main content
Judgment Logo

The Continuous-Improvement Stack for Agents

Detect failures, triage root causes, and ship fixes backed by production data.

PyPI Docs

X LinkedIn

Overview

Judgeval is an open-source Python SDK for agent improvement. It provides tracing and Agent judge evaluation for LLM-powered applications — so you can detect failures, understand what went wrong, and validate fixes against real production cases before shipping.

To get started, dive into the docs.

Why Judgeval

OpenTelemetry-based tracing -- Instrument any function with @Tracer.observe(). Automatically captures inputs, outputs, and LLM token usage. Built on OpenTelemetry for full compatibility with existing observability stacks.

Agent judges -- Define prompt-based scorers to evaluate traces at scale. Judges apply labels to traces — a binary judge applies its label when true, and a classification judge applies the chosen option — and those labels accumulate into a searchable record of how your agent acted over time. Run judges against live production traffic or replay them on historical traces to validate fixes before shipping.

Online monitoring -- Automatically score live production traffic server-side with no latency impact. When a judge applies a label, that label surfaces as a structured signal — configure Slack alerts so regressions and recurrences never go unnoticed.

Broad integrations -- Auto-instrumentation for OpenAI, Anthropic, Google GenAI, and Together AI. Framework support for LangGraph, and Claude Agent SDK.

Quickstart

Install the SDK:

pip install judgeval

Set your credentials:

export JUDGMENT_API_KEY=...
export JUDGMENT_ORG_ID=...

Add observability to your agent with two lines of setup:

from judgeval import Tracer, wrap
from openai import OpenAI

Tracer.init(project_name="my-project")
client = wrap(OpenAI())

@Tracer.observe(span_type="tool")
def search(query: str) -> str:
    results = vector_db.search(query)
    return results

@Tracer.observe(span_type="agent")
def run_agent(question: str) -> str:
    context = search(question)
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"{context}\n\n{question}"}],
    )
    return response.choices[0].message.content

run_agent("What is the capital of the United States?")

SQL

Use Judgeval.sql(sql_text) for read-only queries against Judgment's virtual schema, which abstracts the underlying storage. The server validates incoming queries, rejects writes, and enforces organization and project scope. The client uses its existing API key, organization membership, and resolved project. Viewer access and the public query rate limit apply.

from judgeval import Judgeval

client = Judgeval(project_name="my-project")
print(client.discover_schema())
result = client.sql("SELECT count() AS run_count FROM telemetry.traces")
print(result["rows"])

client.discover_schema() returns a Markdown string with the server's generated tables, column types and descriptions, row semantics, examples, and query limits, using the same reference as MCP discover_schema. It contains no project data and requires organization viewer access, but no resolved project. The HTTP equivalent is GET /v1/sql/schema, which returns {"schema": "...Markdown reference..."}.

For query execution, use POST /v1/projects/{projectId}/sql with Authorization: Bearer <api-key>, X-Organization-Id: <organization-id>, and JSON body {"sql": "SELECT count() AS run_count FROM telemetry.traces"}. Organization and project scope are derived by the server. Use SQL predicates on supported catalog columns and LIMIT to narrow results. Physical tables, writes, multiple statements, and caller-specified execution limits are unsupported. DAL catalog allowlists, tenant isolation, and result limits of 1,000 rows and 5 MiB apply; over-limit results return an error. SQL text must contain a non-whitespace character and cannot exceed 50,000 characters.

The response contains catalog_version, columns (name, type, nullable), rows, row_count, and elapsed_ms. SQL integers outside JavaScript's safe range (-(2**53 - 1) to 2**53 - 1) arrive as exact decimal strings, including inside nested arrays and objects. For example, 9007199254740993 arrives as "9007199254740993"; use int(value) when you need a Python integer. Small integers and floating-point values remain numbers, and column types retain their original SQL types. Validation and execution errors use the SDK's existing exception mapping.

Integrations

Supports OpenAI, Anthropic, Google GenAI, Together AI, LangGraph, and Claude Agent SDK. See the full integrations docs.

CLI

Manage agents, traces, judges, labels, and evaluations from the terminal. Query trace history, deploy judges, review the labels judges applied, and run evals against production data — all without leaving your shell. See the CLI repo and docs.

MCP Server

Connect Judgment to any MCP-compatible AI tool. Query agent traces, invoke judges, browse the labels judges applied, and surface failures directly inside your AI assistant or IDE. See the docs.


Judgeval is created and maintained by Judgment Labs.

Metadata

Release files for judgeval 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for judgeval 1.8.0
File Size Uploaded Provenance Actions
judgeval-1.8.0.tar.gz 131.7 kB Without provenance Details for judgeval-1.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for judgeval 1.8.0
File Interpreter ABI Platform Actions
judgeval-1.8.0-py3-none-any.whl Python 3 none any Details for judgeval-1.8.0-py3-none-any.whl

Total release size: 320.0 kB

Release files / judgeval-1.8.0.tar.gz

Download URL judgeval-1.8.0.tar.gz
Size 131.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8c5055b5e00f23535ca5824dfaf329e34e07163d71c98d49fd7f81e996257c78
BLAKE2b-256 checksum
How to use checksums
75f6a343dc862e240d84722786d87512151162eb911545d7d3238b2850ad5a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / judgeval-1.8.0-py3-none-any.whl

Download URL judgeval-1.8.0-py3-none-any.whl
Size 188.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1069cc4885dba04e92dffd79ef09874e89458e002903788733fcafa3c16cd060
BLAKE2b-256 checksum
How to use checksums
7c71ea9bb116aff1e207abf3418aeede42fb8a2c78a135fbd36b77ed3687cd2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for judgeval 1.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page