Offline and online benchmarking utilities for large language model workloads
Project description
BatchBench
BatchBench ships a Rust benchmarking core with a thin Python wrapper.
You can install it with:
uv pip install batchbench
The Python package exposes Rust functionality for request generation and benchmark execution.
Python API
import batchbench
config = {
"endpoint": "https://example.com/v1/chat/completions",
"user_count": 1,
"mode": batchbench.finite_mode(requests_per_user=1),
"request_body": batchbench.request_entry(
{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "ping"}],
},
line_idx=0,
input_tokens=1,
),
"requests": [
batchbench.request_entry(
{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "ping"}],
"max_tokens": 4,
},
line_idx=0,
input_tokens=1,
)
],
"dry_run": True,
}
report = batchbench.run_benchmark(config)
print(report)
Request generation:
requests = batchbench.generate_requests(
{
"count": 16,
"prefix_overlap": 0.2,
"target_tokens": 128,
"tokenizer_model": "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8",
"dist_mode": "fixed",
},
model="Qwen/Qwen3-VL-235B-A22B-Instruct-FP8",
)
Python CLI
The package installs batchbench, which forwards directly to the Rust CLI implementation.
Use the same flags as the Rust binary:
batchbench \
--model gpt-4o-mini \
--users 8 \
--requests-per-user 2 \
--gen-approx-input-tokens 256 \
--output-tokens 64 \
--output-vary 0
Rust CLI
The existing Rust CLI is unchanged:
cargo build --release --manifest-path rust/Cargo.toml --bin batchbench
./rust/target/release/batchbench --help
Releases and PyPI
- CI (
.github/workflows/ci.yaml) checks Rust build/test, builds a wheel, and runs smoke tests. - Release Please (
.github/workflows/release-please.yaml) opens/updates release PRs and, on merge, createsv*tags/releases. - Python release workflow (
.github/workflows/python-release.yaml) builds wheel/sdist and publishes to PyPI onv*tag pushes.
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
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 batchbench-0.2.0.tar.gz.
File metadata
- Download URL: batchbench-0.2.0.tar.gz
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8140464cd826c9384c17cebff098c569fd6f826e465b67a82a53666f36887ff3
|
|
| MD5 |
e07beed40009edd201157139c02da3a3
|
|
| BLAKE2b-256 |
6e75e15a43e352ae6ba6f221910549f2f986173814677221328dc1873390a12a
|
Provenance
The following attestation bundles were made for batchbench-0.2.0.tar.gz:
Publisher:
python-release.yaml on doublewordai/batchbench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
batchbench-0.2.0.tar.gz -
Subject digest:
8140464cd826c9384c17cebff098c569fd6f826e465b67a82a53666f36887ff3 - Sigstore transparency entry: 957970864
- Sigstore integration time:
-
Permalink:
doublewordai/batchbench@271e1d4030b5b01533218d04bf4490a253d7db81 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/doublewordai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yaml@271e1d4030b5b01533218d04bf4490a253d7db81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file batchbench-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: batchbench-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.9+, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea1b6a8fc64d69cfb2f0e37dea9b6ae827e5b82df69c347448c639534a96fff4
|
|
| MD5 |
7165908c75d5b489e76180a3216d9d4e
|
|
| BLAKE2b-256 |
36d03f1414781a4a904b0456aef7e23628eed9d0dadb3d6d9697770ee9d013a5
|
Provenance
The following attestation bundles were made for batchbench-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl:
Publisher:
python-release.yaml on doublewordai/batchbench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
batchbench-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl -
Subject digest:
ea1b6a8fc64d69cfb2f0e37dea9b6ae827e5b82df69c347448c639534a96fff4 - Sigstore transparency entry: 957970888
- Sigstore integration time:
-
Permalink:
doublewordai/batchbench@271e1d4030b5b01533218d04bf4490a253d7db81 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/doublewordai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yaml@271e1d4030b5b01533218d04bf4490a253d7db81 -
Trigger Event:
push
-
Statement type: