Python SDK for h5i orchestra — define-by-run agent orchestration journaled on the git-backed team event log
Project description
h5i-python: Python SDK for Programmable Multi-Agent Orchestration
Claude Code, Codex, and other coding agents have different strengths. However, naive multi-agent orchestration such as simply launching several agents in parallel or allowing them to exchange messages does not define a reproducible development process. A real workflow must specify:
- who implements;
- who reviews whom;
- when an agent must revise its work;
- which candidates are independently tested;
- how the winner is selected; and
- when the selected change is applied to the original branch.
h5i-python is the Python SDK for the h5i orchestra engine. This SDK lets you define and execute multi-agent coding workflows across Claude Code, Codex, and other runtimes as ordinary Python programs.
Each agent works inside its own sandboxed Git worktree, so it cannot overwrite the original checkout or another agent's work. Agent turns produce Git-backed artifacts that can be reviewed, revised, neutrally verified, compared, selected, and applied as one auditable workflow.
Install
Install the h5i engine:
curl -fsSL https://raw.githubusercontent.com/h5i-dev/h5i/main/install.sh | sh
Install the Python SDK from GitHub:
pip install "git+https://github.com/h5i-dev/h5i-python.git"
Quickstart
Create ensemble.py inside the Git repository the agents should modify. This workflow let Claude and Codex independently implement the same task, review and improve each other’s work, and then select the better result.
from h5i.orchestra import Conductor
async def main(task):
async with Conductor(repo=".", run="demo-task", launcher="resident") as c:
claude = await c.hire("claude-agent", runtime="claude")
codex = await c.hire("codex-agent", runtime="codex")
# Have both agents implement the task independently and in parallel
claude_work, codex_work = await asyncio.gather(claude.work(task), codex.work(task))
await c.freeze() # Seal the round, ensuring that neither agent influenced the other beforehand
# Have each agent review the other's work
await asyncio.gather(codex.review(claude_work), claude.review(codex_work))
# Verify each submission in a fresh, neutral sandbox
await c.verify(claude_work, ["pytest", "--quiet"])
await c.verify(codex_work, ["pytest", "--quiet"])
verdict = await c.judge() # Select the smallest diff among the submissions that pass all tests
print("winner:", verdict.selected_submission)
asyncio.run(main("implement quicksort in python with unit test"))
Run it as a normal Python program:
python ensemble.py
With the default launcher="resident", h5i automatically starts the agent sessions through tmux.
Examples
For example, you can program:
- ask Claude and Codex to implement the same task independently, have them review and improve each other's work, and select the smallest candidate that passes the tests;
- let Claude Fable and Codex GPT-5.6 Sol iteratively refine a design, then hand the agreed design to Claude Opus for implementation; or
- repeat a Fable-design/Sol-review loop ten times, ask Opus to implement the result, and invoke Sol to repair the implementation only when Fable rejects it.
See examples/ for complete scores, including:
- arena_score.py: independent arena ranking;
- ensemble_score.py: mutual-review ensembles;
- debate_then_build.py: architect-to-implementer pipelines;
- review_escalation.py: conditional review escalation;
- judge_panel_score.py: LLM judge panels;
- tournament.py: tournament brackets; and
- custom_control_flow.py: custom Python control flow.
License
Apache-2.0
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 h5i_orchestra-0.1.0.tar.gz.
File metadata
- Download URL: h5i_orchestra-0.1.0.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e4bc566d8a4da787e851c27c1cdf609f8098f20034efb5acb2d5111e7f2947c
|
|
| MD5 |
08b5da1243000d453cdeb303d5298394
|
|
| BLAKE2b-256 |
6f41dd129408fd9a95a3e215df11c405eb5c2e0f081edfdf5bcb4e121b3ceb8c
|
Provenance
The following attestation bundles were made for h5i_orchestra-0.1.0.tar.gz:
Publisher:
release.yaml on h5i-dev/h5i-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
h5i_orchestra-0.1.0.tar.gz -
Subject digest:
6e4bc566d8a4da787e851c27c1cdf609f8098f20034efb5acb2d5111e7f2947c - Sigstore transparency entry: 2176391650
- Sigstore integration time:
-
Permalink:
h5i-dev/h5i-python@168381f2fdab9f1a2922bf3e2c144bad9278779a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/h5i-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@168381f2fdab9f1a2922bf3e2c144bad9278779a -
Trigger Event:
push
-
Statement type:
File details
Details for the file h5i_orchestra-0.1.0-py3-none-any.whl.
File metadata
- Download URL: h5i_orchestra-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f597ad54d55f69a55cbb8a4a65d2a8d50a35b98789a8ff7aa438d2baa7fa73b1
|
|
| MD5 |
e9d645a404f32685cd92c9c907a5e57e
|
|
| BLAKE2b-256 |
1922c52bc5c442408c2d4e0e238548d7b970d12a8eef76fce60ab68f1706af17
|
Provenance
The following attestation bundles were made for h5i_orchestra-0.1.0-py3-none-any.whl:
Publisher:
release.yaml on h5i-dev/h5i-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
h5i_orchestra-0.1.0-py3-none-any.whl -
Subject digest:
f597ad54d55f69a55cbb8a4a65d2a8d50a35b98789a8ff7aa438d2baa7fa73b1 - Sigstore transparency entry: 2176391903
- Sigstore integration time:
-
Permalink:
h5i-dev/h5i-python@168381f2fdab9f1a2922bf3e2c144bad9278779a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/h5i-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@168381f2fdab9f1a2922bf3e2c144bad9278779a -
Trigger Event:
push
-
Statement type: