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

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.2
File Size Uploaded Provenance Actions
agent0_runtime-0.1.2.tar.gz 84.2 kB With provenance Details for agent0_runtime-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 152.6 kB

Release files / agent0_runtime-0.1.2.tar.gz

Download URL agent0_runtime-0.1.2.tar.gz
Size 84.2 kB
Tags Source
SHA-256 checksum
How to use checksums
67c7e734e6173e060406d592705b22caa84500e0a7ae1d22c50701782ca6d710
BLAKE2b-256 checksum
How to use checksums
68ccd8ba1a801bffa847a14d3cf229185c3cc21b47974aef72f3814991c8d964
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.2-py3-none-any.whl

Download URL agent0_runtime-0.1.2-py3-none-any.whl
Size 68.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2389eb41583cb70c82709e86a6c743829f0c2eebd9e7af33706b925ba6e8c8ac
BLAKE2b-256 checksum
How to use checksums
a5307b5b4483f4fbd08886a5277425c92994d34a0c03aecd8e146308c7aa55c6
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.2

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