Skip to main content

Inspect Toolkit

Reusable building blocks for Inspect AI evaluations: metrics, scorers, solvers, tools, dataset sources, and sandbox helpers that are useful to anyone using Inspect, independent of any particular config system or agent framework.

Features include:

  • Metrics for score distributions, threshold accuracy, and AI control safety and usefulness, usable with any scorer
  • Scorers for running a repository's tests, searching sandbox files, checking sandbox state and asserting on database changes
  • Solvers for repo setup, test running, snapshots, code and database diffs, and eval export/import
  • Tools that defer construction until task state exists, and that let an agent score itself mid-trajectory
  • Pluggable local and GitHub dataset sources with sparse-checkout caching
  • A FixtureManager and a ready-to-use default Docker sandbox with composable features
  • SQLite diffing with a MongoDB-like selector language for asserting on database changes

It depends only on inspect-ai, numpy and pyyaml (plus gitpython, used by the git-diff helpers vendored from Control Arena), and was extracted from the refactor-arena evaluation setting.

Documentation

Full documentation, including a user guide and API reference, is available at fastfedora.github.io/inspect-toolkit.

Install

pip install inspect-toolkit

Requires Python 3.12+.

Quick Start

Everything is a plain Inspect component: pass the metrics to any @scorer, and drop the scorers, solvers and tools into a Task.

from inspect_ai.scorer import mean, scorer, stderr
from inspect_toolkit.metrics import percentile, threshold_accuracy
from inspect_toolkit.scorers import test_runner_scorer

@scorer(metrics=[mean(), stderr(), percentile(target=95), threshold_accuracy(threshold=80)])
def my_scorer():
    ...

tests = test_runner_scorer("percent-pass")   # run the repo's test suite in the sandbox

See the documentation for the full guide and API reference.

Development

uv sync
just test      # run the test suite
just lint      # ruff + pyright
just docs      # preview the docs (Quarto)

License

MIT License. See LICENSE.

Metadata

Release files for inspect-toolkit 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inspect-toolkit 1.0.1
File Size Uploaded Provenance Actions
inspect_toolkit-1.0.1.tar.gz 360.0 kB Without provenance Details for inspect_toolkit-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inspect-toolkit 1.0.1
File Interpreter ABI Platform Actions
inspect_toolkit-1.0.1-py3-none-any.whl Python 3 none any Details for inspect_toolkit-1.0.1-py3-none-any.whl

Total release size: 508.0 kB

Release files / inspect_toolkit-1.0.1.tar.gz

Download URL inspect_toolkit-1.0.1.tar.gz
Size 360.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d7730c0f093cad41a24079afa2cf00d85d29429c9a2ecc824a503621db07eaa
BLAKE2b-256 checksum
How to use checksums
270ac3c3930a1449f8cf56b1c0628531f7f5cfa20508bc28c2d49e06f1248012
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / inspect_toolkit-1.0.1-py3-none-any.whl

Download URL inspect_toolkit-1.0.1-py3-none-any.whl
Size 148.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bb25613f70cc5591c6ae1bc9914c8c8d4df42a37ed35e05a4e3346164f82d9c
BLAKE2b-256 checksum
How to use checksums
11d2990eac997d2931e15d3617923302df63e50b3fcc867de48e960abf6b022c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for inspect-toolkit 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page