Skip to main content

An opinionated, backend-agnostic runtime for agents that work in production — deterministic, auditable, injection-resistant. Import as `zu`.

Project description

Zu

An opinionated, backend-agnostic runtime for agents that work in production — deterministic, auditable, and injection-resistant by construction.

New here? One line:

pip install 'zu-runtime[all]'       # everything: web tools, both model SDKs, server, Docker, MCP

Prefer a lean install? pip install zu-runtime gives you import zu, the zu command, the web tools (http_fetch/html_parse/render_dom), the model-provider adapters, detectors, validators, and a SQLite event sink. Add the heavy/situational bits as extras:

pip install 'zu-runtime[anthropic]' # + the Anthropic SDK to call a real model (also: [openai])
pip install 'zu-runtime[serve]'     # + the HTTP server (zu serve)
pip install 'zu-runtime[docker]'    # + the Docker sandbox (tier-2 browser)
pip install 'zu-runtime[mcp]'       # + the MCP server (zu mcp)

The zu-* packages are also standalone on PyPI, but you rarely install them individually — that's for plugin authors depending on just zu-core.

Embed it

import zu

result = zu.run(
    {"query": "Extract the product name and price.",
     "target": "https://example.com/product/123",
     "output_schema": {"type": "object",
                       "properties": {"name": {"type": "string"}, "price": {"type": "string"}},
                       "required": ["name", "price"]}},
    config={"provider": {"name": "anthropic", "model": "claude-sonnet-4-6",
                         "api_key_env": "ANTHROPIC_API_KEY"},
            "plugins": {"tools": ["http_fetch", "html_parse", "render_dom"],
                        "detectors": ["empty", "error", "js-shell", "bot-wall"],
                        "validators": ["schema", "grounding"]}},
)
print(result.status, result.value)

Swapping the model is a one-line edit to the provider block — Anthropic, OpenRouter, OpenAI, or a local model (Ollama / vLLM) — because the runtime only ever speaks to a ModelProvider port. Credentials are named by environment variable (api_key_env), never passed in code or config.

Run it from the command line, or as a service

zu run agent.yaml             # one-shot
zu run agent.yaml --every 5m  # scheduled worker
zu serve -c agent.yaml                     # HTTP: POST /run  (needs the [serve] extra)

What it is

A small, stable core (the loop, registry, contracts, event bus) surrounded by six swappable ports. Every capability that can vary is a plugin behind a port, so the production system is reached by adding adapters — never by reopening the core. Full source, architecture, and examples: https://github.com/k3-mt/zu

Apache-2.0.

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

zu_runtime-0.2.3.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

zu_runtime-0.2.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zu_runtime-0.2.3.tar.gz.

File metadata

  • Download URL: zu_runtime-0.2.3.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_runtime-0.2.3.tar.gz
Algorithm Hash digest
SHA256 23105760d8febacde4e12f677e3b5a46f5cad2e1c640c9c08a766e0411a88645
MD5 1cbb384a90eb443993e6f454bb4ae8b8
BLAKE2b-256 8f89b3ad6d1f79a352e6f1f00403d051ee986a1f91ba7f8030acb9d730a17da4

See more details on using hashes here.

File details

Details for the file zu_runtime-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: zu_runtime-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for zu_runtime-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b57676be9e583bc71c28057377c627dfdf4fd20ca8799c4ad25fef857f12178b
MD5 a2dcda4983c4dbf670afe10a0a8eb564
BLAKE2b-256 89591a5b27d0aec84c3153f3ea2fff604b4afe93f6ab8b2dd3c513e122d485d8

See more details on using hashes here.

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