Skip to main content

EvalGate Python SDK — CI for AI behavior. Traces, evaluations, assertions, and regression gates for LLM apps.

Project description

evalgate-sdk

PyPI Python License: MIT Typed

evalgate-sdk brings EvalGate's evaluation control plane to Python.

Use it to run assertions, trace agent workflows, inspect platform runs, orchestrate judges, and participate in the same closed-loop evaluation workflow as the TypeScript SDK and the web app.

Install

pip install evalgate-sdk
pip install "evalgate-sdk[cli]"

Optional extras:

pip install "evalgate-sdk[openai]"
pip install "evalgate-sdk[anthropic]"
pip install "evalgate-sdk[langchain]"
pip install "evalgate-sdk[all]"

Quick Start

Local Assertions

from evalgate_sdk import expect

result = expect("The capital of France is Paris.").to_contain("Paris")
print(result.passed)

Platform Client

from evalgate_sdk import AIEvalClient
from evalgate_sdk.types import CreateTraceParams

client = AIEvalClient(api_key="sk-...")

trace = await client.traces.create(
    CreateTraceParams(
        name="support-run",
        input="Cancel my subscription",
        output="I've canceled your plan effective today.",
    )
)

print(trace.id)

Closed-Loop Workflow

The Python package participates in the same EvalGate loop:

trace -> cluster -> synthesize -> gate -> review -> auto -> ship

Representative CLI commands:

evalgate gate
evalgate cluster --run .evalgate/runs/latest.json
evalgate synthesize --dataset .evalgate/golden/labeled.jsonl
evalgate judge registry
evalgate judge presets

Judge Orchestration

The Python SDK supports the same core judge model as the platform:

  • registry-backed judge selection
  • saved judge configs
  • multi-judge aggregation
  • per-run and per-case judge inspection
  • structured reasoning and signal breakdowns

CLI

evalgate judge registry
evalgate judge presets

evalgate judge test \
  --provider openai \
  --model gpt-5.2-chat-latest \
  --judge openai:gpt-5.2-chat-latest \
  --judge anthropic:claude-sonnet-4-20250514 \
  --aggregation weighted \
  --prompt-template "Return strict JSON with score, passed, reasoning, and signals." \
  --input "Cancel my subscription" \
  --output "I've canceled your plan effective today."

Client

from evalgate_sdk.types import TestLLMJudgeConfigParams

registry = await client.llm_judge.list_registry()
presets = await client.llm_judge.list_presets()

result = await client.llm_judge.test_config(
    TestLLMJudgeConfigParams(
        provider="openai",
        model="gpt-5.2-chat-latest",
        prompt_template="Return strict JSON with score, passed, reasoning, and signals.",
        judges=[
            {
                "id": "primary",
                "type": "llm",
                "provider": "openai",
                "model": "gpt-5.2-chat-latest",
                "weight": 0.6,
            },
            {
                "id": "backup",
                "type": "llm",
                "provider": "anthropic",
                "model": "claude-sonnet-4-20250514",
                "weight": 0.4,
            },
        ],
        aggregation="weighted",
        input="Cancel my subscription",
        output="I've canceled your plan effective today.",
        behavior="tool_use",
        task_type="support",
    )
)

print(result.result.score, result.result.reasoning)

Enterprise Controls

The Python SDK respects the same platform guardrails:

  • provider allowlists
  • pre-send PII checks for outbound judge/provider calls
  • org-scoped policy
  • shared config precedence with the API and web app

Surface Parity

The Python SDK now covers the primary EvalGate workflows used in the product:

  • traces and runs
  • clustering and synthesis
  • gate/check/review loops
  • judge registry, presets, configs, results, and comparisons
  • workflow and control-plane inspection commands

TypeScript still has a few extra convenience wrappers, but the core control-plane model is shared.

For broader product context, see:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evalgate_sdk-3.5.0.tar.gz (189.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evalgate_sdk-3.5.0-py3-none-any.whl (175.5 kB view details)

Uploaded Python 3

File details

Details for the file evalgate_sdk-3.5.0.tar.gz.

File metadata

  • Download URL: evalgate_sdk-3.5.0.tar.gz
  • Upload date:
  • Size: 189.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evalgate_sdk-3.5.0.tar.gz
Algorithm Hash digest
SHA256 3dbbbba5dde490db9ac7c77956f4d9705bb1b784917259c91845d7a8563f2267
MD5 a9370d9739983b5b8f115466203c37a2
BLAKE2b-256 98ed1f29f62407e8c830ab5842c67e8d01bbbb226d27553c9edc361db9029e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalgate_sdk-3.5.0.tar.gz:

Publisher: publish-pypi.yml on evalgate/ai-evaluation-platform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evalgate_sdk-3.5.0-py3-none-any.whl.

File metadata

  • Download URL: evalgate_sdk-3.5.0-py3-none-any.whl
  • Upload date:
  • Size: 175.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evalgate_sdk-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb44951defbf9bea707c5e1981375d971bcafdc4658d1638d8e9e55a8d90a2c0
MD5 2422109b8df47ff6be328b857c0f1e7c
BLAKE2b-256 10efee906163047252dd5959c02815b602297622bcf021bf6a2b61e60d884a51

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalgate_sdk-3.5.0-py3-none-any.whl:

Publisher: publish-pypi.yml on evalgate/ai-evaluation-platform

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page