Skip to main content

Brutalist hierarchy orchestration - AI agents compete for leadership in the Arena

Project description

ORC!! Battle for Control

ORC

Orchestration by Ruthless Competition

License Python PyPI CI Status

Standard orchestration is weak. Static hierarchies are boring.
In ORC, leadership is earned in the Arena.


30 Seconds to Combat

pip install orc-arena
import asyncio
from orc import TheArena, Warrior, Elder

# Create your warriors
grog = Warrior(
    name="Grog",
    llm_client="gpt-4o",                          # Standard AI model
    system_prompt="You are a senior backend dev",  # Standard agent prompt
    capabilities=["code_review", "debugging"],
    domains=["backend", "python"],
)

thrall = Warrior(
    name="Thrall",
    llm_client="claude-sonnet-4-20250514",
    system_prompt="You are an infrastructure architect",
    capabilities=["system_design", "scaling"],
    domains=["backend", "infrastructure"],         # Overlaps with Grog!
)

# The Elder judges all combat
elder = Elder(judge=MetricsJudge())

# Enter the Arena
arena = TheArena(warriors=[grog, thrall], elder=elder)
result = await arena.battle("Optimize the database connection pooling")

print(f"Winner: {result.winner}")

The wrapper is ORC-themed, but the arguments are standard AI concepts. Warrior = Agent. Elder = Judge. TheArena = Orchestrator.


What is ORC?

ORC (Orchestration by Ruthless Competition) is a multi-agent framework where AI agents compete for leadership through trials.

Unlike traditional orchestrators where a static "manager" routes tasks forever, ORC uses competitive dynamics:

  1. A task enters The Arena
  2. Warriors (agents) that claim the domain compete
  3. The Elder (judge) evaluates the combatants
  4. The winner becomes The Warchief — the leader for that domain
  5. The Warchief holds power until successfully challenged

It is an ever-changing, competition-based orchestration system.

┌─────────────────────────────────────────────────────────────────┐
│                         THE ARENA                               │
│                                                                 │
│    ┌───────────┐     challenges      ┌───────────┐             │
│    │ Warrior A │ ──────────────────> │ Warrior B │             │
│    │(Contender)│                     │ (WARCHIEF)│             │
│    └───────────┘                     └───────────┘             │
│         │                                 │                     │
│         │          TRIAL BY TASK          │                     │
│         │    ┌───────────────────────┐    │                     │
│         └───>│  Same task, both      │<───┘                     │
│              │  attempt solution     │                          │
│              └──────────┬────────────┘                          │
│                         │                                       │
│                         v                                       │
│              ┌───────────────────────┐                          │
│              │      THE ELDER        │                          │
│              │  Evaluates quality    │                          │
│              └──────────┬────────────┘                          │
│                         │                                       │
│              Winner becomes / stays WARCHIEF                    │
└─────────────────────────────────────────────────────────────────┘

The Reign of the Warchief

Once the Elder declares a victor, the winning Warrior is elevated to Warchief. They hold domain leadership until defeated.

  • Dynamic Leadership — No hard-coded orchestrators. The best agent for the task takes command.
  • Continuous Improvement — Agents must defend their position. Complacency means dethronement.
  • Reputation System — Track agent performance across domains over time.
  • Forced Rotation — Even dominant Warchiefs are rotated after too many consecutive defenses.
# Check who rules each domain
warchief = arena.get_warchief("backend")
print(f"Backend Warchief: {warchief}")

# Get the full leaderboard
leaderboard = arena.get_leaderboard("backend", limit=5)
for entry in leaderboard:
    crown = "👑" if entry["is_warlord"] else "  "
    print(f"  {crown} {entry['agent']}: rep={entry['reputation']:.2f}")

Judges (The Elders)

Elders evaluate trial outcomes. Three built-in options:

from orc import LLMJudge, MetricsJudge, ConsensusJudge

# LLM-based — an AI judges the AI
elder = Elder(judge=LLMJudge(llm, criteria=["accuracy", "completeness", "efficiency"]))

# Metrics-based — cold, hard numbers
elder = Elder(judge=MetricsJudge(weights={"accuracy": 0.5, "latency": 0.3, "cost": 0.2}))

# Consensus — multiple judges vote
elder = Elder(judge=ConsensusJudge([judge1, judge2, judge3]))

Challenge Strategies

Warriors can use different strategies for when to challenge the Warchief:

from orc import AlwaysChallenge, ReputationBased, CooldownStrategy, SpecialistStrategy

# Berserker — always challenges
grog.challenge_strategy = AlwaysChallenge()

# Calculating — only challenges if reputation is higher
thrall.challenge_strategy = ReputationBased(threshold=0.1)

# Patient — waits after losses, exponential backoff
sylvanas.challenge_strategy = CooldownStrategy(base_cooldown=60)

# Specialist — only challenges in specific domains
gazlowe.challenge_strategy = SpecialistStrategy(specialties=["engineering"])

Why ORC?

Traditional Orchestration ORC
Central coordinator decides Leadership emerges from competition
Static role assignment Dynamic, earned leadership
Single point of failure Any agent can lead
No quality pressure Continuous improvement through trials
One agent does everything Best agent for each domain rises

Use Cases

  • Agent A/B Testing — Compare agent implementations head-to-head on real tasks
  • Model Evaluation — Pit GPT-4o vs Claude vs local models, get a leaderboard
  • Self-Optimizing Systems — The best agent for each domain naturally rises to the top
  • Research — Study emergent hierarchies in multi-agent systems

Two APIs, One Engine

ORC provides two ways to use it:

Themed API (fun)

from orc import TheArena, Warrior, Elder, Warchief

grog = Warrior(name="Grog", llm_client="gpt-4o", system_prompt="...")
elder = Elder(judge=MetricsJudge())
arena = TheArena(warriors=[grog], elder=elder)
result = await arena.battle("task")

Standard API (professional)

from orc import Arena, ArenaConfig, MetricsJudge

arena = Arena(
    agents=[my_agent_1, my_agent_2],
    judge=MetricsJudge(),
    config=ArenaConfig(challenge_probability=0.3),
)
result = await arena.process("task")

Same engine. Same performance. Pick your style.


Installation

# Core (no LLM dependencies)
pip install orc-arena

# With LLM support
pip install orc-arena[openai]      # OpenAI
pip install orc-arena[anthropic]   # Anthropic
pip install orc-arena[ollama]      # Ollama (local)
pip install orc-arena[all]         # Everything

Docker

docker build -t orc .
docker run orc

Development

git clone https://github.com/Lumi-node/orc.git
cd orc

pip install -e ".[dev]"
pytest tests/ -v

# Run examples
python examples/quick_battle.py
python examples/full_campaign.py

Built With

ORC is powered by dynabots-core — a zero-dependency protocol foundation for multi-agent systems. ORC is the first in a family of orchestration frameworks, each exploring a different paradigm for coordinating AI agents.

License

Apache 2.0 - See LICENSE for details.

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

orc_arena-0.1.0.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

orc_arena-0.1.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file orc_arena-0.1.0.tar.gz.

File metadata

  • Download URL: orc_arena-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for orc_arena-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72eabe3f26061f155607e0e9f286b06e16fa5e66ed6e3633fcd4f52b7e8e99f9
MD5 bacb8b379657a5dc16f496ac805b6157
BLAKE2b-256 84697af7f88c27e55b52c3f7d47dab90786a955688bca975aca78367349a233d

See more details on using hashes here.

File details

Details for the file orc_arena-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: orc_arena-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for orc_arena-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c146d83c5c3244abcf276e8db8803f5fee009c2492edce14e4e827e88b92cdf
MD5 911e0a8302d12e10082a530f74da6e7c
BLAKE2b-256 454067dc1582bd6f5252b1be19efe93382bab2e8596058f31a450762b3a7a96b

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