inspect-brief 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_brief-0.1.1/LICENSE +21 -0
- inspect_brief-0.1.1/PKG-INFO +281 -0
- inspect_brief-0.1.1/README.md +240 -0
- inspect_brief-0.1.1/inspect_brief/__init__.py +4 -0
- inspect_brief-0.1.1/inspect_brief/__main__.py +6 -0
- inspect_brief-0.1.1/inspect_brief/_registry.py +5 -0
- inspect_brief-0.1.1/inspect_brief/cli.py +224 -0
- inspect_brief-0.1.1/inspect_brief/core.py +883 -0
- inspect_brief-0.1.1/inspect_brief/hooks.py +138 -0
- inspect_brief-0.1.1/inspect_brief/parsing.py +183 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/PKG-INFO +281 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/SOURCES.txt +20 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/dependency_links.txt +1 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/entry_points.txt +5 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/requires.txt +4 -0
- inspect_brief-0.1.1/inspect_brief.egg-info/top_level.txt +1 -0
- inspect_brief-0.1.1/pyproject.toml +119 -0
- inspect_brief-0.1.1/setup.cfg +4 -0
- inspect_brief-0.1.1/tests/test_cli.py +241 -0
- inspect_brief-0.1.1/tests/test_core.py +558 -0
- inspect_brief-0.1.1/tests/test_hooks.py +230 -0
- inspect_brief-0.1.1/tests/test_parsing.py +149 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hirundo-io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: inspect-brief
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Generate standardized concise metric summaries for Inspect evaluations.
|
|
5
|
+
Author-email: Hirundo <dev@hirundo.io>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Hirundo-io
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Hirundo-io/inspect-brief
|
|
29
|
+
Keywords: inspect-ai,evaluation,metrics,summarization,report generation
|
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
31
|
+
Classifier: Programming Language :: Python
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Requires-Python: <3.14,>=3.12
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: inspect-ai>=0.3.112
|
|
37
|
+
Requires-Dist: python-dotenv
|
|
38
|
+
Requires-Dist: tqdm
|
|
39
|
+
Requires-Dist: typer
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# inspect-brief
|
|
43
|
+
|
|
44
|
+
Generate standardized concise metric summaries from [Inspect AI](https://inspect.aisi.org.uk/) evaluation logs and append them to a CSV.
|
|
45
|
+
|
|
46
|
+
> [!IMPORTANT]
|
|
47
|
+
> Inspect Brief currently supports Inspect `.eval` logs only. JSON-formatted
|
|
48
|
+
> Inspect evaluation logs are not supported as input.
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
|
|
52
|
+
- Load Inspect `.eval` logs recursively or from explicit file paths
|
|
53
|
+
- Optionally filter by task name and select target metrics per task
|
|
54
|
+
- Append results to a CSV (rewrites the header when columns change, preserving existing rows)
|
|
55
|
+
- Skip runs already present in the CSV via `--skip-existing`
|
|
56
|
+
- Optionally export each task automatically through an Inspect Hook
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
With `uv`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv add inspect-brief
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or with `pip`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install inspect-brief
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Installing the package provides the `inspect-brief` command and registers the
|
|
73
|
+
Inspect extension entry point.
|
|
74
|
+
|
|
75
|
+
For one-off use, `uvx` can run either workflow without adding Inspect Brief to
|
|
76
|
+
the current project. The workflow sections below show the corresponding
|
|
77
|
+
commands.
|
|
78
|
+
|
|
79
|
+
For local development from a repository checkout, see
|
|
80
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
81
|
+
|
|
82
|
+
## Choose a workflow
|
|
83
|
+
|
|
84
|
+
Inspect Brief can run in two separate ways:
|
|
85
|
+
|
|
86
|
+
- **Inspect Hook:** automatically export a summary whenever an Inspect task finishes.
|
|
87
|
+
- **CLI:** manually process existing `.eval` logs after an evaluation has completed.
|
|
88
|
+
|
|
89
|
+
The hook is the recommended flow for automatic export during normal Inspect runs.
|
|
90
|
+
Use the CLI for existing logs, one-off exports, or regenerating a summary CSV.
|
|
91
|
+
|
|
92
|
+
## Automatic export with the Inspect Hook
|
|
93
|
+
|
|
94
|
+
The opt-in hook receives each completed task directly from Inspect and appends its
|
|
95
|
+
summary rows to the configured CSV. You continue running `inspect eval` normally;
|
|
96
|
+
there is no separate `inspect-brief` command in this flow.
|
|
97
|
+
|
|
98
|
+
### 1. Configure the output CSV
|
|
99
|
+
|
|
100
|
+
Set the required output path in the shell that will run Inspect:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
export INSPECT_BRIEF_CSV_PATH=results/brief_results.csv
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The hook is enabled when `INSPECT_BRIEF_CSV_PATH` is set. Set
|
|
107
|
+
`INSPECT_BRIEF_ENABLED=0` to disable it explicitly without removing the output
|
|
108
|
+
configuration.
|
|
109
|
+
|
|
110
|
+
For persistent local configuration, put the variables in an untracked `.env`
|
|
111
|
+
file in the project directory. Inspect Brief loads this file when Inspect imports
|
|
112
|
+
the hook:
|
|
113
|
+
|
|
114
|
+
```dotenv
|
|
115
|
+
INSPECT_BRIEF_CSV_PATH=results/brief_results.csv
|
|
116
|
+
# Optional examples:
|
|
117
|
+
INSPECT_BRIEF_TASKS=inspect_evals/gpqa_diamond
|
|
118
|
+
INSPECT_BRIEF_TARGET_METRICS=target_metrics.json
|
|
119
|
+
INSPECT_BRIEF_SKIP_EXISTING=true
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 2. Run Inspect normally
|
|
123
|
+
|
|
124
|
+
When Inspect Brief is installed in the project, run Inspect normally:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
inspect eval inspect_evals/gpqa_diamond --model ollama/llama3.2
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For a one-off run, start Inspect with Inspect Brief included in its isolated
|
|
131
|
+
tool environment. Every package the run needs must be named explicitly, including
|
|
132
|
+
the one that provides the task. The example inlines the output path so the
|
|
133
|
+
command stands on its own:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
INSPECT_BRIEF_CSV_PATH=results/brief_results.csv \
|
|
137
|
+
uvx --from inspect-ai --with inspect-brief --with inspect-evals \
|
|
138
|
+
inspect eval inspect_evals/gpqa_diamond --model ollama/llama3.2
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
After every task completes, the hook appends the selected metric rows to the CSV
|
|
142
|
+
and logs the number of rows exported. At the end of the Inspect run, it logs a
|
|
143
|
+
summary containing the handled task count, failed task count, exported row count,
|
|
144
|
+
and output path.
|
|
145
|
+
|
|
146
|
+
CSV export is synchronous within an Inspect process. Inspect Brief does not use
|
|
147
|
+
cross-process file locking, so each output CSV must have a single process writing
|
|
148
|
+
to it. Do not point concurrent Inspect runs or CLI processes at the same CSV.
|
|
149
|
+
|
|
150
|
+
### Hook configuration
|
|
151
|
+
|
|
152
|
+
| Variable | Required | Description |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| `INSPECT_BRIEF_CSV_PATH` | Yes | Output CSV path. The hook is disabled when it is unset. |
|
|
155
|
+
| `INSPECT_BRIEF_ENABLED` | No | Set to `0`, `false`, `no`, or `off` to disable the hook. When unset, the hook is enabled if `INSPECT_BRIEF_CSV_PATH` is set. |
|
|
156
|
+
| `INSPECT_BRIEF_TASKS` | No | Tasks to include (comma-separated). |
|
|
157
|
+
| `INSPECT_BRIEF_TARGET_METRICS` | No | Target-metrics JSON object or path to a JSON file. |
|
|
158
|
+
| `INSPECT_BRIEF_SKIP_EXISTING` | No | Set to `1`, `true`, `yes`, or `on` to skip Run IDs already in the CSV. |
|
|
159
|
+
|
|
160
|
+
## Manual export with the CLI
|
|
161
|
+
|
|
162
|
+
Use this flow when the hook was not enabled during the Inspect run, or when you
|
|
163
|
+
need to process existing logs again.
|
|
164
|
+
|
|
165
|
+
### 1. Choose the input logs
|
|
166
|
+
|
|
167
|
+
At least one of `--log-dir` or `--log-files` is required:
|
|
168
|
+
|
|
169
|
+
- `--log-dir` recursively discovers `.eval` logs under a directory.
|
|
170
|
+
- `--log-files` accepts one or more explicit `.eval` paths or filesystem URIs.
|
|
171
|
+
Repeat the option, separate sources with commas, or combine both forms.
|
|
172
|
+
- Supplying both combines the discovered and explicit logs and removes duplicates.
|
|
173
|
+
|
|
174
|
+
JSON-formatted Inspect logs are not supported by either CLI input option.
|
|
175
|
+
|
|
176
|
+
### 2. Run the export
|
|
177
|
+
|
|
178
|
+
After installation, invoke the console script:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
inspect-brief [OPTIONS]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Or run the CLI directly without adding it to the current project:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
uvx inspect-brief [OPTIONS]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### CLI options
|
|
191
|
+
|
|
192
|
+
| Option | Description |
|
|
193
|
+
| --- | --- |
|
|
194
|
+
| `--log-dir` | Directory containing Inspect logs; recursively finds `*.eval` files and combines them with `--log-files` when both are supplied |
|
|
195
|
+
| `--log-files` | One or more explicit `.eval` paths or filesystem URIs (repeatable or comma-separated); combines them with logs found by `--log-dir` when both are supplied |
|
|
196
|
+
| `--tasks` | Tasks to include (repeatable or comma-separated); others are skipped |
|
|
197
|
+
| `--target-metrics` | JSON object (or path to a JSON file) mapping task → list of `InspectScore` objects |
|
|
198
|
+
| `--csv-path` | Output CSV path (default: `brief_results.csv` under `--log-dir`, or the current directory) |
|
|
199
|
+
| `--skip-existing` | Skip task runs whose Run ID is already in the CSV |
|
|
200
|
+
|
|
201
|
+
### CLI examples
|
|
202
|
+
|
|
203
|
+
Summarize every `.eval` under a log tree:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
inspect-brief --log-dir /path/to/inspect/logs
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Summarize specific files and write to a chosen CSV:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
inspect-brief \
|
|
213
|
+
--log-files /path/to/a.eval \
|
|
214
|
+
--log-files /path/to/b.eval \
|
|
215
|
+
--csv-path results.csv
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Provider-backed logs can be supplied directly:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
inspect-brief --log-files s3://bucket/path/run.eval
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Filter tasks and skip runs already recorded:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
inspect-brief \
|
|
228
|
+
--log-dir /path/to/inspect/logs \
|
|
229
|
+
--tasks inspect_evals/gpqa_diamond,inspect_harbor/gorilla_bfcl_parity \
|
|
230
|
+
--csv-path results.csv \
|
|
231
|
+
--skip-existing
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Target metrics
|
|
235
|
+
|
|
236
|
+
When `--target-metrics` is omitted, every metric present in the log scores is exported (with a scorer prefix when a log has multiple scorers).
|
|
237
|
+
|
|
238
|
+
When provided, pass a JSON object (inline or as a file path) mapping each task name to a list of `InspectScore` objects. Each object must have exactly these keys:
|
|
239
|
+
|
|
240
|
+
- `name` — metric name as it appears in the Inspect log
|
|
241
|
+
- `is_percentage` — whether to treat the value as a percentage (appends ` (%)` to the metric label)
|
|
242
|
+
- `is_higher_better` — appends `⬆️` or `⬇️` to the metric label
|
|
243
|
+
- `is_normalized` — if `is_percentage` is true and this is true, multiply the value by `100`
|
|
244
|
+
|
|
245
|
+
Example (quote the JSON for the shell):
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
inspect-brief --log-dir /path/to/logs --target-metrics '{
|
|
249
|
+
"inspect_evals/gpqa_diamond": [
|
|
250
|
+
{
|
|
251
|
+
"name": "accuracy",
|
|
252
|
+
"is_percentage": true,
|
|
253
|
+
"is_higher_better": true,
|
|
254
|
+
"is_normalized": true
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}'
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Or point at a file:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
inspect-brief --log-dir /path/to/logs --target-metrics ./target_metrics.json
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Output
|
|
267
|
+
|
|
268
|
+
Results are appended to the CSV. Columns:
|
|
269
|
+
|
|
270
|
+
| Created | Run ID | Benchmark | Metric | Score | Runtime (sec) |
|
|
271
|
+
| --- | --- | --- | --- | --- | --- |
|
|
272
|
+
| 2026-08-17T16:54:14+00:00 | L67rTm5rz3wkwVdTLMGDme | inspect_evals/gpqa_diamond | accuracy | 0.3699 | 28 |
|
|
273
|
+
|
|
274
|
+
- **Created** comes from `log.eval.created`, falling back to `log.stats.started_at`
|
|
275
|
+
- **Score** is formatted to 2 decimal places when `> 1.0`, otherwise 4 decimal places
|
|
276
|
+
- Failed or incomplete runs record a status string in the Score column when applicable
|
|
277
|
+
|
|
278
|
+
## Contributing
|
|
279
|
+
|
|
280
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for local setup, verification steps,
|
|
281
|
+
and pull-request expectations.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# inspect-brief
|
|
2
|
+
|
|
3
|
+
Generate standardized concise metric summaries from [Inspect AI](https://inspect.aisi.org.uk/) evaluation logs and append them to a CSV.
|
|
4
|
+
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> Inspect Brief currently supports Inspect `.eval` logs only. JSON-formatted
|
|
7
|
+
> Inspect evaluation logs are not supported as input.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Load Inspect `.eval` logs recursively or from explicit file paths
|
|
12
|
+
- Optionally filter by task name and select target metrics per task
|
|
13
|
+
- Append results to a CSV (rewrites the header when columns change, preserving existing rows)
|
|
14
|
+
- Skip runs already present in the CSV via `--skip-existing`
|
|
15
|
+
- Optionally export each task automatically through an Inspect Hook
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
With `uv`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv add inspect-brief
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or with `pip`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install inspect-brief
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Installing the package provides the `inspect-brief` command and registers the
|
|
32
|
+
Inspect extension entry point.
|
|
33
|
+
|
|
34
|
+
For one-off use, `uvx` can run either workflow without adding Inspect Brief to
|
|
35
|
+
the current project. The workflow sections below show the corresponding
|
|
36
|
+
commands.
|
|
37
|
+
|
|
38
|
+
For local development from a repository checkout, see
|
|
39
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
40
|
+
|
|
41
|
+
## Choose a workflow
|
|
42
|
+
|
|
43
|
+
Inspect Brief can run in two separate ways:
|
|
44
|
+
|
|
45
|
+
- **Inspect Hook:** automatically export a summary whenever an Inspect task finishes.
|
|
46
|
+
- **CLI:** manually process existing `.eval` logs after an evaluation has completed.
|
|
47
|
+
|
|
48
|
+
The hook is the recommended flow for automatic export during normal Inspect runs.
|
|
49
|
+
Use the CLI for existing logs, one-off exports, or regenerating a summary CSV.
|
|
50
|
+
|
|
51
|
+
## Automatic export with the Inspect Hook
|
|
52
|
+
|
|
53
|
+
The opt-in hook receives each completed task directly from Inspect and appends its
|
|
54
|
+
summary rows to the configured CSV. You continue running `inspect eval` normally;
|
|
55
|
+
there is no separate `inspect-brief` command in this flow.
|
|
56
|
+
|
|
57
|
+
### 1. Configure the output CSV
|
|
58
|
+
|
|
59
|
+
Set the required output path in the shell that will run Inspect:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export INSPECT_BRIEF_CSV_PATH=results/brief_results.csv
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The hook is enabled when `INSPECT_BRIEF_CSV_PATH` is set. Set
|
|
66
|
+
`INSPECT_BRIEF_ENABLED=0` to disable it explicitly without removing the output
|
|
67
|
+
configuration.
|
|
68
|
+
|
|
69
|
+
For persistent local configuration, put the variables in an untracked `.env`
|
|
70
|
+
file in the project directory. Inspect Brief loads this file when Inspect imports
|
|
71
|
+
the hook:
|
|
72
|
+
|
|
73
|
+
```dotenv
|
|
74
|
+
INSPECT_BRIEF_CSV_PATH=results/brief_results.csv
|
|
75
|
+
# Optional examples:
|
|
76
|
+
INSPECT_BRIEF_TASKS=inspect_evals/gpqa_diamond
|
|
77
|
+
INSPECT_BRIEF_TARGET_METRICS=target_metrics.json
|
|
78
|
+
INSPECT_BRIEF_SKIP_EXISTING=true
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2. Run Inspect normally
|
|
82
|
+
|
|
83
|
+
When Inspect Brief is installed in the project, run Inspect normally:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
inspect eval inspect_evals/gpqa_diamond --model ollama/llama3.2
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For a one-off run, start Inspect with Inspect Brief included in its isolated
|
|
90
|
+
tool environment. Every package the run needs must be named explicitly, including
|
|
91
|
+
the one that provides the task. The example inlines the output path so the
|
|
92
|
+
command stands on its own:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
INSPECT_BRIEF_CSV_PATH=results/brief_results.csv \
|
|
96
|
+
uvx --from inspect-ai --with inspect-brief --with inspect-evals \
|
|
97
|
+
inspect eval inspect_evals/gpqa_diamond --model ollama/llama3.2
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
After every task completes, the hook appends the selected metric rows to the CSV
|
|
101
|
+
and logs the number of rows exported. At the end of the Inspect run, it logs a
|
|
102
|
+
summary containing the handled task count, failed task count, exported row count,
|
|
103
|
+
and output path.
|
|
104
|
+
|
|
105
|
+
CSV export is synchronous within an Inspect process. Inspect Brief does not use
|
|
106
|
+
cross-process file locking, so each output CSV must have a single process writing
|
|
107
|
+
to it. Do not point concurrent Inspect runs or CLI processes at the same CSV.
|
|
108
|
+
|
|
109
|
+
### Hook configuration
|
|
110
|
+
|
|
111
|
+
| Variable | Required | Description |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| `INSPECT_BRIEF_CSV_PATH` | Yes | Output CSV path. The hook is disabled when it is unset. |
|
|
114
|
+
| `INSPECT_BRIEF_ENABLED` | No | Set to `0`, `false`, `no`, or `off` to disable the hook. When unset, the hook is enabled if `INSPECT_BRIEF_CSV_PATH` is set. |
|
|
115
|
+
| `INSPECT_BRIEF_TASKS` | No | Tasks to include (comma-separated). |
|
|
116
|
+
| `INSPECT_BRIEF_TARGET_METRICS` | No | Target-metrics JSON object or path to a JSON file. |
|
|
117
|
+
| `INSPECT_BRIEF_SKIP_EXISTING` | No | Set to `1`, `true`, `yes`, or `on` to skip Run IDs already in the CSV. |
|
|
118
|
+
|
|
119
|
+
## Manual export with the CLI
|
|
120
|
+
|
|
121
|
+
Use this flow when the hook was not enabled during the Inspect run, or when you
|
|
122
|
+
need to process existing logs again.
|
|
123
|
+
|
|
124
|
+
### 1. Choose the input logs
|
|
125
|
+
|
|
126
|
+
At least one of `--log-dir` or `--log-files` is required:
|
|
127
|
+
|
|
128
|
+
- `--log-dir` recursively discovers `.eval` logs under a directory.
|
|
129
|
+
- `--log-files` accepts one or more explicit `.eval` paths or filesystem URIs.
|
|
130
|
+
Repeat the option, separate sources with commas, or combine both forms.
|
|
131
|
+
- Supplying both combines the discovered and explicit logs and removes duplicates.
|
|
132
|
+
|
|
133
|
+
JSON-formatted Inspect logs are not supported by either CLI input option.
|
|
134
|
+
|
|
135
|
+
### 2. Run the export
|
|
136
|
+
|
|
137
|
+
After installation, invoke the console script:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
inspect-brief [OPTIONS]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Or run the CLI directly without adding it to the current project:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
uvx inspect-brief [OPTIONS]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### CLI options
|
|
150
|
+
|
|
151
|
+
| Option | Description |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `--log-dir` | Directory containing Inspect logs; recursively finds `*.eval` files and combines them with `--log-files` when both are supplied |
|
|
154
|
+
| `--log-files` | One or more explicit `.eval` paths or filesystem URIs (repeatable or comma-separated); combines them with logs found by `--log-dir` when both are supplied |
|
|
155
|
+
| `--tasks` | Tasks to include (repeatable or comma-separated); others are skipped |
|
|
156
|
+
| `--target-metrics` | JSON object (or path to a JSON file) mapping task → list of `InspectScore` objects |
|
|
157
|
+
| `--csv-path` | Output CSV path (default: `brief_results.csv` under `--log-dir`, or the current directory) |
|
|
158
|
+
| `--skip-existing` | Skip task runs whose Run ID is already in the CSV |
|
|
159
|
+
|
|
160
|
+
### CLI examples
|
|
161
|
+
|
|
162
|
+
Summarize every `.eval` under a log tree:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
inspect-brief --log-dir /path/to/inspect/logs
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Summarize specific files and write to a chosen CSV:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
inspect-brief \
|
|
172
|
+
--log-files /path/to/a.eval \
|
|
173
|
+
--log-files /path/to/b.eval \
|
|
174
|
+
--csv-path results.csv
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Provider-backed logs can be supplied directly:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
inspect-brief --log-files s3://bucket/path/run.eval
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Filter tasks and skip runs already recorded:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
inspect-brief \
|
|
187
|
+
--log-dir /path/to/inspect/logs \
|
|
188
|
+
--tasks inspect_evals/gpqa_diamond,inspect_harbor/gorilla_bfcl_parity \
|
|
189
|
+
--csv-path results.csv \
|
|
190
|
+
--skip-existing
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Target metrics
|
|
194
|
+
|
|
195
|
+
When `--target-metrics` is omitted, every metric present in the log scores is exported (with a scorer prefix when a log has multiple scorers).
|
|
196
|
+
|
|
197
|
+
When provided, pass a JSON object (inline or as a file path) mapping each task name to a list of `InspectScore` objects. Each object must have exactly these keys:
|
|
198
|
+
|
|
199
|
+
- `name` — metric name as it appears in the Inspect log
|
|
200
|
+
- `is_percentage` — whether to treat the value as a percentage (appends ` (%)` to the metric label)
|
|
201
|
+
- `is_higher_better` — appends `⬆️` or `⬇️` to the metric label
|
|
202
|
+
- `is_normalized` — if `is_percentage` is true and this is true, multiply the value by `100`
|
|
203
|
+
|
|
204
|
+
Example (quote the JSON for the shell):
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
inspect-brief --log-dir /path/to/logs --target-metrics '{
|
|
208
|
+
"inspect_evals/gpqa_diamond": [
|
|
209
|
+
{
|
|
210
|
+
"name": "accuracy",
|
|
211
|
+
"is_percentage": true,
|
|
212
|
+
"is_higher_better": true,
|
|
213
|
+
"is_normalized": true
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}'
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Or point at a file:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
inspect-brief --log-dir /path/to/logs --target-metrics ./target_metrics.json
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Output
|
|
226
|
+
|
|
227
|
+
Results are appended to the CSV. Columns:
|
|
228
|
+
|
|
229
|
+
| Created | Run ID | Benchmark | Metric | Score | Runtime (sec) |
|
|
230
|
+
| --- | --- | --- | --- | --- | --- |
|
|
231
|
+
| 2026-08-17T16:54:14+00:00 | L67rTm5rz3wkwVdTLMGDme | inspect_evals/gpqa_diamond | accuracy | 0.3699 | 28 |
|
|
232
|
+
|
|
233
|
+
- **Created** comes from `log.eval.created`, falling back to `log.stats.started_at`
|
|
234
|
+
- **Score** is formatted to 2 decimal places when `> 1.0`, otherwise 4 decimal places
|
|
235
|
+
- Failed or incomplete runs record a status string in the Score column when applicable
|
|
236
|
+
|
|
237
|
+
## Contributing
|
|
238
|
+
|
|
239
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for local setup, verification steps,
|
|
240
|
+
and pull-request expectations.
|