Skip to main content

RunAgents Python SDK — deploy, manage, and build AI agents

Project description

RunAgents Python SDK

Everything you need to build, test, and deploy AI agents on RunAgents — in one package.

Install

pip install runagents        # Core SDK + CLI + runtime (zero deps)
pip install runagents[mcp]   # + MCP server for AI coding assistants
pip install runagents[dev]   # + hot-reload for local dev

Quickstart

runagents init my-agent      # Scaffold a project
cd my-agent
runagents dev                # Local dev server with mock tools
runagents deploy             # Ship to the platform

Python API

Client — manage platform resources

from runagents import Client

client = Client()  # reads ~/.runagents/config.json + env vars

agents = client.agents.list()
tools = client.tools.list()
runs = client.runs.list(agent="payment-agent")

result = client.agents.deploy(
    name="my-agent",
    source_files={"agent.py": open("agent.py").read()},
    required_tools=["stripe-api"],
    llm_configs=[{"provider": "openai", "model": "gpt-4o-mini", "role": "default"}],
)

Agent — write agent code

from runagents import Agent, tool

agent = Agent()  # reads TOOL_URL_*, LLM_GATEWAY_URL, LLM_MODEL from env

# Call a platform tool (mesh handles auth)
result = agent.call_tool("echo-tool", "/echo", {"message": "hello"})

# Chat via LLM gateway
response = agent.chat("What is 2+2?", tools=[...])

# Custom handler (Tier 2)
def handler(request, ctx):
    message = request["message"]
    result = agent.chat(message)
    return result["choices"][0]["message"]["content"]

@tool decorator

from runagents import tool

@tool(name="calculator", description="Evaluate math expressions")
def calculate(expression: str) -> str:
    return str(eval(expression))

CLI Commands

Command Description
runagents init [name] Scaffold a new agent project
runagents dev Start local dev server with mock tools
runagents deploy Deploy an agent (delegates to Go CLI)
runagents agents list List agents
runagents tools list List tools
runagents runs list List runs
runagents config Manage configuration

Runtime

The runtime provides the HTTP server for deployed agents — tool calling loop, SSE streaming, health checks, OAuth consent, and JIT approvals. It runs automatically inside the platform; for local development use runagents dev.

# Backward compatible — still works
import runagents_runtime

MCP Server

pip install runagents[mcp]
runagents-mcp  # starts on stdio

14 tools for AI coding assistants (Claude Code, Cursor, Codex). See AI Assistant Setup.

Configuration

Reads from ~/.runagents/config.json with env var overrides:

Variable Description Default
RUNAGENTS_ENDPOINT Platform API URL http://localhost:8092
RUNAGENTS_API_KEY API key or workspace key
RUNAGENTS_NAMESPACE Target namespace default

Documentation

License

Apache-2.0

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

runagents-0.2.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

runagents-0.2.0-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file runagents-0.2.0.tar.gz.

File metadata

  • Download URL: runagents-0.2.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for runagents-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8229780b8beb17145e7b81cf2a11d4b7cd725b550537fa42fce5822fe8db7f37
MD5 a47deb388da61235c57f8847b17ac144
BLAKE2b-256 0bb1658825070c503bfc4b4fff9917c545d11c2aef59ce09b3099c67cbad21ea

See more details on using hashes here.

File details

Details for the file runagents-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: runagents-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for runagents-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02fbf114206d30c8cdb80ca8ee5eb6f26824520e3ca6fd940ceaaa0ef487d564
MD5 65345b5e9f395a3aa823275c0aeb463b
BLAKE2b-256 04a3077fb3d3daff0953212e3429e08766980f47c520c42ef62f41892d20d729

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