Skip to main content

Pitaya — an orchestrator of AI coding agents (e.g., Claude Code, Codex CLI) with pluggable and custom strategies

Project description

🎯 Pitaya

Orchestrate AI coding agents (Claude Code, Codex CLI) with pluggable strategies and a clean TUI.

Python 3.13 Docker License

Note: Pitaya is in public beta. Interfaces and defaults may evolve.

What It Does

  • Runs multiple agents in parallel and helps you pick the best result
  • Uses per‑task branches in your repo to keep alternatives safe and reviewable
  • Displays a clean, adaptive TUI with live progress, costs, and tokens
  • Supports custom Python strategies for multi‑stage workflows

Built‑in strategies: simple, scoring, best‑of‑n, iterative, bug‑finding, doc‑review

Demo

Watch a short video demo of the TUI and orchestration:

https://github.com/user-attachments/assets/3c426890-4c5a-4765-b594-adfd09d3810b

Install

pip install pitaya
# or
pipx install pitaya
# or
uv tool install pitaya

Build the Docker image

Pitaya runs agents inside Docker. You need a Docker image that contains the agent CLI(s) you plan to use:

  • claude (for --plugin claude-code)
  • codex (for --plugin codex)

You can build a ready‑to‑use image from this repository’s Dockerfile:

git clone https://github.com/tact-lang/pitaya
cd pitaya
docker build -t pitaya-agents:latest .

Prefer a custom image? Use any base you like as long as it includes the required CLI(s) above. You can point Pitaya to a different image via --docker-image or set runner.docker_image in pitaya.yaml.

Authenticate:

  • Claude Code: set CLAUDE_CODE_OAUTH_TOKEN (subscription) or ANTHROPIC_API_KEY
  • Codex CLI: export the API key for your provider (OPENAI_API_KEY, OPENROUTER_API_KEY, GROQ_API_KEY, etc.). Optional base URLs (such as OPENROUTER_BASE_URL) are detected automatically.

Quickstart

From the root of a git repo:

pitaya "Create a HELLO.txt file with 'Hello from Pitaya' text in it and commit it"

More examples:

# Parallel candidates with scoring (pick the best)
pitaya "Write the funniest and most original joke possible" --strategy best-of-n -S n=5

# Iterative refine (generate → review → refine)
pitaya "Write the funniest and most original joke possible" --strategy iterative -S iterations=3

# Headless JSON output (pure NDJSON)
pitaya "task" --json

OpenRouter (Codex plugin) example:

pitaya "Write the funniest and most original joke possible" \
  --plugin codex \
  --model "openai/gpt-5" \
  --api-key "$OPENROUTER_API_KEY" \
  --base-url https://openrouter.ai/api/v1

Documentation

Configuration (peek)

Optional pitaya.yaml to set defaults:

model: sonnet
plugin_name: claude-code
orchestration:
  max_parallel_instances: auto
  branch_namespace: hierarchical

CLI overrides config; -S key=value only affects the selected strategy.

Results & Logs

  • Logs: logs/<run_id>/events.jsonl and JSONL component logs (orchestration.jsonl, runner.jsonl, tui.jsonl, other.jsonl)
  • Results: results/<run_id>/ (summary.json, metadata.json, branches.txt, instance_metrics.csv, instances/.json)
  • Branches: pitaya/<strategy>/<run_id>/k<short8> (hierarchical namespace)
  • Resume: pitaya --resume <run_id>

Contributing

Issues and PRs are welcome. This project is evolving—feedback on UX, strategies, and plugin support is especially helpful.

Dev quickstart:

git clone https://github.com/tact-lang/pitaya
cd pitaya
python -m venv .venv && source .venv/bin/activate
pip install -U pip && pip install -e .

# Optional dev tools
pip install -U ruff black mypy pytest pytest-asyncio

Changelog

License

MIT License — see LICENSE.

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

pitaya-0.3.0.tar.gz (222.2 kB view details)

Uploaded Source

Built Distribution

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

pitaya-0.3.0-py3-none-any.whl (220.1 kB view details)

Uploaded Python 3

File details

Details for the file pitaya-0.3.0.tar.gz.

File metadata

  • Download URL: pitaya-0.3.0.tar.gz
  • Upload date:
  • Size: 222.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.19

File hashes

Hashes for pitaya-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e0859b6342ce733a3058dcaafffcf7fdadb50b84f6bb6aabaf9da36f738886fa
MD5 2983ac1218dc7fd3ebb31bbb5fadc77f
BLAKE2b-256 7d14650710972e7a780331afde7f45d6eec3903e1e1e472d0d35393a871dfa3b

See more details on using hashes here.

File details

Details for the file pitaya-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pitaya-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 220.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.19

File hashes

Hashes for pitaya-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b992e89d9563aac28409d5ac42bd7e5ca84cfe16f94d4ffe8d988dbc95c2d5a3
MD5 d2cd2b19eab1b73061a6b440deca15f5
BLAKE2b-256 326c032a7458e40a8537e2409a288113b0382589313443504377c256c3de5ba9

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