Python SDK for the Verdikt Evaluation API
Project description
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",
)
# Register your app (idempotent — safe to call on every deploy)
await client.create_app(slug="my-app", name="My App")
# 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
callbacknow returnsAnswerWithCost(answer=..., cost=...)instead of a barestr. 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 Zitadel OAuth2 client credentials. Create a machine user in your Zitadel project and pass its client_id and client_secret to EvaluationClient.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file verdikt_sdk-0.2.0.tar.gz.
File metadata
- Download URL: verdikt_sdk-0.2.0.tar.gz
- Upload date:
- Size: 110.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d35153a30e3fb0125b93a7b99f02baacb7ae45bf51d1503e6026896c6546c6b
|
|
| MD5 |
a62a924f7b4d8ba521fb01657a6eed9d
|
|
| BLAKE2b-256 |
008cf40718abbe4c84efe57d641c9dd334aa28f5129fdac78a63c9fdb849571f
|
Provenance
The following attestation bundles were made for verdikt_sdk-0.2.0.tar.gz:
Publisher:
publish.yml on cognitai-labs-dev/verdikt-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
verdikt_sdk-0.2.0.tar.gz -
Subject digest:
8d35153a30e3fb0125b93a7b99f02baacb7ae45bf51d1503e6026896c6546c6b - Sigstore transparency entry: 1484502858
- Sigstore integration time:
-
Permalink:
cognitai-labs-dev/verdikt-sdk-python@1204b67ccba84fe23ff4a755bfeac8f1ab66bb99 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/cognitai-labs-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1204b67ccba84fe23ff4a755bfeac8f1ab66bb99 -
Trigger Event:
push
-
Statement type:
File details
Details for the file verdikt_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: verdikt_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83d37d49be2734113da56d553e25009f35fc03d6de6e49b64bcd2b7678b93854
|
|
| MD5 |
d5af4a3196369b77a5a3bac1b05917ad
|
|
| BLAKE2b-256 |
cd3938da728cb5bcda4c0a62bb76f16654f8d7dfc031865353f6740213518049
|
Provenance
The following attestation bundles were made for verdikt_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on cognitai-labs-dev/verdikt-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
verdikt_sdk-0.2.0-py3-none-any.whl -
Subject digest:
83d37d49be2734113da56d553e25009f35fc03d6de6e49b64bcd2b7678b93854 - Sigstore transparency entry: 1484502877
- Sigstore integration time:
-
Permalink:
cognitai-labs-dev/verdikt-sdk-python@1204b67ccba84fe23ff4a755bfeac8f1ab66bb99 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/cognitai-labs-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1204b67ccba84fe23ff4a755bfeac8f1ab66bb99 -
Trigger Event:
push
-
Statement type: