Model-agnostic AI agent orchestration platform with unified interface for OpenAI, Anthropic, Google, xAI, Mistral and more
Project description
Design Arena Agent Runner
A model-agnostic, framework-agnostic agent harness that enables autonomous AI agents across any LLM provider.
Beta Version - Currently in active development.
Features
- Turn Any Model Into an Agent: Configure any model as a coding agents
- Flexible Configuration: Set up agent behavior, tools, and constraints however you need
- CLI or Python API: Use as a command-line tool or integrate into your applications
- Powerful Tooling: File operations, code editing, search, bash execution
- Smart Context Management: Automatic context window handling and compaction
- Workspace Isolation: Secure file operations with command validation
Installation
Prerequisites
Python:
- Python 3.11 or higher
Install Agent Runner
Option 1: From PyPI (recommended)
pip install agent-runner
Option 2: From source
git clone https://github.com/Design-Arena/agent-runner.git
cd agent-runner
pip install -e .
With optional dependencies:
# Development tools (testing, linting)
pip install agent-runner[dev]
# Optional tools (screenshot, patch tools)
pip install agent-runner[tools]
# Additional providers (Mistral)
pip install agent-runner[providers]
# Everything
pip install agent-runner[all]
For screenshot tool (optional):
pip install agent-runner[tools]
playwright install chromium
For search functionality (recommended):
Install ripgrep for fast code search:
# macOS
brew install ripgrep
# Ubuntu/Debian
sudo apt-get install ripgrep
Configure API Keys
Set up your API keys as environment variables. You only need keys for the providers you'll use.
Create a .env file in your project directory:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...
MISTRAL_API_KEY=...
XAI_API_KEY=...
KIMI_API_KEY=...
ZAI_API_KEY=...
Or set environment variables directly:
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
# etc.
Quick Start
Basic Usage
Run a single task:
agentrunner run "Create a Python calculator with add and multiply functions"
agentrunner run "Build a FastAPI todo app" --verbose # See live events
Interactive chat:
agentrunner chat
Review code (read-only, no modifications):
agentrunner review .
agentrunner review src/main.py
Model management:
agentrunner models # List all available models
agentrunner run "Build a REST API" --model claude-sonnet-4-5-20250929
agentrunner run "Analyze this code" --model gemini-2.5-pro
Session management:
agentrunner sessions list # List all sessions
agentrunner sessions show <id> # View session details
agentrunner sessions show <id> --events # View with full event log
agentrunner sessions delete <id> # Delete a session
Note: There are two types of sessions:
sessions(plural) - CLI session history with full event tracessession(singular) - Agent conversation sessions that can be resumed
Configuration:
agentrunner config list # List profiles
agentrunner config show # Show current profile
agentrunner config set-default --model claude-sonnet-4-5-20250929 # Set default model
Usage from Python
Basic example:
import asyncio
import os
from agentrunner.core.config import AgentConfig
from agentrunner.core.factory import create_agent
from agentrunner.providers.base import ProviderConfig
async def main():
# Set your API key
os.environ['OPENAI_API_KEY'] = "your-api-key"
# Configure agent behavior (orchestration settings)
agent_config = AgentConfig(
max_rounds=50, # Maximum number of agent turns
tool_timeout_s=120 # Timeout for tool execution
)
# Configure the LLM provider (model settings)
provider_config = ProviderConfig(
model="gpt-5-codex", # Model to use
temperature=0.7, # Sampling temperature
max_tokens=4096 # Max tokens in response
)
# Create the agent
agent = create_agent(
workspace_path=".", # Working directory
provider_config=provider_config,
agent_config=agent_config,
profile="default" # Optional profile name
)
# Run a task
result = await agent.process_message(
"Create a REST API for user management with FastAPI"
)
print(f"Result: {result.content}")
if __name__ == "__main__":
asyncio.run(main())
Using different providers:
# Using Claude Sonnet 4.5
os.environ['ANTHROPIC_API_KEY'] = "your-api-key"
provider_config = ProviderConfig(
model="claude-sonnet-4-5-20250929",
temperature=0.7
)
Available Tools
Agent Runner provides a comprehensive set of tools that work consistently across all LLM providers:
File Operations
read_file- Read file contentswrite_file- Write content to filescreate_file- Create new filesdelete_file- Delete filesedit_file- Edit files with search/replacemulti_edit- Multiple edits in one operationinsert_lines- Insert lines at specific positionsbatch_create_files- Create multiple files at once
Search
grep- Fast code search using ripgrep
Execution & Project Management
bash- Execute bash commandsscaffold_project- Generate project templatesclean_workspace- Clean up workspace directory
Media & Generation
take_screenshot- Capture screenshots (requires Playwright)fetch_image- Fetch images from URLsgenerate_image- Generate AI imagesfetch_video- Fetch videos from URLsgenerate_video- Generate AI videos
Deployment
deploy_to_vercel- Deploy to Vercel
Note: All file operations are restricted to the workspace directory. Bash commands are validated against a whitelist and require user confirmation for dangerous operations, but exercise caution.
Supported Providers
Agent Runner provides a unified interface for multiple LLM providers:
OpenAI • Anthropic • Google • xAI • Mistral • Moonshot AI (Kimi) • Z.AI
See src/agentrunner/providers/registry.py for the complete list of available models.
Security Note
Agent Runner executes code and commands within your specified workspace directory. While file operations are restricted to the workspace, the agent can modify/delete files within it and execute bash commands. Always use a dedicated directory for agent work, exercise caution when pointing it at sensitive directories, and use version control to track changes.
Configuration
Environment Variables
Setting defaults via CLI:
# Set default model
agentrunner config set-default --model claude-sonnet-4-5-20250929
# Set default temperature
agentrunner config set-default --temperature 0.8
# Set multiple defaults at once
agentrunner config set-default --model gpt-5-codex --temperature 0.7
This creates/updates a .env file in your current directory.
Or set them manually in .env file:
Provider defaults (model, temperature, etc.):
# Default model (if not specified with --model)
export AGENTRUNNER_MODEL="claude-sonnet-4-5-20250929"
# Default temperature (if not specified with --temperature)
export AGENTRUNNER_TEMPERATURE="0.7"
# Max tokens for responses (optional)
export AGENTRUNNER_MAX_TOKENS="4096"
Agent behavior:
# Maximum agentic loop iterations
export AGENTRUNNER_MAX_ROUNDS=100
# Tool execution timeout in seconds
export AGENTRUNNER_TOOL_TIMEOUT=180
Profile Configuration
Profiles control agent orchestration behavior. Create JSON files in ~/.agentrunner/profiles/:
Example: ~/.agentrunner/profiles/default.json
{
"max_rounds": 50,
"tool_timeout_s": 120,
"response_buffer_tokens": 1000,
"allow_streaming": true
}
Example: ~/.agentrunner/profiles/thorough.json (for complex tasks)
{
"max_rounds": 100,
"tool_timeout_s": 300
}
Use with: agentrunner run "task" --profile thorough
Note: Model selection (--model), temperature (--temperature), and token limits (--max-tokens) are specified via CLI flags, not in profiles.
Project Configuration
Create .agentrunner/config.json in your project to override profile settings per-project:
{
"max_rounds": 100,
"tool_timeout_s": 180
}
Usage Examples
Create a New Project
mkdir ~/my-portfolio && cd ~/my-portfolio
agentrunner run "Create a cyberpunk-themed portfolio website with neon accents, animated background, project showcase grid, and contact form using Next.js, shadcn/ui, and Tailwind"
Code Review & Refactoring
cd ~/my-project
agentrunner run "Review src/api.py for security issues and refactor to use async/await"
agentrunner review src/api.py
Interactive Development
agentrunner chat
> Add error handling to all API endpoints
> Write unit tests for the new error handlers
> Run the tests with pytest
> quit
Debugging
agentrunner run "The tests in test_api.py are failing. Investigate and fix the bugs"
Generate Images & Media
agentrunner run "Generate a futuristic cityscape at sunset with neon lights and flying cars, then set it as the hero section background image on my landing page"
Architecture
agentrunner/
├── core/ # Agent logic, session management, config
├── providers/ # LLM provider integrations
├── tools/ # Tool implementations
├── security/ # Command validation, sandboxing
└── cli/ # Command-line interface
Key Components:
- Agent: Orchestrates LLM interactions and tool execution
- Providers: Unified interface for LLM APIs
- Tools: Extensible tool system
- Session: Conversation history persistence
- Context Strategy: Context window management
Troubleshooting
Command Not Found
If agentrunner command is not found:
# Make sure you're in the virtual environment
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windows
# Reinstall if needed
pip install -e .
API Key Issues
# Verify API key is set
echo $OPENAI_API_KEY
# Source .env file if using one
cd /path/to/agentrunner
set -a && source .env && set +a
Session Management
CLI Session History:
# List all CLI sessions (with event traces)
agentrunner sessions list
# View session details and messages
agentrunner sessions show <session-id>
# View with full event log (tool calls, file changes, etc.)
agentrunner sessions show <session-id> --events
# Delete a CLI session
agentrunner sessions delete <session-id>
Agent Conversation Sessions:
# List agent sessions (resumable conversations)
agentrunner session list
# Load and resume a conversation
agentrunner session load <session-id>
# Delete an agent session
agentrunner session delete <session-id>
Permission Errors
Agent Runner restricts file operations to the workspace directory for safety. Make sure you're running from the correct directory and have write permissions. Always use a dedicated workspace directory, not your home or system directories.
Run Tests
# All tests
pytest
# With coverage
pytest --cov=agentrunner --cov-report=html
# Specific test
pytest tests/unit/test_agent.py
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_runner-0.2.0.tar.gz.
File metadata
- Download URL: agent_runner-0.2.0.tar.gz
- Upload date:
- Size: 132.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3765f38ec567fa9998e5cabc506ae74555707451ebdcd10dc32f1462e3b9857
|
|
| MD5 |
fcf959a529e04f0030f0e881c8ba7efd
|
|
| BLAKE2b-256 |
5f744f3dd9f61adb8356f126aad70b9238872448eb4fba236c3a6a8ff5af822b
|
Provenance
The following attestation bundles were made for agent_runner-0.2.0.tar.gz:
Publisher:
python-publish.yml on Design-Arena/agent-runner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_runner-0.2.0.tar.gz -
Subject digest:
c3765f38ec567fa9998e5cabc506ae74555707451ebdcd10dc32f1462e3b9857 - Sigstore transparency entry: 725067667
- Sigstore integration time:
-
Permalink:
Design-Arena/agent-runner@2a9b28ce8c5e393a8bc236d6ee16a10a3eafaffa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Design-Arena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2a9b28ce8c5e393a8bc236d6ee16a10a3eafaffa -
Trigger Event:
release
-
Statement type:
File details
Details for the file agent_runner-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agent_runner-0.2.0-py3-none-any.whl
- Upload date:
- Size: 167.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d889b184e4de8b27d18d135513132740f2f745a0898ddd3d6273233eb9dcd0
|
|
| MD5 |
51c77456dd8a85e5d0126c863eaf8c09
|
|
| BLAKE2b-256 |
d25fcd80769e88e02da13d806104b9c3456655c40435f443be0299f9b3f029ef
|
Provenance
The following attestation bundles were made for agent_runner-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on Design-Arena/agent-runner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_runner-0.2.0-py3-none-any.whl -
Subject digest:
60d889b184e4de8b27d18d135513132740f2f745a0898ddd3d6273233eb9dcd0 - Sigstore transparency entry: 725067672
- Sigstore integration time:
-
Permalink:
Design-Arena/agent-runner@2a9b28ce8c5e393a8bc236d6ee16a10a3eafaffa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Design-Arena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@2a9b28ce8c5e393a8bc236d6ee16a10a3eafaffa -
Trigger Event:
release
-
Statement type: