Abench
English | 简体中文
Agentic inference benchmark: closed-loop replay of recorded agent trajectories (DeepSWE v1.1, LMCache) — or a locally generated workload — against any OpenAI-compatible inference server (SGLang, vLLM, ...).
It answers: how fast does a single agent advance? — per-turn TTFT / TPOT / E2E, cache behavior, and throughput at a fixed concurrency, on a fixed, reproducible agent workload.
Install
pip install agentic-bench # from PyPI (after the first release)
Or install the wheel attached to a GitHub Release:
pip install https://github.com/AlibabaResearch/abench/releases/download/v0.2.0/agentic_bench-0.2.0-py3-none-any.whl
From a checkout:
pip install .
The PyPI distribution is named agentic-bench; the Python module and the
abench command keep the project name. An unrelated PyPI package named
abench (ActivitySim) also installs an abench module and command, so do
not install both in the same environment. If you already have it, run
pip uninstall abench first.
Quick start
Two subcommands.
# 1) one-time data prep: downloads deepswe/mixed (~42 MB, SHA-256
# verified, resumable) from the ABench ModelScope mirror; data lands
# under ~/abench_data/deepswe/mixed/
python3 -m abench data deepswe/mixed
# 2) replay at one concurrency; every session runs to completion
# (or under --duration) and full metrics are reported. --output-file
# appends one JSON line per run; per-turn records are included by
# default (--no-output-details keeps lines slim).
python3 -m abench run \
--model default \
--dataset-name deepswe/mixed --max-concurrency 16 \
--output-file results.jsonl
# no --host/--port needed: localhost :30000 (sglang) / :8000 (vllm) is
# auto-detected; pass --port/--base-url only for non-default deployments
Smoke test with no download (locally generated random workload):
python3 -m abench run \
--dataset-name random \
--turns 3 --output-len 64 --max-concurrency 4
python3 -m abench ... is the primary invocation (matching how
bench_serving is called). The wheel also installs an equivalent
abench console script. Results always land on disk: without
--output-file the run writes
{backend}_{date}_{dataset}.jsonl in the working directory.
Backends & auth
Any OpenAI-compatible server works; --backend auto|sglang|vllm|openai
(default auto, probed from the server) adapts the observation layer —
SGLang-only extras (per-layer cache breakdown, /flush_cache, /metrics
gauge names) are gated per backend, and unsupported metrics report null
rather than 0. Request shape is standard OpenAI either way.
Leave --backend and --port unset: auto probes the engine and
resolves the port (sglang/openai 30000, vLLM 8000). A wrong explicit
--backend does not error — it silently drops that backend's metrics
(cache breakdown / KV pool / server_info); abench warns when a declared
backend does not match the server.
- Auth:
export OPENAI_API_KEY=...(orAPI_KEY=for custom gateway schemes) — attached to every request, no CLI flag needed. - Escape hatches:
--header Key=Value(repeatable) for custom HTTP headers;--extra-request-body '{"seed": 123}'merges into every request body and can override built-in fields. --ready-check-timeout-secpolls/v1/modelsbefore the run so a still-loading server fails fast instead of timing out every request.
CLI
| command | purpose |
|---|---|
python3 -m abench data <DATASET>/<TIER> |
the single data-prep entry: download a preset dataset tier (SHA-256 verified, resumable) from the ABench ModelScope mirror to <data-path>/<dataset>/<tier>/ (--list shows all; a bare dataset name without a tier is rejected) |
python3 -m abench run |
the single bench entry: closed-loop replay at one concurrency; data located by --dataset-name (identity, looked up under ~/abench_data) and/or --dataset-path (file / tier dir / root) |
--help shows the core flags; --help-advanced shows everything. The
tokenizer resolves automatically (--tokenizer, else a local --model
dir, else the server's /model_info, else AutoTokenizer.from_pretrained
for non-local names, else tiktoken, else chars/4) — the Hub fetch
matches bench_serving; set HF_HUB_OFFLINE=1 on air-gapped machines.
Docs
- docs/README.md — reference: closed-loop protocol, dataset tiers, every flag, metric definitions
- docs/DESIGN.md — design rationale, measurement decisions
- CONTRIBUTING.md — how to contribute, CLA, and review expectations
- CODE_OF_CONDUCT.md
Development
src/abench/
cli.py argument parsing and dispatch (python3 -m abench)
runner.py what `data` and `run` actually do
core/ domain: session data, workload planning, result records
serve/ the server under test: endpoints, telemetry, report
replay/ closed-loop engine and turn transport
docs/ reference and design notes
pip install -e .
python -m build --wheel # ships the package only
License
Copyright (c) 2026, Alibaba Group and its affiliates. Abench is licensed under the Apache License, Version 2.0 — see LICENSE. The upstream conventions this CLI follows, and where the datasets come from, are recorded in NOTICE; the repository itself ships no trajectory data.
Metadata
Release files for agentic-bench 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agentic_bench-0.2.0.tar.gz | 60.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentic_bench-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 127.8 kB
Release files / agentic_bench-0.2.0.tar.gz
| Download URL | agentic_bench-0.2.0.tar.gz |
|---|---|
| Size | 60.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce4bbe011e5ba3b5009db753aa1ca952567da6427d463d73d4590ccb6db564a2
|
|
BLAKE2b-256 checksum How to use checksums |
835aa0371726b9e25d1d68ca264bd2b2b736100be25b895098e0d380d71367dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logRelease files / agentic_bench-0.2.0-py3-none-any.whl
| Download URL | agentic_bench-0.2.0-py3-none-any.whl |
|---|---|
| Size | 67.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd5ae9beb6901ac815da1770cd56b722b23c64d59f97d4c2a1eb39022cc98887
|
|
BLAKE2b-256 checksum How to use checksums |
3e80b24ff5328ebddecf5ea68d60e9f8ab297b0bf6bba335cfcdf09854bc933f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logSecurity for agentic-bench 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agentic_bench-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.