Skip to main content

Build, deploy, and monetize AI agents

Project description

agentroute (Python SDK)

Build, deploy, and monetize AI agents. Phase 1 (Foundation) ships the core Agent + @agent.tool loop against any OpenAI-compatible model (OpenRouter default, plus Ollama and custom HTTP endpoints).

Install

pip install agentroute

Quick start

Layer 0 — three-line hello world

from agentroute import Agent

agent = Agent("my-bot", model="claude-sonnet-4")
print(agent.run("Tell me a joke"))

Set AGENTROUTE_API_KEY (or OPENROUTER_API_KEY) to an OpenRouter key. One key works for every model string (claude-sonnet-4, gpt-4o, gemini-2.0-flash, deepseek-v3, ...).

Layer 1 — add a tool

from agentroute import Agent

agent = Agent("weather-bot", model="claude-sonnet-4")

@agent.tool
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return "Sunny, 22C"

print(agent.run("What's the weather in Zurich?"))

The SDK reads the function's name, type hints, and docstring — no extra schema is required.

Async

import asyncio
from agentroute import Agent

async def main() -> None:
    agent = Agent("bot", model="claude-sonnet-4")
    result = await agent.arun("hi")
    print(result.output)

asyncio.run(main())

Local models (Ollama)

agent = Agent("local", model="ollama/llama3")
print(agent.run("hi"))

Development

cd packages/python
pip install -e '.[dev]'
pytest            # unit tests
pytest -m integration  # live tests (requires API key)
ruff check src tests
mypy src/agentroute

Phase 1 scope: Agent, Tool, Context, Result, Event, ModelCloud, resolve_model(), Config, exceptions. Memory, structured output, multi-agent, guards, MCP, A2A, and deployment land in later phases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentroute-1.0.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentroute-1.0.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file agentroute-1.0.0.tar.gz.

File metadata

  • Download URL: agentroute-1.0.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for agentroute-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e5c3ce2e1017abf341bcfa55c45ec0d585de703211574d22ab3353a32651c66
MD5 f3f5bfdd3c4d59d68a686e0e5802825b
BLAKE2b-256 ad914d5b56ea7e6b8d3b4ec907949330457fa46df4c1f685926c3f822021a1d7

See more details on using hashes here.

File details

Details for the file agentroute-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: agentroute-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for agentroute-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8e27ab46b98cb08c0a4952cfe1f5f41c297cc9983c061192e9dde4eaf374f4
MD5 354694946eafd63807b02280e0d64387
BLAKE2b-256 93b8152e2d2a013f59e23f7d2170f2a0bb23566243b2069349bb35ed44679103

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page