This guide documents the drop-in benchmark extension path used by FlowCompile. Benchmarks own dataset loading, scoring, and result formatting; workflows own execution structure.
Add a benchmark that works with:
flowcompile testflowcompile runtime inferflowcompile.benchmarks.registryFor most cases, you only need one new module plus the dataset files it points to.
Add:
src/flowcompile/benchmarks/<name>.py
Use the repository template referenced by the maintainer guide as the starting point when available.
Your class must:
BaseBenchmark@register_benchmark()BENCHMARK_NAMEALIASESWORKFLOW_TYPEMETRIC_NAMEDEFAULT_SPLIT_PATHSRequired methods:
evaluate_problem(...)calculate_score(...)get_result_columns(...)Optional hooks:
score_from_result(result)result_key(result)trace_key(trace)Put the benchmark data under data/ and point DEFAULT_SPLIT_PATHS at the
validate and test files:
DEFAULT_SPLIT_PATHS = {
"validate": "data/mybench_validate.jsonl",
"test": "data/mybench_test.jsonl",
}
The flat experiment config should reference those same split files through
validate_file and test_file.
The benchmark registry is decorator-driven, so no central manual list should be necessary. Verify registration with:
python - <<'PY'
from flowcompile.benchmarks import list_benchmarks
for row in list_benchmarks(detailed=True):
print(row["name"], row.get("aliases", []), row.get("workflow_type"), row.get("metric_name"))
PY
Add or copy a flat config under configs/examples/:
schema_version: "flowcompile.flat.v1"
experiment_id: "mybench"
workflow_type: "math"
dataset: "MyBench"
model_config: "configs/config.yaml"
validate_file: "data/mybench_validate.jsonl"
test_file: "data/mybench_test.jsonl"
search_axes: ["model", "budget", "structure"]
search_budgets: [100, 500, 1000]
Use one of the currently supported CLI workflow types: math, gsm8k,
hotpotqa, or livecodebench. A genuinely new workflow type also needs the
workflow extension steps, plus CLI/runtime support for that type.
Then validate the usual pipeline:
CONFIG=configs/examples/flowcompile_mybench.yaml
flowcompile --config "$CONFIG" get-latency
flowcompile --config "$CONFIG" prepare-data
flowcompile --config "$CONFIG" profile
flowcompile --config "$CONFIG" predict
flowcompile --config "$CONFIG" test
flowcompile --config "$CONFIG" runtime infer \
--query "..." \
--strategy preference \
--budget medium
Any alias listed in ALIASES should resolve to the same benchmark class.
The benchmark registration helpers are documented in the API reference for flowcompile.benchmarks.registry.