Skip to main content

agent0-runtime

A small, headless, embeddable agent runtime for Python. It provides the model/tool loop, OpenAI-compatible Responses backends, tools, sessions, structured events, cancellation, lifecycle hooks, and plugins. Terminal UI, persistence formats, and application policy belong to consumers.

Install

python -m pip install agent0-runtime

openai is the only required dependency. Image reading and web fetch are opt-in extras (web search needs only the standard library), and nothing from an extra is imported unless the matching tool runs:

python -m pip install "agent0-runtime[images]"  # Pillow image attachments
python -m pip install "agent0-runtime[web]"     # trafilatura + urllib3 + certifi
python -m pip install "agent0-runtime[all]"     # every optional capability

A host that embeds the loop with its own tools never pays for the extras.

Python 3.10 through 3.13 are supported. The package is typed and ships py.typed.

Minimal agent

Set DEEPSEEK_API_KEY or KIMI_API_KEY, then run:

import asyncio
from agent0_runtime import Agent, tool

@tool("add")
def add(a: float, b: float) -> str:
    """Add two numbers."""
    return str(a + b)

async def main():
    async with Agent.from_env(tools=["add"]) as agent:
        result = await agent.run("Use add to calculate 20 + 22.")
        print(result.text)

asyncio.run(main())

Agent.from_env() creates and owns the provider client, backend, and matching history policy. Exiting the async context closes plugins and network resources. Pass an explicit provider/model when more than one provider is configured.

Hosts with an existing OpenAI-compatible client can share the same backend/history assembly without transferring ownership:

from agent0_runtime import Agent

agent = Agent.from_openai(client, model, provider_id=provider_id, tools=registry)

The runtime also includes provider-neutral built-in tools for filesystem, shell, fetch, and search. Optional behavior is injected through BuiltinToolsConfig; hosts provide workspace policy, credentials, persistence, and UI.

Documentation

Development

python -m pip install -e .
python -m unittest discover -s tests -v
python -m pip install ruff==0.12.12 build twine
ruff check .
ruff format --check .
python -m build
python -m twine check --strict dist/*

Run the tests with -e .[all] when you touch images or web tools.

License

MIT

Metadata

Release files for agent0-runtime 0.1.1

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

Source distribution (sdist)

Source distribution for agent0-runtime 0.1.1
File Size Uploaded Provenance Actions
agent0_runtime-0.1.1.tar.gz 78.8 kB With provenance Details for agent0_runtime-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent0-runtime 0.1.1
File Interpreter ABI Platform Actions
agent0_runtime-0.1.1-py3-none-any.whl Python 3 none any Details for agent0_runtime-0.1.1-py3-none-any.whl

Total release size: 145.6 kB

Release files / agent0_runtime-0.1.1.tar.gz

Download URL agent0_runtime-0.1.1.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
df347d6b845a24e4e1d67290a98cd78a93fd4de921a762c380620a44810a1080
BLAKE2b-256 checksum
How to use checksums
5b27fa1c6c45d80dc1f61ae46499016ec08f1a99c6c345dad14c1617b11c22fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 18, 2026.

Transparency log

Release files / agent0_runtime-0.1.1-py3-none-any.whl

Download URL agent0_runtime-0.1.1-py3-none-any.whl
Size 66.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55c3de23d8625b1c22ca310d49ee98e9ca35013b456b015af65d5d1568d2f0a2
BLAKE2b-256 checksum
How to use checksums
082dc7dd5ec64819553e05d62771879b3bca420744377efe49103d07b043e354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 18, 2026.

Transparency log

Security for agent0-runtime 0.1.1

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.

Select from 2 files

Attestation for agent0_runtime-0.1.1.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 18, 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