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.3

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.3
File Size Uploaded Provenance Actions
agent0_runtime-0.1.3.tar.gz 86.0 kB With provenance Details for agent0_runtime-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 155.1 kB

Release files / agent0_runtime-0.1.3.tar.gz

Download URL agent0_runtime-0.1.3.tar.gz
Size 86.0 kB
Tags Source
SHA-256 checksum
How to use checksums
75b2fab277d91dcf0906e0467188ee93305299171846b3285ae358a7c8d3cbdc
BLAKE2b-256 checksum
How to use checksums
70570e47e871c219171f9886ac2d1c83d5ec862b0a835ceac509c947a23adbfe
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.3-py3-none-any.whl

Download URL agent0_runtime-0.1.3-py3-none-any.whl
Size 69.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c12c9cd5c401637c929056c9284f805fc0fa3d9ca48df0dec95ee5962b3137d9
BLAKE2b-256 checksum
How to use checksums
475b1582c927d5b5e35cc5d64fd705c51f456a8b5fe6f0faf6a80a5ef4e3a8f9
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.3

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.3.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