Skip to content
PyRank
  • Search
  • PyPI
  • GitHub
  • Insights
  • Compare
  • Advisories
  • Ecosystem
  • About

Mechanistic Interpretability Python Packages

Python packages with the GitHub topic mechanistic-interpretability. Sorted by monthly downloads, with stars and forks.
johnmarktaylor91
torchlens

Inspect, visualize and intervene on any operation in any neural network. Capture every activation and gradient, the full computational graph and 800+ metadata fields without changing model code. Supports PyTorch, JAX, TensorFlow, MLX, PaddlePaddle and tinygrad. Validated on 6400+ models. Built for researchers and their AI agents.

9K 714 35
stanfordnlp
pyvene

Stanford NLP Python library for understanding and improving PyTorch models via interventions

6K 922 120
AIAnytime
ablate-llm

🔓 Ablate — directional ablation (abliteration) toolkit for open-source LLMs. Automatic censorship/refusal removal via residual-stream direction ablation, with KL-guided search, an LLM-judge harness, and one-call push to the Hub.

4K 10 2
ndif-team
nnterp

Unified access to Large Language Model modules using NNsight

4K 126 12
vcnoel
spectral-trust

Graph-spectral diagnostics, animated views and interventions for transformer attention: Fiedler value, HFER, graph-frequency steering and frequency-resolved patching for Hugging Face, TransformerLens and nnsight models.

3K 5 0
designer-coderajay
glassbox-mech-interp

Mechanistic interpretability for transformers: causal circuit discovery, measured faithfulness, and draft EU AI Act Annex IV documentation. Includes an investigation layer for multi-change regressions. MIT core + BSL 1.1 compliance engine and investigation layer.

3K 3 0
a9lim
llmoji

Making agents cuter

1K 2 0
PxA-Labs
safetypulse

Early warning for LLM safety drift during fine-tuning: a Circuit Integrity Score read from the model's refusal circuit flags unsafe checkpoints before harm is measurable, with SafeTune repair and AuditKIT audit.

1K 6 0
ayushh0110
wsr

WSR find out why an open-weight LLM gave a broken reply (template, sampler, quant, or weights) and fix it at the right level. Weight edits ship only if a held-out test accepts them.

988 5 0
chessformer-lens
chessformer-lens

A toolkit+visualizer that is designed for mech interp researchers working with chess models that use transformers tokenized by square.

972 10 0
sumit-1
tokenshark

Wireshark for AI: Open, inspect, live-edit, and step-debug LLMs and Diffusion/DiT models in the browser from raw PyTorch.

893 4 0
YakinRubaiat
nnviz-mri

An MRI scanner for language models: see every weight, the wiring as a 3-D brain, and what lights up token by token (Qwen, Llama, SmolLM, ...). Three.js viewer.

867 0 0
SpiliosDimakopoulos
twinlens

Do attribution graphs predict what GPT-2 really does? 8,064 feature edits, why graphs mislead (frozen LayerNorm/attention), a fix that keeps them linear, a trust score, a CLI and a browser demo.

839 0 0
moudrkat
brainscope

OpenAI-compatible server with a live view into any HF model's residual stream. pip install brainscope

836 57 11
muhammadmahadazher
modelmri

Chrome DevTools for AI models and agents — see attention, features, and agent steps inside any local model.

790 1 0
steering-vectors
steering-vectors

Steering vectors for transformer language models in Pytorch / Huggingface

718 168 18
wrynx
undercurrent

Undercurrent: production-grade LLM activation probing and intervention. Works with Hugging Face Transformers and vLLM.

664 8 1
RudrenduPaul
neuronscope-cli

CLI and MCP server that traces which attention heads and neurons drive an LLM's output, built on TransformerLens.

585 3 0
wheattoast11
carl-studio

CARL (Coherence-Aware Reinforcement Learning) — information-theoretic reward signals for LLM training via token-level probability distributions

468 5 1
sarimahsan
interplens

InterpLens is an open-source mechanistic interpretability toolkit that accelerates neural network reverse-engineering with interactive circuit debugging and real-time telemetry. It bridges research prototyping and model transparency with zero-copy GPU memory attachment and universal transformer hooking.

440 2 0
elementmerc
senbonzakura

The world's top open-weight AI model workshop. Measure, uncensor and audit: refusal removal for transformer language models, with the instruments to measure what the edit cost.

427 13 1
garykbrixi
minerva-dna

Coevolutionary discovery using genome language models

423 35 3
moudrkat
hidden-directions

Steering vectors with receipts: make one, catch one, deploy a calibrated one — extraction, audit, and a three-tier eval framework (behavioral, damage, mechanistic)

395 5 1
wheattoast11
carl-core

Coherence math primitives for CARL (Coherence-Aware Reinforcement Learning)

350 5 1
    • Original data from PyPI, GitHub, and OSV; downloads served through ClickHouse
    • Sources & methodology