Observed since 20 Oct, 23:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Lightweight utilities for building AI agent harnesses
A lightweight, provider-neutral runtime for building AI agents with explicit control over tools, safety, state, and orchestration.
🌐 Website · Documentation · GitHub
Start with an OpenAI-compatible endpoint, then add tools, approvals, memory, sandboxing, retrieval, and multi-agent orchestration without replacing your runtime. asyncio-native, with an optional API server and terminal CLI.
ModelProvider.Toolbase combines local/deferred and MCP tools, safety-screens them, sends only the relevant subset per turn, and keeps tool_search available for fallback discovery.Python 3.10–3.14.
pip install agent-rt
pip install 'agent-rt[all]' # or pick extras: openai, anthropic, observability, api, cli, guardrails
OpenLLMetry/Traceloop export is optional. Install agent-rt[observability] only when TRACELOOP-based telemetry is needed; the core runtime does not require it.
Configure a model:
export OPENAI_MODEL="your-model"
export OPENAI_API_KEY="..."
For an OpenAI-compatible endpoint, also set OPENAI_BASE_URL. If multiple provider configurations are present, set MODEL_PROVIDER=openai or MODEL_PROVIDER=anthropic.
import asyncio
import os
from agent_rt import (
AgentConfig,
AgentLoop,
ContentPart,
ModelMessage,
ModelSettings,
load_model,
)
async def main() -> None:
# validate=False skips the startup model-list check, so no extra network call.
provider = load_model(validate=False)
agent = AgentConfig(
name="assistant",
instructions="Answer clearly and concisely.",
model=ModelSettings(model=os.environ["OPENAI_MODEL"]),
)
message = ModelMessage(
role="user",
content=(ContentPart(type="text", text="What can Agent RT do?"),),
)
result = await AgentLoop(provider).run(agent, [message])
if result.final_response:
print(
"".join(
part.text or ""
for part in result.final_response.message.content
if part.type == "text"
)
)
asyncio.run(main())
More examples: examples/.
Prepend agent_rt. to a supported import, for example from agent_rt.langchain_openai import ChatOpenAI or from agent_rt.openai import OpenAI. See Migration.
agent-rt[api]): OpenAI-compatible Chat Completions/Responses and Anthropic-compatible Messages endpoints.agent-rt[cli]): agent-rt -p "explain this stack trace" or agent-rt --env-file=./.env -p "...".Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.3 | 8 Oct 2026 | 35 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 23:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:cc402a8b73b28cb35e253fc5c467372a2e5cabe62305b3c2a7771707338190b4