Skip to main content

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

Press Ctrl+C during a run to cancel active requests and print a partial summary.

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, creates v* tags/releases.
  • Python release workflow (.github/workflows/python-release.yaml) builds and publishes prebuilt platform wheels to PyPI on v* 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

batchbench-0.2.3-cp39-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

batchbench-0.2.3-cp39-abi3-manylinux_2_28_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

batchbench-0.2.3-cp39-abi3-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file batchbench-0.2.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: batchbench-0.2.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for batchbench-0.2.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cbc80c7c5336e42a1d1619c646b1591c75daedeb76d0875a8de86a25e5ddd453
MD5 60bd746632b998d15f15ed9402f9ef84
BLAKE2b-256 16cf104c71502d69a196b85b5a8f8f88f9649bdff6b3f66d8da0b045eb693826

See more details on using hashes here.

Provenance

The following attestation bundles were made for batchbench-0.2.3-cp39-abi3-win_amd64.whl:

Publisher: python-release.yaml on doublewordai/batchbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file batchbench-0.2.3-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for batchbench-0.2.3-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 68f47f8baed10160a68efda37e3d06e92cd9ad0a46f25f08e41f10f47c499bdd
MD5 07194077e286efc2197fc66ba47770c8
BLAKE2b-256 3a4c7934bd138037f4ade64bf4cf554a45c2fc5441bea793e983c09630c8d79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for batchbench-0.2.3-cp39-abi3-manylinux_2_28_x86_64.whl:

Publisher: python-release.yaml on doublewordai/batchbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file batchbench-0.2.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for batchbench-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 181f1f58f43e7b3a9f1518b0388010713003e7fa9c50f7d9ed2d6c731d738b1d
MD5 8391bb3e3b69bd4cf2f50a616bb3de33
BLAKE2b-256 7631a3fe08ba47b94f9dd26327554ace1eb3a26f1adc15f046a3195ba65eaecc

See more details on using hashes here.

Provenance

The following attestation bundles were made for batchbench-0.2.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python-release.yaml on doublewordai/batchbench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page