Skip to main content

Overview

openbench supports a plugin system via Python entry points, allowing you to:
  • Distribute custom benchmarks as standalone Python packages
  • Override built-in benchmarks with patched or enhanced versions
  • Share benchmarks across teams without modifying openbench source
  • Version control benchmark implementations independently
External packages register benchmarks through pyproject.toml entry points. Once installed, they appear in bench list and work seamlessly with all CLI commands.

Quick Start

1. Create Your Package Structure

2. Define Your Benchmark

src/my_benchmarks/my_eval.py

3. Create Benchmark Metadata

src/my_benchmarks/metadata.py

4. Register Entry Point

pyproject.toml

5. Install and Use

Entry Point Specifications

Single Benchmark Registration

Register one benchmark with the entry point name:
pyproject.toml
my_pkg/metadata.py
Entry points should reference a callable function that returns BenchmarkMetadata or dict[str, BenchmarkMetadata]. The function will be called automatically when loading entry points.

Multiple Benchmarks Registration

Register multiple benchmarks from one entry point:
pyproject.toml
my_pkg/metadata.py

BenchmarkMetadata Fields

name
string
required
Human-readable display name shown in bench list and bench describe
description
string
required
Detailed description of what the benchmark evaluates
category
string
required
Category for grouping. Common values: "core", "community", "math", "cybersecurity"
tags
List[str]
required
Tags for searchability (e.g., ["multiple-choice", "reasoning", "knowledge"])
module_path
string
required
Python import path to the module containing the task function (e.g., "my_pkg.evals.mmlu")
function_name
string
required
Name of the @task decorated function to load (e.g., "mmlu")
is_alpha
bool
default:false
Mark as experimental/alpha. Requires --alpha flag to run.

Overriding Built-in Benchmarks

Entry points are merged after built-in benchmarks, allowing you to override them. This is useful for:
  • Fixing dataset bugs discovered in production
  • Adding custom splits or subsets
  • Swapping scoring implementations (e.g., using a different grader model)
  • Patching behavior without waiting for upstream fixes
Overriding built-ins can break reproducibility. Pin your dependencies and document any overrides clearly.

Example: Override MMLU with Custom Version

pyproject.toml
my_pkg/custom_mmlu.py
After installing this package, bench eval mmlu will use your custom version.

Troubleshooting

Benchmark Not Appearing

If your benchmark doesn’t show up in bench list:
  1. Verify installation: pip list | grep my-benchmark-package
  2. Check entry point registration:
  3. Check for errors: Look for warnings in CLI output
  4. Verify metadata function: Ensure it returns BenchmarkMetadata or dict[str, BenchmarkMetadata]

Import Errors

If you see ModuleNotFoundError:
  • Ensure module_path in BenchmarkMetadata is correct
  • Check that your package is properly installed
  • Verify the task function exists and is decorated with @task

Override Not Working

If your override isn’t taking effect:
  • Entry points are loaded at package import time
  • Restart your Python session / reinstall the package
  • Check that the entry point name exactly matches the built-in name
For questions or help, open an issue on GitHub.