ExplainBench CLI
ExplainBench checks and evaluates explanations of code changes. It can also build the question files that are needed for a full evaluation.
The project website is explainbench.github.io.
What you can do
- Check the format of an ExplainBench submission.
- Run a lite evaluation of patch explanations.
- Run a full evaluation with effect question files.
- Build local-effect question files for a submission.
- Continue an evaluation or question build after an interruption.
Requirements
ExplainBench requires Python 3.12.
The submission checker has no extra service requirements. An evaluation needs network access and a key for the selected model provider. The local-effect question builder also needs Docker and access to the required code and data services.
Installation
Create and activate a Python 3.12 virtual environment:
python3.12 -m venv .venv
source .venv/bin/activate
On Windows PowerShell, activate it with:
.venv\Scripts\Activate.ps1
Install ExplainBench:
python -m pip install --upgrade pip
python -m pip install explainbench-cli
Check the installation:
explainbench --version
explainbench --help
Quick start
1. Create a submission file
Save this example as submission.json:
{
"submission_id": "my-run",
"instances": [
{
"instance_id": "sympy__sympy-15349",
"explanation": "The patch fixes the sign used in the rotation matrix.",
"model_patch": "diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py\n--- a/sympy/algebras/quaternion.py\n+++ b/sympy/algebras/quaternion.py\n@@ -529,7 +529,7 @@ def to_rotation_matrix(self, v=None):\n \n m10 = 2*s*(q.b*q.c + q.d*q.a)\n m11 = 1 - 2*s*(q.b**2 + q.d**2)\n- m12 = 2*s*(q.c*q.d + q.b*q.a)\n+ m12 = 2*s*(q.c*q.d - q.b*q.a)\n \n m20 = 2*s*(q.b*q.d - q.c*q.a)\n m21 = 2*s*(q.c*q.d + q.b*q.a)\n"
}
]
}
The model_patch field is optional for a lite evaluation.
It is required for a full evaluation and for the local-effect question builder.
2. Check the submission
explainbench checker submission.json
The command prints Submission is valid when the file is ready.
If the file is not valid, the command lists each problem.
3. Run a lite evaluation
Set the key for your model provider. For an OpenAI model, use:
export OPENAI_API_KEY="your-api-key"
Then run:
explainbench evaluate submission.json \
--mode lite \
--model MODEL_ID \
--num-generations 1 \
--output results.json
Replace MODEL_ID with the model that you want to use.
This command sends the explanations to the model provider and can cause a charge.
Full evaluation
A full evaluation needs both end-to-end effect files and local-effect files. The local question builder creates the local-effect files:
explainbench question-builder local run submission.json \
--workspace .explainbench/builds/my-run \
--output question-artifacts \
--resume
Add the matching end-to-end effect files to the same output directory. See the detailed usage guide for the required file names.
Then run:
explainbench evaluate submission.json \
--mode full \
--model MODEL_ID \
--artifacts-dir question-artifacts \
--output results.json \
--resume
The question builder uses Docker, downloads data and source code, and can call a model. Read the setup steps before you run it.
Detailed guide
See the ExplainBench usage guide for:
- The full submission file format.
- Lite and full evaluation modes.
- Direct task selection.
- Configuration files.
- Resume and output behavior.
- Local-effect question builder setup.
- Common errors and fixes.
You can also add --help after any command:
explainbench evaluate --help
explainbench question-builder local run --help
Get help
Report a problem in the GitHub issue tracker.
License
ExplainBench is available under the MIT License. The distribution includes the SWE-bench notice in THIRD_PARTY_NOTICES.md.
Metadata
Release files for explainbench-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| explainbench_cli-0.1.0.tar.gz | 810.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| explainbench_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.6 MB
Release files / explainbench_cli-0.1.0.tar.gz
| Download URL | explainbench_cli-0.1.0.tar.gz |
|---|---|
| Size | 810.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2da317965c16d16b82cc04a588037314cf6e3806a9dfd258cdc2a2c829b2e0a5
|
|
BLAKE2b-256 checksum How to use checksums |
f985b14555a21e733b74b4ad56b13fbf80cd07c789b9670ab44ed2e129d7092c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logRelease files / explainbench_cli-0.1.0-py3-none-any.whl
| Download URL | explainbench_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 836.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f3f88a08d3cea27dd8473dba464c971717ffe5fddc5fd101b8f509f5da39e89
|
|
BLAKE2b-256 checksum How to use checksums |
518f85afcd83aa472ede05abed5efcd46f1a45dba77228fb6879f589929880d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logSecurity for explainbench-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for explainbench_cli-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.