#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
Stars, last 29 weeks+749
25 Apr 2026: 3,332 stars2 May 2026: 3,361 stars9 May 2026: 3,379 stars16 May 2026: 3,401 stars23 May 2026: 3,437 stars30 May 2026: 3,463 stars6 Jun 2026: 3,497 stars13 Jun 2026: 3,532 stars20 Jun 2026: 3,568 stars27 Jun 2026: 3,590 stars4 Jul 2026: 3,622 stars11 Jul 2026: 3,651 stars18 Jul 2026: 3,677 stars25 Jul 2026: 3,703 stars1 Aug 2026: 3,730 stars8 Aug 2026: 3,755 stars15 Aug 2026: 3,791 stars22 Aug 2026: 3,808 stars29 Aug 2026: 3,832 stars5 Sept 2026: 3,855 stars12 Sept 2026: 3,872 stars19 Sept 2026: 3,895 stars26 Sept 2026: 3,914 stars3 Oct 2026: 3,936 stars10 Oct 2026: 3,963 stars17 Oct 2026: 3,981 stars24 Oct 2026: 4,001 stars31 Oct 2026: 4,030 stars7 Nov 2026: 4,065 stars14 Nov 2026: 4,081 stars

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
Also in ML frameworks and libraries
RankProjectScore
1transformersModel-definition library for pretrained text, vision, audio and multimodal models169.3k starsApache-2.094 out of 100
2ultralyticsPython library and CLI for training and running YOLO vision models63.5k starsAGPL-3.094 out of 100
3pytorch-image-modelsPyTorch library of image models, pretrained weights and training scripts37.3k starsApache-2.094 out of 100
#4pytorchPython tensor library with GPU support and tape-based autograd105.8k starscustom license93 out of 100
#5supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.7k starsMIT92 out of 100