Valkyrie SDK
Async Python client for Valkyrie, Vals AI's platform for running AI agents on benchmarks. Start runs, follow their progress, read results, logs, and task details, and manage agents, projects, secrets, and benchmark services from your own code.
Documentation: docs.valkyrie.vals.ai · SDK reference: docs.valkyrie.vals.ai/reference/sdk
Install
The SDK needs Python 3.12 or later. With uv installed and a virtual environment activated:
uv pip install valkyrie-sdk
Sign in
The SDK uses the same login and Tracker as the Valkyrie CLI. Sign in once with
valkyrie login, or set
VALKYRIE_API_KEY to an
access key.
The SDK doesn't install the CLI.
To choose the Tracker or access key in code, pass a ValkyrieConfig:
from valkyrie.sdk import ValkyrieClient, ValkyrieConfig
config = ValkyrieConfig(url="https://tracker.example.com", api_key="ACCESS_KEY")
async with ValkyrieClient(config) as client:
...
List your runs
import asyncio
from valkyrie.sdk import ValkyrieClient
async def main() -> None:
async with ValkyrieClient() as client:
page = await client.runs.list()
for run in page.benchmarks:
print(run.id, run.name, run.status, run.final_score)
asyncio.run(main())
Start a run and wait for its score
import asyncio
from valkyrie.sdk import BenchmarkStatus, ValkyrieClient
FINAL_STATUSES = {BenchmarkStatus.FINISHED, BenchmarkStatus.ERROR, BenchmarkStatus.STOPPED}
async def main() -> None:
async with ValkyrieClient() as client:
run = await client.runs.start(
agent="my-agent",
benchmark="swebench",
model="provider/model-name",
concurrency=10,
label="nightly-swebench",
)
print("Started", run.benchmark_id)
while (await client.runs.fetch(run.benchmark_id)).details.status not in FINAL_STATUSES:
async for update in client.runs.stream(run.benchmark_id):
details = update.details
print(f"{details.status.value}: {details.finished_tasks}/{details.total_tasks} tasks")
results = await client.runs.results(run.benchmark_id)
if results.status == BenchmarkStatus.FINISHED and results.final_evaluation:
print("Score:", results.final_evaluation.final_score)
asyncio.run(main())
agent is the name of an agent you
uploaded to your library. stream
yields the run's state each time it changes. It ends when the run finishes or when the
Tracker disconnects, so the loop reconnects until the run reaches a final status.
Download outputs
Extract the files your agents wrote into a new directory:
await client.runs.download_outputs(run_id, "./outputs", task_ids=["task-1"])
Leave out task_ids for the whole run.
Look into failed tasks
from valkyrie.sdk import FetchTasksRequest, TaskStatus
errors = FetchTasksRequest(status=[TaskStatus.ERROR])
async for task in client.benchmarks.iter_tasks(run_id, errors):
print(task.task_id, task.error_message)
for event in await client.logs.fetch_task(run_id, task.task_id, query="ERROR"):
print(event.timestamp, event.message)
Stop, resume, and retry runs
await client.runs.stop(run_id)
await client.runs.resume(run_id, concurrency=20)
await client.runs.retry(run_id, task_ids=["task-1"])
See Manage a run for what each action reruns.
Handle errors
Every SDK exception inherits from ValkyrieSDKError. ValkyrieAPIError carries the HTTP
status and the Tracker's error detail:
from valkyrie.sdk import ValkyrieAPIError, ValkyrieSDKError
try:
run = await client.runs.fetch(run_id)
except ValkyrieAPIError as exc:
print(exc.status_code, exc.detail)
except ValkyrieSDKError as exc:
print(exc)
Learn more
| Topic | Guide |
|---|---|
| Set up the SDK | sdk/quickstart |
| Start, follow, recover, and download runs | sdk/runs |
| Tasks, logs, artifacts, agents, secrets, and services | sdk/resources |
| Every client method, model, and field | reference/sdk |
| Every SDK exception | reference/sdk/errors |
| Tracker, login, and environment variables | get-started/configuration |
Complete example scripts are in docs/sdk/examples.
Metadata
Release files for valkyrie-sdk 0.35.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| valkyrie_sdk-0.35.0.tar.gz | 68.4 kB | With provenance | Details for valkyrie_sdk-0.35.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| valkyrie_sdk-0.35.0-py3-none-any.whl | Python 3 | none | any | Details for valkyrie_sdk-0.35.0-py3-none-any.whl |
Total release size: 163.9 kB
Release files / valkyrie_sdk-0.35.0.tar.gz
| Download URL | valkyrie_sdk-0.35.0.tar.gz |
|---|---|
| Size | 68.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
729832f36f1442e6b5a8742efcb51a59636e26c5107ace6186b460539024748c
|
|
BLAKE2b-256 checksum How to use checksums |
6c959ce79ea82c116f5936e1550014e5fd879d82952d68e6e44a88d766359198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Nov 13, 2026.
Transparency logRelease files / valkyrie_sdk-0.35.0-py3-none-any.whl
| Download URL | valkyrie_sdk-0.35.0-py3-none-any.whl |
|---|---|
| Size | 95.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4decdd7ceb8078d7de0261f91475150abb829dda2fac7b310592d04eac4c8d5
|
|
BLAKE2b-256 checksum How to use checksums |
53d1a02e50a582c744eb3d1204f081b93a4196e5c5dac7f09cc3f7dab9f8da0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Nov 13, 2026.
Transparency logSecurity for valkyrie-sdk 0.35.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for valkyrie_sdk-0.35.0.tar.gz
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 Nov 13, 2026.
Transparency logA 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.