Skip to main content

DPBench: A Benchmark for LLM Multi-Agent Coordination

Project description

DPBench

A benchmark for evaluating coordination in multi-agent LLM systems under simultaneous resource contention.

DPBench

PyPI version Python License: MIT

Overview

DPBench adapts the Dining Philosophers problem into a controlled testbed where the action protocol, the communication structure, and the group size each vary independently. Each episode reports four metrics (deadlock rate, throughput, fairness, message-action consistency) with Wilson and t-based 95% confidence intervals. On a single model, the benchmark captures what changes when the protocol changes.

Installation

pip install dpbench

Optional provider extras for the example experiments:

pip install "dpbench[openai]"
pip install "dpbench[anthropic]"
pip install "dpbench[google]"
pip install "dpbench[xai]"

Quickstart

from dpbench import Benchmark

def my_model(system_prompt: str, user_prompt: str) -> str:
    """Your LLM call here. Returns the agent's response as a string."""
    ...

results = Benchmark.run(
    model_fn=my_model,
    system_prompt="...",
    decision_prompt="...",
    philosophers=5,
    episodes=30,
    mode="simultaneous",
    communication=False,
)

print(f"Deadlock rate: {results['deadlock_rate']:.1%}")
print(f"Throughput:    {results['avg_throughput']:.3f}")
print(f"Fairness:      {results['avg_fairness']:.3f}")

Prompt templates used in the paper are in experiments/prompts/. Full parameter documentation is in the Benchmark.run docstring.

Reproducing the paper experiments

git clone https://github.com/najmulhasan-code/dpbench.git
cd dpbench
pip install -e .

# Provider API keys for the LLMs you want to evaluate
cp .env.example .env

python experiments/scripts/run.py
python experiments/scripts/aggregate.py
python experiments/scripts/generate_figures.py

Experiments are configured by experiments/configs/conditions.yaml and experiments/configs/models.yaml.

Citation

A BibTeX entry will be added here when the accompanying paper is published.

License

Licensed under the MIT License.

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

dpbench-0.2.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

dpbench-0.2.0-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file dpbench-0.2.0.tar.gz.

File metadata

  • Download URL: dpbench-0.2.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for dpbench-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cb89e064abcfd3c7555b9ebea7ad13cab74fceb287efc90a5311d61984d1dc88
MD5 860b1b5f752eaa1881fa47a93899d14b
BLAKE2b-256 db8d43147ef95a8debb28432060cb0ccba8572cecac58b9fb5ba329d330fe52d

See more details on using hashes here.

File details

Details for the file dpbench-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dpbench-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for dpbench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b672337a305405b7025c7b186a5cb5d88d1a520c7dd708d9bb9858e6c3720df
MD5 47f7793418fc12dca350de64f09494ea
BLAKE2b-256 dade83ee619262c0e55ce6e6d8dc3bc6b2c5a6c99e99c2971584fecc88b785b5

See more details on using hashes here.

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