Skip to main content

Overview

openbench is built on top of Inspect AI, providing a unified interface for evaluating language models across multiple benchmarks and providers.

System Architecture

Core Components

1. Task Registry (_registry.py)

The registry dynamically discovers and loads benchmark tasks:
_registry.py
Custom evaluations must be added to the registry to be discoverable by openbench.

2. Benchmark Metadata (config.py)

Lightweight configuration for benchmarks:
config.py

3. Evaluation Task Implementations (evals/)

Each benchmark follows a standard pattern:
evals/simpleqa.py
Reference InspectAI: Task, GenerateConfig

3. Dataset Loaders (datasets/)

Standardized data loading:
datasets/simpleqa.py
Reference InspectAI: Sample, Dataset

4. Scoring System (scorers/)

Custom scoring and metric mechanisms can be defined:
Reference InspectAI: Scorer, Score
Scoring Archetypes:
  • Exact match: Direct comparison
  • Pattern match: Regex-based
  • Model-graded: Use secondary grader model to score
  • Symbolic: Mathematical equivalence
  • Custom: Task-specific logic

5. Scoring Metrics (metrics/)

Metrics provide aggregate insight on model performance across all samples:
Include custom metrics in the scorer function decorator for automatic detection during evaluation.
Inspect AI builds in support for common metrics inluding accuracy and stderr. Learn more about built-in metrics.
Reference InspectAI: Metric

6. Model Solver Logic (solvers/)

Solvers define how the evaluated model processes questions. openbench supports custom solver logic, though InspectAI provides a number of robust built-in solvers.
Reference InspectAI: Solvers

File Structure

Extension Points - Adding New Benchmarks

Built-in Benchmarks (Contribution)

To add a benchmark to openbench core:
  1. Eval task in evals/
  2. Dataset loader in datasets/
  3. Scoring logic in scorers/
  4. Custom solver in solvers/ (if needed)
  5. Custom metric in metrics/ (if needed)
  6. Benchmark metadata in config.py
  7. Import eval task into _registry.py
openbench provides infrastructure for multiple-choice question (MCQ) evals. See more.

External Benchmarks (Plugin System)

openbench supports a plugin system via Python entry points, allowing you to distribute custom benchmarks as standalone packages:
pyproject.toml
After installing your package, benchmarks appear in bench list and work with all CLI commands. Benefits:
  • No need to modify openbench source code
  • Version and distribute benchmarks independently
  • Share benchmarks across teams/organizations
  • Override built-in benchmarks with custom implementations
See the Extending openbench guide for comprehensive documentation, examples, and best practices.