interp-engine
interp-engine is an interpretability engine that is fast, standardized (34 'points'/addresses across architectures), and easy to use and debug. It powers all of Neuronpedia's inference and is checked for accuracy against HF Transformers and other engines.
This repo contains:
validator/, which compares/validates it against TransformerLens, and nnsight/nnterp on real architectures.visualizer-web/, a "cheat sheet" hosted at interp-engine.org of each 'point' (egresid_post.16), standardized across architectures.gpu-sizer/, which finds the GPU/config you need to fit an interp-engine model (and what performance you'll get), to avoid OOMing while working. docs | API
Installation
pip install 'interp-engine[vllm]' # preferred install: includes vLLM support (CUDA required)
pip install interp-engine # eager backend only
Simple Usage
from interp_engine import Address, load_model, run_with_cache
# VLLM (default): low VRAM, medium speed, every point, chosen per request
model = load_model("Qwen/Qwen3-8B")
# VLLM-STATIC: high VRAM, high speed, only the points you declare (default resid_post)
# model = load_model("Qwen/Qwen3-8B", backend="vllm-static")
# VLLM-GENERATE: fastest, generation only -- no capture, no steering
# model = load_model("Qwen/Qwen3-8B", backend="vllm-generate")
# EAGER: low VRAM, low speed
# model = load_model("Qwen/Qwen3-8B", backend="eager")
point = Address("resid_post", 10) # or string: "resid_post.10"
cache = run_with_cache(model, model.to_tokens("Hello, world"), [point])
cache[point] # [batch, pos, ...]
AI Agents
Add "use interp-engine" to your prompt and let your agent figure it out - everything is fully documented in this repo and open source.
Supported Points ("Addresses")
interp-engine supports 34 standardized points ("Addresses") across architectures: every one of them on the eager backend, 28 of them on vLLM. Check interp-engine.org for the "cheat sheet", or SUPPORTED_POINTS.md for a markdown version with the per-backend detail.
Performance / Speed
vLLM gives interp-engine high throughput via concurrency, and backend="vllm-static" gives even higher throughput at the cost of higher VRAM usage. Every column below is capture-capable.
Measured on NVIDIA B200, bf16, 512-token prompt, 128 new tokens.
One stream (tok/s):
| model | eager | vLLM | vLLM + static taps |
|---|---|---|---|
gemma-2-2b |
31 | 31 (1.0x) | 214 (6.9x) |
qwen3-4b |
24 | 47 (2.0x) | 296 (12.3x) |
llama-3.1-8b |
33 | 57 (1.7x) | 256 (7.9x) |
qwen3.8-27b |
9.9 | 12 (1.2x) | 63 (6.4x) |
deepseek-v4-flash-0731 |
3.3 | 2.9 (0.9x) | 119 (36x) |
8 concurrent requests (aggregate tok/s):
| model | eager | vLLM | vLLM + static taps |
|---|---|---|---|
gemma-2-2b |
30 | 226 (7.5x) | 1,238 (41x) |
qwen3-4b |
24 | 333 (14.0x) | 1,018 (43x) |
llama-3.1-8b |
32 | 419 (13.0x) | 1,536 (48x) |
qwen3.8-27b |
9.5 | 87 (9.2x) | 386 (41x) |
deepseek-v4-flash-0731 |
3.2 | 23 (7.2x) | 402 (127x) |
backend="vllm-static" is opt-in, and serves only the tap set it declared — static_points="auto" by default, or a list you name. PERFORMANCE.md has how it works and what it trades; benchmarks/results-latest.md has every figure at full precision, including capture, steering and lens latencies; benchmarks/README.md has how the tables above are rounded.
Correctness
We verify correctness in two main ways:
- A test suite that checks results across several models - what each check is designed to catch is in INTERNALS.md.
- A full
validatorcomparison engine that checks most hook points across 50+ models, at early, middle and late layers - fully reproducible, with detailed results saved in the git repo atvalidator/.
GPU-Sizer
Never OOM again - interp-engine includes gpu-sizer, an intuitive UI which tells you what GPU(s) and configs you need to get the best performance out of your selected model. For example, interp-engine.org/sizer/Qwen/Qwen3.6-27B shows that you can run Qwen3.6-27B with interp-engine's vllm-static backend for max speed while keeping it in a single 80GB A100, and have ~40k tokens for the KV Cache.
Why use an Interpretability Engine instead of building from scratch?
- Speed: Get performance without sacrificing correctness.
- Standardization + Verification: Eliminate ambiguity when referring to points, plus a full test suite included.
- Faster Dev / Fewer Tokens Used: You could spend ten million tokens and have your AI write, test, and make production-ready an interpretability engine. Or you could just
pip install interp-engine[vllm].
Caveats
- Gemma 4 requires transformers 5.14.1 because 5.15 moved
head_dimintoper_layer_configand vLLM's config read dies before a weight loads (vllm#51744). - DeepSeek-V2 on transformers older than 5.15.0 captures a wrong attention temperature — the engine warns at load, and upgrading is the fix (COMPATIBILITY.md).
- MXFP4 checkpoints (gpt-oss) need
interp-engine[quant], which the[vllm]extra does not include; without it transformers dequantizes them to bf16 at roughly 3x the weights, which can turn a model that fits into one that does not.
Per-architecture structural quirks — which points a family serves and why — are not caveats but facts about the architecture, and live in ARCHITECTURE_QUIRKS.md.
Development / Contributing
Activate the shared git hooks once per clone — they format staged Python, rebuild the generated files, and run CI's static checks before a push. Details in CONTRIBUTING.md.
make hooks # or: git config core.hooksPath .githooks
Contact
Bugs and feature requests belong in issues. For anything else: johnny@neuronpedia.org.
License
Apache 2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interp_engine-1.5.0.tar.gz.
File metadata
- Download URL: interp_engine-1.5.0.tar.gz
- Upload date:
- Size: 856.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90a63c64bfbda4c71886a1525580bc78494493989c07289b92baf2e7c413b0ee
|
|
| MD5 |
90c32210bcca0053af7bc81972bfcf76
|
|
| BLAKE2b-256 |
90036ef7e0657f8b4bd21e10a9be5a23f5273f5d96574869658455c7d15b412f
|
Provenance
The following attestation bundles were made for interp_engine-1.5.0.tar.gz:
Publisher:
release.yml on decoderesearch/interp-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interp_engine-1.5.0.tar.gz -
Subject digest:
90a63c64bfbda4c71886a1525580bc78494493989c07289b92baf2e7c413b0ee - Sigstore transparency entry: 2679765834
- Sigstore integration time:
-
Permalink:
decoderesearch/interp-engine@021825e487c1eedc826cfc73385d30dab1977b6b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/decoderesearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@021825e487c1eedc826cfc73385d30dab1977b6b -
Trigger Event:
push
-
Statement type:
File details
Details for the file interp_engine-1.5.0-py3-none-any.whl.
File metadata
- Download URL: interp_engine-1.5.0-py3-none-any.whl
- Upload date:
- Size: 430.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb1c7ba15c37f7de4c92a6b3cba77fe480c04772e1d3f414853522c306b8d536
|
|
| MD5 |
b098b7298702296c1711081e75d1239f
|
|
| BLAKE2b-256 |
f093c6fd95547ac37abd6488b38580ea9e3e1e1a23b6f64619b698434e252367
|
Provenance
The following attestation bundles were made for interp_engine-1.5.0-py3-none-any.whl:
Publisher:
release.yml on decoderesearch/interp-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interp_engine-1.5.0-py3-none-any.whl -
Subject digest:
cb1c7ba15c37f7de4c92a6b3cba77fe480c04772e1d3f414853522c306b8d536 - Sigstore transparency entry: 2679766139
- Sigstore integration time:
-
Permalink:
decoderesearch/interp-engine@021825e487c1eedc826cfc73385d30dab1977b6b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/decoderesearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@021825e487c1eedc826cfc73385d30dab1977b6b -
Trigger Event:
push
-
Statement type: