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
3. Dataset Loaders (datasets/)
Standardized data loading:
datasets/simpleqa.py
4. Scoring System (scorers/)
Custom scoring and metric mechanisms can be defined:
- 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:
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.
File Structure
Extension Points - Adding New Benchmarks
Built-in Benchmarks (Contribution)
To add a benchmark to openbench core:- Eval task in
evals/ - Dataset loader in
datasets/ - Scoring logic in
scorers/ - Custom solver in
solvers/(if needed) - Custom metric in
metrics/(if needed) - Benchmark metadata in
config.py - Import eval task into
_registry.py
External Benchmarks (Plugin System)
openbench supports a plugin system via Python entry points, allowing you to distribute custom benchmarks as standalone packages:pyproject.toml
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