Multi-turn agent benchmarking with ACP — run any agent, any model, any provider.
Project description
What
BenchFlow is a universal environment framework: it runs AI agents against task environments and scores them through one hardened contract. A benchmark is just a frozen environment — point BenchFlow at any of them, drive it with any ACP agent, and run single-agent, multi-agent, or multi-round patterns over the same Scene-based lifecycle.
- Run any benchmark — three-layer routing runs supported frameworks natively, translates unknown formats and proves equivalence with a parity gate, or runs a bespoke harness as-is; every layer emits one scored-trajectory contract. See Run any benchmark
- Any ACP agent — Gemini CLI, Claude Code, Codex, OpenCode, OpenHands, Pi, or your own
- Single + multi + progressive — single-agent / multi-agent (coder + reviewer, simulated user) / multi-round with a Python
BaseUsercallback - Loop strategies — wrap any agent in a
--loop-strategy(verify-retry,self-review); every rollout captures a per-iteration reward + token trajectory, so you can plot capability against cost (can a cheap model + loops match an expensive one at equal token spend?) task.mdtasks — one file (YAML frontmatter + prompt body) replaces the splittask.toml+instruction.mdlayout; author withbench tasks init/check/migrate/export- Hosted environments — run external PrimeIntellect / Verifiers environments through
--source-env, without converting them to BenchFlow tasks - Sandboxes — Docker locally, Daytona for parallel cloud runs (orphaned sandboxes auto-reaped at eval start), Modal for serverless/GPU-backed task environments
- Hardened verifier — defaults block BenchJack/Meerkat-style reward-hacking; tasks opt out per-feature
- Training-ready output — every scored rollout emits ATIF (
trainer/atif.json) and ADP (trainer/adp.jsonl) trajectory records next to the Verifiers/ORS (OpenReward) reward record
Quickstart
# Install the current 0.6 release candidate (see Install for why the wheel URL)
uv tool install --prerelease allow \
'benchflow @ https://github.com/benchflow-ai/benchflow/releases/download/0.6.0-rc.6/benchflow-0.6.0rc6-py3-none-any.whl'
# Run a benchmark: any task source, any ACP agent, any sandbox
export GEMINI_API_KEY=... # or claude login / codex --login for subscription auth
bench eval create \
--source-repo benchflow-ai/skillsbench --source-path tasks \
--agent gemini --model gemini-3.1-flash-lite-preview \
--sandbox daytona --concurrency 64
Each run writes a per-task result.json (rewards + trajectory + token usage) and a job summary.json (pass-rate, cost, and — for looped runs — a pass@iteration convergence curve). New here? Start with Getting started, or paste the agent quickstart prompt into Claude Code / Codex / Gemini CLI and let it drive the whole thing.
Install
0.6.0 is in release-candidate testing and is not on PyPI yet (the newest PyPI build is still 0.5.x). Until it ships, install the latest 0.6.0-rc.* wheel from the GitHub releases page — the Quickstart pins 0.6.0-rc.6; if a newer rc.* exists, swap the tag and filename. Confirm with bench --version.
--prerelease allowis required for BenchFlow's pinned LiteLLM release-candidate dependency.- If you see
Executables already exist: bench, benchflow, re-run with--forceto replace stale entrypoints from an older install.
Once 0.6.0 ships to PyPI, the plain commands resolve (until then they pick up only 0.5.x):
pip install --upgrade benchflow # once 0.6.0 is on PyPI
uv tool install --prerelease allow --upgrade 'benchflow==0.6.0' # once 0.6.0 is on PyPI
Internal users wanting the newest preview from main install the internal preview channel (uv tool install --prerelease allow --upgrade benchflow).
Requirements & auth. Python 3.12+ and uv. Set DAYTONA_API_KEY for Daytona or configure Modal auth for Modal; export an agent API key (GEMINI_API_KEY, ANTHROPIC_API_KEY, …) or use subscription auth (claude login / codex --login). Provider-prefixed models may need provider-specific credentials; Azure Foundry uses AZURE_API_KEY + AZURE_API_ENDPOINT.
Documentation
Start with Getting started, then Concepts for the mental model. Prefer to have an AI coding agent run the whole quickstart for you? Paste the agent quickstart prompt into Claude Code, Codex CLI, or Gemini CLI. Then by goal:
| If you want to… | Read |
|---|---|
| Run an eval on an existing task | Getting started |
| Understand how BenchFlow runs any benchmark (the three-layer model) | Run any benchmark |
| Have an AI agent install + run the quickstart end to end | Agent quickstart prompt |
| Understand Rollout / Scene / Role / Verifier | Concepts |
| Author a new task | Task authoring |
Author a task in the native task.md format |
Native task.md authoring |
| Adopt an upstream benchmark into BenchFlow | Benchmark adoption |
| Run a hosted PrimeIntellect / Verifiers environment | CLI reference |
| Multi-agent: coder + reviewer, simulated user, BYOS, stateful envs | Use cases |
| Multi-round single-agent (progressive disclosure, oracle access) | Progressive disclosure |
| Skill evaluation (when the artifact is a skill, not a workspace) | Skill eval |
| Understand the security model | Sandbox hardening |
| Use public vs internal preview SDK releases | Release channels |
| CLI flags + commands | CLI reference |
| Python API surface | Python API reference |
Notebooks and runnable example scripts live under docs/examples/ so examples stay versioned with the docs that explain them.
bench agentvsbench eval adopt.bench agent list/bench agent showinspect registered AI agents (the solver programs like Claude Code or Gemini CLI). Onboarding a third-party benchmark intobenchmarks/<name>/is a separate workflow —bench eval adopt init→convert→verify. (The legacybench agent create|run|verifystill work as deprecated aliases through 0.6.) See the CLI reference for details.
Benchmark task sources
Benchmark datasets live in external Git repos and are referenced with two fields:
# benchmarks/harvey-lab/harvey-lab-gemini-flash-lite.yaml
source:
repo: benchflow-ai/benchmarks # GitHub org/repo
path: datasets/harvey-lab/tasks # optional subpath within repo
ref: main # optional branch/tag
agent: gemini
model: gemini/gemini-3.1-flash-lite-preview
Run any benchmark via the CLI:
# From a YAML config (shipped with the repo)
bench eval create --config benchmarks/harvey-lab/harvey-lab-gemini-flash-lite.yaml
# Inline — mirrors the YAML source fields
bench eval create \
--source-repo benchflow-ai/skillsbench --source-path tasks \
--agent gemini --model gemini-3.1-flash-lite-preview --sandbox daytona --concurrency 64
Repos are cloned and cached locally under .cache/datasets/ on first use.
Hosted environments are another source type. Instead of a repo, pass
--source-env to run an external PrimeIntellect / Verifiers environment on its
own native harness — BenchFlow preserves the hosted identity (env_uid,
hub_url) and still writes the shared rollout output contract:
bench eval create \
--source-env primeintellect/general-agent \
--source-env-version 0.1.1 \
--model google/gemini-2.5-flash-lite
Downstream projects should depend on the public PyPI release by default. For internal validation before the next public release, install or lock the internal preview channel with prereleases enabled; see Release channels.
Authoring tasks
A task is one task.md (YAML frontmatter for config + a markdown prompt body)
plus environment/ and verifier/ sidecars. The bench tasks commands cover
the authoring lifecycle:
bench tasks init my-task # scaffold a task.md package under tasks/
bench tasks check tasks/my-task # validate (default --level structural)
bench tasks migrate legacy-task/ # convert task.toml + instruction.md → task.md
bench tasks export tasks/my-task out/ # write a Harbor/Pier split layout + loss report
See Native task.md authoring and the task standard.
Featured
- Progressive disclosure on SWE-bench Pro — the
BaseUserabstraction drives a multi-round rollout: terse round-0 prompt → failing-test hints → full spec. 5/5 oracle on Daytona, runnable demo atdocs/examples/swebench_pro_progressive_disclosure.ipynb. See Progressive disclosure.
Research artifacts
Two runnable labs validate the security story (historical, 0.2.x-era — archived under docs/labs/):
docs/labs/benchjack-sandbox-hardening/— end-to-end demo that 0.2.1+ blocks three BenchJack exploits that flip 0.2.0's reward from 0.0 to 1.0.docs/labs/reward-hack-matrix/— full reward-hack sweep across real benchmarks comparing 0.2.0 vs 0.2.2.
Audience
- Eval researchers / paper writers → Getting started → Concepts → Use cases
- Task authors → Task authoring → Sandbox hardening
- Agent builders integrating with benchflow → Concepts → Python API reference →
benchflow.agents.registry - External benchmark adapters → Task authoring → Progressive disclosure
Contributing
PRs welcome. Open against main. CI runs ruff + tests on every PR; please run ruff check . and pytest tests/ locally first.
Release channels are documented in Release channels. In
short: merges to main publish an internal preview after CI passes, while a
matching v<version> tag publishes the public release.
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 benchflow-0.6.0.tar.gz.
File metadata
- Download URL: benchflow-0.6.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71f1a7bdb61fd008fa6429f427345a2779401babe4efabe1112aa1a01814018
|
|
| MD5 |
0393fbbcbaeafa29ba731f26de98c290
|
|
| BLAKE2b-256 |
6d5a236ff9557ed415f1776fb23f09ce9ba570dbc7c627ac455e57c7ad1f9183
|
File details
Details for the file benchflow-0.6.0-py3-none-any.whl.
File metadata
- Download URL: benchflow-0.6.0-py3-none-any.whl
- Upload date:
- Size: 727.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2abaf6c8bce511dcb6183c5dcbffca952488d5f040d27e565e63e13fada4c290
|
|
| MD5 |
d54d428ce0fc5ae9b55c1f147f143936
|
|
| BLAKE2b-256 |
ce8842f9e556468a5371852f289ab02729cc16616a02acaf3b15e4ef17256a90
|