Python SDK + CLI for openinterp.org — search the feature Atlas, generate Traces from your SAE, compute InterpScore. The operational layer for mechanistic interpretability.
Project description
openinterp
Python SDK + CLI for openinterp.org — search the feature Atlas, generate Traces from your SAE, rank against the InterpScore leaderboard.
Install
pip install openinterp # lite: Atlas search + CLI (no torch)
pip install "openinterp[full]" # + torch/transformers/safetensors for trace generation
Requires Python ≥ 3.10.
Quick start
Search the Atlas (offline, no GPU needed)
$ openinterp atlas "overconfidence"
Atlas results: 'overconfidence'
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━…
┃ ID ┃ Name ┃ Model ┃ AUROC ┃ Description
┡━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━…
│ f2503 │ overconfidence_patt… │ Qwen/Qwen3.6-27B │ 0.54 │ Definitive …
│ f1847 │ urgency_assessment │ Qwen/Qwen3.6-27B │ 0.68 │ Time-critic…
└───────┴───────────────────────┴──────────────────┴───────┴────────────…
>>> from openinterp import search_features
>>> features = search_features("overconfidence", model="Qwen/Qwen3.6-27B")
>>> features[0].id
'f2503'
Generate a Trace from your own SAE
pip install "openinterp[full]"
openinterp trace \
--model google/gemma-2-2b \
--sae-repo YOUR_HF_USER/gemma2-2b-sae-first \
--prompt "The capital of France is" \
--layer 12 \
--d-model 2304 --d-sae 16384 --k 64 \
--out my_trace.json
This:
- Loads the base model in bf16 with SDPA
- Loads your SAE from HuggingFace (sae_lens format)
- Generates 30 tokens, captures residuals at layer 12
- Applies the SAE, picks top-10 active features
- Writes a
TraceJSON that matches openinterp.org/observatory/trace exactly
Use the Trace in the Python API
from openinterp import generate_trace
trace = generate_trace(
model_id="google/gemma-2-2b",
sae_repo="YOUR_HF_USER/gemma2-2b-sae-first",
prompt="The capital of France is",
layer=12,
d_model=2304,
d_sae=16384,
k=64,
)
print(trace.model_dump_json(indent=2)) # Exact Trace Theater schema
Optionally attach feature labels from notebook 04
# After running 04_discover_features.ipynb and saving feature_catalog.json:
openinterp trace ... --catalog feature_catalog.json
What's in v0.1.0
| Command | Status | What it does |
|---|---|---|
openinterp atlas <query> |
✅ Live | Feature search across the public Atlas, with offline fallback to the shipped demo features |
openinterp trace ... |
✅ Live (needs [full]) |
Real SAE-based trace generation, sae_lens format, any HF model |
openinterp info |
✅ Live | Show version + optional dep status |
Planned for v0.2.0 (Q2 2026):
openinterp upload-trace trace.json→ get a shareable openinterp.org URLopeninterp score --sae-repo X→ compute InterpScore locally (wraps notebook 18)openinterp steer --sae-repo X --feature Y --alpha Z→ live intervention (wraps notebook 06)openinterp circuit --sae-repo X --prompt Y→ attribution graph JSON (wraps notebook 14/15)openinterp publish <repo> <artifact>→ HuggingFace release with model card
Standing on the shoulders of
- Neuronpedia — the SAE encyclopedia
- Gemma Scope — reference at-scale SAE suite
- Gao et al. 2024 — TopK + AuxK recipe
- SAELens — our safetensors format
License
MIT. Built by Caio Vicentino + OpenInterpretability. 2026.
openinterp.org · github.com/OpenInterpretability · hi@openinterp.org
Project details
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 openinterp-0.1.0.tar.gz.
File metadata
- Download URL: openinterp-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81cb8244d31a5c6612d972b58ca7ae0b8f8f47cbac43e3ed5bca8eb2ad85706c
|
|
| MD5 |
1878130353d9454d78f7b5be43a4e027
|
|
| BLAKE2b-256 |
cdeac26f07c6352572156fa526a7ba25a1020e3395f573e2ed08c66294577e03
|
File details
Details for the file openinterp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openinterp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
357bfa8ad971341350076d7a1d4f9314e154c31fe5db0b3f807207253ebad360
|
|
| MD5 |
ed58fe54ab0269db52bedba8f9e1625e
|
|
| BLAKE2b-256 |
0aa4346063993f9355b8aba1e3e69996020fc296a24b0ced9993e7c9a05c46e2
|