Skip to main content

verdikt-sdk

Python SDK for Verdikt — a standalone AI evaluation service that decouples evaluation and LLM/human judging from the application being evaluated.

Installation

pip install verdikt-sdk

Usage

from verdikt_sdk import AnswerWithCost, VerdiktClient, EvaluationType, Question
from yalc import LLMModel

client = VerdiktClient(
    base_url="https://your-verdikt-instance.com",
    client_id="your-client-id",
    client_secret="your-client-secret",
)

# The app ("my-app") must already exist and this client must be bound to it,
# created beforehand in the Verdikt admin UI — the SDK does not create apps.

# Sync questions to the dataset (idempotent)
await client.add_questions("my-app", [
    Question(question="What is the capital of France?", human_answer="Paris"),
])

# Your callback returns the answer plus the cost it took your app to produce it.
# `cost` is optional — pass None when you do not track it.
async def my_llm_function(question: str) -> AnswerWithCost:
    answer, cost = await my_app(question)
    return AnswerWithCost(answer=answer, cost=cost)

# Run an evaluation cycle
await client.run_evaluation(
    app_slug="my-app",
    app_version="v1.2.0",
    callback=my_llm_function,
    evaluation_type=EvaluationType.LLM_ONLY,
    llm_judge_models=[LLMModel.gpt_4o_mini],
)

run_evaluation calls your callback concurrently for every question in the dataset, then submits all answers to Verdikt for judgment.

Breaking change in 0.2.0: the callback now returns AnswerWithCost(answer=..., cost=...) instead of a bare str. Callers on 0.1.x must wrap their return value (return AnswerWithCost(answer=ans) is a drop-in equivalent of the old behaviour).

Authentication

The SDK authenticates via the OAuth2 client-credentials grant against any OIDC-compliant provider (Zitadel, Keycloak, Okta, Auth0, ...). The token endpoint is discovered from the provider's /.well-known/openid-configuration, so no provider-specific URL is hardcoded.

Create a machine / service-account client in your IdP and pass its client_id and client_secret to VerdiktClient:

client = VerdiktClient(
    base_url="https://verdikt.mycompany.com",
    client_id="...",
    client_secret="...",
    # Set when the backend verifies a specific OIDC_AUDIENCE and your IdP
    # wouldn't otherwise stamp it onto the token's `aud`:
    audience="<backend OIDC_AUDIENCE>",
)

The backend verifies the token's issuer and audience, so audience must match the service's OIDC_AUDIENCE when audience verification is enabled.

Metadata

Release files for verdikt-sdk 0.5.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 verdikt-sdk 0.5.0
File Size Uploaded
verdikt_sdk-0.5.0.tar.gz 112.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for verdikt-sdk 0.5.0
File Interpreter ABI Platform
verdikt_sdk-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 120.0 kB

Release files / verdikt_sdk-0.5.0.tar.gz

Download URL verdikt_sdk-0.5.0.tar.gz
Size 112.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be2edb95247f8ebd28ea6edea352462a704a7e3e46c905945370448868273744
BLAKE2b-256 checksum
How to use checksums
303552a8e275e4660a36479ccfe5feb4c1dc7899d170f3a47e5ae8aadb1baecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release files / verdikt_sdk-0.5.0-py3-none-any.whl

Download URL verdikt_sdk-0.5.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff8a563a5b4120f34263e98611282a77a4daab9fe45bcefa9b64c709231db29c
BLAKE2b-256 checksum
How to use checksums
b31dedc4b94594ea941d5d33bbe7f60cbe96164c362239bce4e482dcbab90ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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