Skip to main content

Zeroshot Python SDK

Install from PyPI with Python 3.11 or newer:

python -m pip install the-open-engine-zeroshot

Import the package as zeroshot. Pip selects the wheel for your OS and CPU. See the Python SDK guide for setup and examples.

Zeroshot enforces your team's QA process on coding agents as a graph you define. zeroshot is a typed async client for its run engine. Each platform wheel contains the matching zeroshot executable. Python supplies async calls and typed result objects; the executable remains authoritative for graph validation, run state, template expansion, and runtime/provider rules.

import asyncio

from zeroshot import Client, UniformRuntime

async def main() -> None:
    runtime = UniformRuntime(
        harness="codex",
        provider="openrouter",
        model="PROVIDER_MODEL_ID",
        effort="max",
    )

    async with Client(runtime=runtime) as client:
        result = await client.run(
            "Implement the requested change and run the relevant tests.",
            wait_timeout=21_600,
        )

    result.raise_for_failure()


if __name__ == "__main__":
    asyncio.run(main())

Client() defaults to LocalTarget() and Preset("software-change"), but it never guesses a harness, provider, or model. run() submits one durable graph run and waits for its terminal result. submit() returns a Run immediately for status, resumable watch/log streams, waiting, or durable force-stop control.

Local, direct, and hosted targets

Local runs use the folder captured when the client opens. Set LocalTarget.workspace or per-run cwd= to select another folder; relative cwd paths use that captured workspace. Agents write in place. Without Git delivery, plain folders work; push needs committed Git and a remote, while PR and merge need a supported forge (GitHub today).

from zeroshot import Client, UniformRuntime


async def run_local(runtime: UniformRuntime) -> None:
    async with Client(runtime=runtime) as client:
        result = await client.run("Update the parser.", cwd="/path/to/folder")

    result.raise_for_failure()

The same client reaches an unauthenticated Docker deployment or another direct target by changing only the target:

from zeroshot import Client, DirectTarget, UniformRuntime


async def run_direct(runtime: UniformRuntime) -> None:
    target = DirectTarget("http://127.0.0.1:8080")

    async with Client(target=target, runtime=runtime) as client:
        result = await client.run("Inspect the repository and report success.")

    result.raise_for_failure()

Docker/direct and hosted targets require a committed Git source. Per-run repository= accepts a credential-free HTTPS/SSH Git URL or GitHub owner/name; branch= and revision= override source selection. source_connection= selects a named connection used only for checkout and delivery.

HostedTarget reuses a named target and login from the CLI. Merge plans are immutable DAGs over one repository, branch, and hosted profile. That profile must contain exactly one builtin.git-delivery.merge@2 node; pull-request delivery isn't accepted for plans. Agent bindings must not declare GH_TOKEN; only the Git delivery binding may declare it.

from datetime import UTC, datetime, timedelta

from zeroshot import Client, HostedTarget, MergePlanRequest, MergePlanRun


async def run_plan() -> None:
    request = MergePlanRequest(
        title="Release checkout update",
        repository="the-open-engine/zeroshot",
        branch="main",
        profile="org:software-change",
        expires_at=(datetime.now(UTC) + timedelta(days=1)).isoformat(),
        runs={
            "backend": MergePlanRun(input={"task": "Update the API."}),
            "frontend": MergePlanRun(input={"task": "Update the client."}),
            "integrate": MergePlanRun(
                input={"task": "Verify the combined changes and run the release tests."},
                needs=("backend", "frontend"),
            ),
        },
        submission_key="checkout-release-1",
    )

    async with Client(target=HostedTarget("platform")) as client:
        plan = await client.submit_plan(request)
        status = await plan.wait(wait_timeout=21_600)

    if not status.succeeded:
        raise RuntimeError(f"merge plan ended as {status.state}")

Plan input is static JSON. A dependency controls when a node may start; it doesn't copy output into another node. Run IDs are assigned once during atomic submission. After dependencies merge, Platform materializes a node against an exact source revision. When materialization completes, readyAt is set and the node's queue deadline is the earlier of plan expiry and seven days after readyAt. A merge conflict is repaired by the conflicting run itself in the same checkout and delivery loop. A descendant cannot repair a failed predecessor; it ends as dependency_failed. MergePlan.watch() polls the aggregate Platform status and emits changed snapshots because the v1 plan API has no streaming endpoint.

Exact graph and runtime control

Use GraphSpec and RuntimePlan to pass exact JSON values unchanged. Python does not traverse or validate either document:

from collections.abc import Mapping
from typing import Any

from zeroshot import GraphSpec, RunRequest, RuntimePlan


def exact_request(
    graph_document: Mapping[str, Any],
    runtime_document: Mapping[str, Any],
) -> RunRequest:
    return RunRequest(
        title="Repair checkout",
        graph=GraphSpec.from_dict(graph_document),
        initial_input={"ticket": "OE-123"},
        runtime=RuntimePlan.from_dict(runtime_document),
        submission_key="oe-123-attempt-1",
    )

await client.list_presets() and await client.get_preset(...) query the bundled Rust catalog. The Python package contains no copied preset registry, provider/model registry, graph schema, or semantic validator. Every submission runs the executable's preflight before a local controller starts or a direct target is contacted.

Durable observation

Run.watch(after=...) and Run.logs(after=..., execution=...) resume strictly after opaque native cursors. A wait_timeout expiry raises RunWaitTimeout carrying the still-active Run; cancelling the Python await also detaches without stopping it. Run.force_stop() is the only operation that changes run lifetime. Each LogEvent.timestamp is the positive, JavaScript-safe Unix epoch millisecond captured at the producer and preserved unchanged by durable replay.

Environment values

With environment=None, submission values come from os.environ. An explicit mapping replaces ambient credential variables; native saved connections and local harness login still apply. Zeroshot selects declared runtime and source-connection fields; transport credentials stay outside agent environments unless independently declared by a node. The executable owns provider defaults.

Packaging and versions

The package is released only as platform wheels because each wheel bundles one matching native executable; there is no first-run download, Node dependency, PyO3 ABI, or auth dependency. The distribution name is the-open-engine-zeroshot, the import package remains zeroshot, and py.typed is included.

An SDK release tag is zeroshot-python-vZEROSHOT_SDK, for example zeroshot-python-v8.0.0_1; its PEP 440 package version is 8.0.0.post1. Revision 1 is released automatically after the corresponding Zeroshot release. Later SDK-only revisions may be released independently against the same immutable Zeroshot release.

Metadata

Release files for the-open-engine-zeroshot 10.23.0.post1

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

Built distributions (wheels)

Table of built distributions (wheels) for the-open-engine-zeroshot 10.23.0.post1
File Actions
the_open_engine_zeroshot-10.23.0.post1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for the_open_engine_zeroshot-10.23.0.post1-py3-none-win_amd64.whl
the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_x86_64.whl
the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_aarch64.whl
the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_x86_64.whl
the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_arm64.whl

Total release size: 128.8 MB

Release files / the_open_engine_zeroshot-10.23.0.post1-py3-none-win_amd64.whl

Download URL the_open_engine_zeroshot-10.23.0.post1-py3-none-win_amd64.whl
Size 25.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c9a8ece5d53b641c1e770a6cab5c3789e63e8e475154002b8b55e43f5512544e
BLAKE2b-256 checksum
How to use checksums
e4449a4d589dae14d20c33cdb941e029f394f254937d62260fafe3e5650aeb6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 30, 2026.

Transparency log

Release files / the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_x86_64.whl

Download URL the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_x86_64.whl
Size 27.4 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
34f13daa5734e529dbe2e5497bb32ebbd8501f163186540f24a6476cdcd8c96d
BLAKE2b-256 checksum
How to use checksums
aa7fb16c2a8230d2fe442989e1a5b0e698655204d56ac12ba3fb2e76f82192f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 30, 2026.

Transparency log

Release files / the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_aarch64.whl

Download URL the_open_engine_zeroshot-10.23.0.post1-py3-none-manylinux_2_17_aarch64.whl
Size 25.5 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4952b7ee2c893a17382a6ce8d38eb70965f8d814112ff82626c849d112994e02
BLAKE2b-256 checksum
How to use checksums
6b37a01cb222be349b8266349c040060c69f71562ee9a8d986e3900c1aaba66d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 30, 2026.

Transparency log

Release files / the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_x86_64.whl

Download URL the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_x86_64.whl
Size 26.0 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
6a8cc9f4f87b5db5fd9a71c54e2fe672e5d6fd2a4bf8a1014a4c169b31ec75e9
BLAKE2b-256 checksum
How to use checksums
884ee3e8038672fa6c739aba3c1c379734a2b9b56cc598d8be89d7a681f51195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 30, 2026.

Transparency log

Release files / the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_arm64.whl

Download URL the_open_engine_zeroshot-10.23.0.post1-py3-none-macosx_11_0_arm64.whl
Size 24.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d62a8d7522ea71a19096efe1baf80e45b43ff6a1e2c06591b5df327e30f9c7c7
BLAKE2b-256 checksum
How to use checksums
e9ebe2e730da30bc5771434e5533f6113c7699eefea3ac46ebe852636f067f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 30, 2026.

Transparency log

Security for the-open-engine-zeroshot 10.23.0.post1

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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for the_open_engine_zeroshot-10.23.0.post1-py3-none-win_amd64.whl

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 Oct 30, 2026.

Transparency log

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.

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