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

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/*

License

MIT

Metadata

Release files for agent0-runtime 0.1.0

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.0
File Size Uploaded Provenance Actions
agent0_runtime-0.1.0.tar.gz 69.8 kB With provenance Details for agent0_runtime-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 132.8 kB

Release files / agent0_runtime-0.1.0.tar.gz

Download URL agent0_runtime-0.1.0.tar.gz
Size 69.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a119fa712a524c39a1fc0a63e86f77f87d6b96d1a16c8bcbf1c6171128d0b93a
BLAKE2b-256 checksum
How to use checksums
a68b659755c79c59cd3cf7b44f06b9963bc1676f706943264ad6e471d766112d
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.0-py3-none-any.whl

Download URL agent0_runtime-0.1.0-py3-none-any.whl
Size 63.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d0a8be6e9d34c3ba6a2206930855f63cb500f13f7389e6d8771c6ca8a711cc
BLAKE2b-256 checksum
How to use checksums
b21beae0d5f931df4d529cdc6ef879a7968ab9fd8cb15660ef619139d4fc2da4
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.0

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