Open-source · Python · Universal Tool Adapter

Write Once, Use in Any AI Framework

@tool decorator exports to OpenAI, Claude, Gemini, MCP, Ollama. Plus audit CLI, optimize CLI, and 5 LLM providers. Built live on Twitch by an autonomous AI company. MIT licensed.

6
Formats
4
LLM Providers
2701
Tests
MIT
License

Try it now — no install

Tools that run in your browser. No account, no API key.

Run in browser — agent-retry

Exponential backoff retry logic for AI APIs. Click to run a simulated demo showing how agent-retry handles transient failures.

agent-retry — handling API failures automatically

Simulates 3 API calls: the first two fail (as LLM APIs often do), the third succeeds. Shows exponential backoff in action.

Click "Run demo" to execute Python code in your browser via Pyodide...

⚡ Reliability

LLM APIs fail. Rate limits, timeouts, transient errors. These tools handle it so you don't have to.

Exponential backoff with jitter. Retry-After header awareness. Sync and async. Works with any LLM client.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-retry
from agent_retry import retry @retry(max_attempts=3, base_delay=1.0) def call_claude(): return client.messages.create(...)
Deadline and timeout enforcement. Set a wall-clock limit — the call raises TimeoutError if it runs long. Async-native.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-timeout
from agent_timeout import deadline with deadline(5.0): # 5 second limit result = client.chat(...)
Multi-provider failover. Primary LLM down → secondary kicks in automatically. Configurable error conditions.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-fallback
from agent_fallback import Fallback client = Fallback([ anthropic_client, # primary openai_client, # fallback ])
Rate limiting for API calls. Token bucket, sliding window, per-model limits. Prevents 429 errors before they happen.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-rate
from agent_rate import RateLimiter limiter = RateLimiter(requests_per_minute=60) with limiter: result = client.chat(...)

🔍 Observability

You can't fix what you can't see. Log every decision, trace every call, know when your APIs are down before your agents do.

Structured logging with sessions, spans, token tracking, cost calculation, and secret redaction. Zero dependencies.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-log
from agent_log import AgentLogger log = AgentLogger("my-agent") with log.session(task="summarize") as s: with s.span("llm_call") as span: span.tokens(prompt=500, completion=100)
Distributed tracing for multi-agent workflows. Propagate trace context across agent boundaries. OpenTelemetry-compatible output.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-trace
from agent_trace import tracer with tracer.span("research") as span: span.set_attr("model", "claude-opus-4-6") result = agent.run(task)
Health checks for AI APIs. Latency, availability, error rates — know your LLM is up before your agent tries to use it.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-health
from agent_health import HealthCheck check = HealthCheck(["anthropic", "openai"]) status = check.run() # {"anthropic": "up", ...} if status["anthropic"] != "up": fail_over()

🧪 Testing

89% of teams have observability. Only 52% run proper evals. Test your agents before they test your patience.

Mock LLM responses for tests. Fixture mode, record mode, playback mode. Zero real API calls during tests. Deterministic.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-mock
from agent_mock import MockProvider with MockProvider(responses=["Hello!", "Done."]) as mock: agent = MyAgent(client=mock.client) result = agent.run() # no real API calls
Evaluation framework for AI agents. Define test cases with expected behaviors. Score completions. Track regressions over time.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-eval
from agent_eval import Eval, Case suite = Eval([ Case(input="2+2?", expected="4"), Case(input="capital of France?", expected="Paris"), ]) results = suite.run(agent)

🛡️ Safety

Agents make irreversible mistakes. Enforce rules at the Python level — not the prompt level. Prompts get ignored; exceptions don't.

Enforce rules on tool calls before they execute. The agent cannot bypass a constraint — execution stops at the Python level.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-constraints
from agent_constraints import Constraints c = Constraints() c.deny("delete_file") # block specific tools c.allow_only(domains=["example.com"]) # restrict URLs # agent.run() will raise if agent tries to delete
Spending limits — wrap your client, set a dollar limit, get a Python exception when it's exceeded. No silent overruns.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-budget
from agent_budget import BudgetEnforcer client = BudgetEnforcer( client=anthropic.Anthropic(), budget_usd=1.00, ) # Raises BudgetExceeded at $1.00
Human-in-the-loop gates before irreversible actions. The agent pauses, describes what it's about to do, and waits for approval.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-gate
from agent_gate import gate @gate(action="send email") def send_email(to, subject, body): ... # Prompts user: "About to send email to..."
Security layer for agents. Prompt injection detection, secret scanning, output sanitization. Built after the OpenClaw supply chain crisis.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-shield
from agent_shield import Shield shield = Shield() safe = shield.check_input(user_message) # Detects: "ignore previous instructions" # Scans output for leaked secrets

💾 State

Most frameworks treat agents as stateless. They're not. Cache expensive calls, checkpoint long-running tasks, manage context windows that get too long.

LLM response caching. Wrap your Anthropic or OpenAI client — identical prompts return cached results. Know exactly how much you saved.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-cache
from agent_cache import CachedClient client = CachedClient(anthropic.Anthropic()) # First call: real API. Second call: $0. r1 = client.messages.create(...) r2 = client.messages.create(...) # cached
State persistence — save checkpoints, resume after failure, rollback to any point. Fixes "agentic amnesia": agents that crash and restart from scratch.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-checkpoint
from agent_checkpoint import Checkpointer cp = Checkpointer("./checkpoints") cp.save("step_1", state) # Later, after crash: state = cp.load("step_1") # resume here
Context window management. Long conversations degrade LLM quality — models start contradicting themselves around turn 30. agent-context prunes intelligently.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-context
from agent_context import ContextManager ctx = ContextManager(max_tokens=8000) messages = ctx.prune(conversation) # Keeps most recent + most relevant

🔀 Pipeline

Route to the right model, validate structured output, manage prompts at scale. The plumbing that keeps multi-agent systems sane.

Route LLM calls to different models based on rules. Use cheap models for simple tasks, expensive ones for complex — automatically.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-router
from agent_router import Router router = Router() router.route("simple", model="haiku") router.route("complex", model="opus") # Routes based on task complexity
Structured output validation. LLMs hallucinate formats. agent-schema validates responses against a schema and retries on failure.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-schema
from agent_schema import validate_json result = validate_json( response=llm_output, schema={"name": str, "score": int}, ) # retries if invalid
Streaming LLM response handling. Collect chunks, track tokens in real time, handle cancellation cleanly, detect stream errors.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-stream
from agent_stream import StreamCollector with StreamCollector() as sc: for chunk in client.stream(...): sc.add(chunk) print(sc.text, sc.tokens)
Prompt templates without LangChain. Variable substitution, versioning, A/B testing support. Prompts are code — treat them that way.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-prompt
from agent_prompt import Prompt p = Prompt("Summarize {document} in {n} words.") text = p.render(document=doc, n=100) # Version control your prompts
Agent identity for multi-agent systems. Sign agent outputs, verify provenance, prevent impersonation. Only 22% of teams currently do this.
pip install git+https://github.com/0-co/company.git#subdirectory=products/agent-id
from agent_id import AgentIdentity identity = AgentIdentity("planner-v1") signed = identity.sign(output) # Downstream agent verifies: identity.verify(signed) # raises if tampered