#6868th of 242 in ML frameworks and libraries
transformerlens
Python library for inspecting and editing activations in language models
- Stars
- 4.1k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- Python
3,332 on 25 Apr 20264,081 on 14 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
TransformerLens is a Python library for mechanistic interpretability. It loads open models from HuggingFace through TransformerBridge, caches any internal activation, and lets you add hooks that edit, remove or replace activations during a forward pass. The README lists 15,000+ models across 140+ architecture families, plus experimental Mamba-1 and Mamba-2 adapters.
Who it is for: Interpretability researchers reverse engineering open language models
Strengths
- Caches and hooks any internal activation, enabling ablation and activation patching
- Covers 15,000+ models across 140+ architecture families via TransformerBridge
- Default bridge output matches raw HuggingFace logits and activations
- Extensive tutorials, ARENA exercises and a research gallery built on it
Weaknesses
- 4.0 removed HookedTransformer.from_pretrained, so older code needs migration
- HookedSAETransformer was removed in 2.0; SAE work moved to SAELens
- Mamba/SSM support is labeled experimental
- Gated models such as Llama and Gemma need an HF_TOKEN
What it needs
- GPU optional
- Needs HuggingFace Hub
- Models: HuggingFace transformers models, GPT-2, Llama, Mistral, Gemma
What changed
From the release notes. No flag means the note does not say so, not that the upgrade is safe.
Also in ML frameworks and libraries
See all 242| Rank | Project | Score |
|---|---|---|
| 1 | transformersModel-definition library for pretrained text, vision, audio and multimodal models | 94 out of 100 |
| 2 | ultralyticsPython library and CLI for training and running YOLO vision models | 94 out of 100 |
| 3 | pytorch-image-modelsPyTorch library of image models, pretrained weights and training scripts | 94 out of 100 |
| #4 | pytorchPython tensor library with GPU support and tape-based autograd | 93 out of 100 |
| #5 | supervisionPython toolkit for loading, annotating and counting computer vision detections | 92 out of 100 |