#152152nd of 433 in ML frameworks and libraries
nnsight
Python library for reading and editing PyTorch model internals during a forward pass
Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.
Watch puts nnsight on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.nnsight is on your watch list. Its new releases and problems show there.
- Stars
- 1.2k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Nov 2026
- Language
- Python
913 on 7 May 20261,164 on 26 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
nnsight lets you open a `with model.trace(...)` block and read, edit or save any internal value of a PyTorch model, such as layer outputs, attention patterns and gradients, without registering hooks. It wraps HuggingFace, diffusers and vLLM models, or any `torch.nn.Module` via `NNsight`. The same trace can run on NDIF infrastructure with `remote=True` for models too large to host locally.
Who it is for: Interpretability researchers probing or editing deep learning model internals
Strengths
- Interventions are written as ordinary Python in execution order, with no hook registration
- Works with any torch.nn.Module; ships wrappers for HuggingFace, diffusers and vLLM
- Same trace code runs locally or on NDIF via remote=True
- Supports gradients, batched invokes, per-step generation access and out-of-order module calls
Weaknesses
- Remote runs require an NDIF API key and only cover models hosted on NDIF
- Trace blocks defer execution, so values need .save() and differ from normal Python
- PyTorch only; no other tensor frameworks are mentioned
- Module output shapes vary (tensor vs tuple), so users must inspect each model
What it needs
- GPU optional
- Needs PyTorch, NDIF (optional, for remote=True)
- Models: PyTorch nn.Module, HuggingFace Transformers, diffusers, vLLM
What changed
- v0.8.3 ↗ (opens in a new tab)Breaking
“vLLM is pinned to 0.33. The vllm extra requires vllm>=0.33,<0.34 (#837). vLLM 0.33 needs Python 3.11 or newer and transformers<5.21, and publishes only a CUDA 13 wheel.”
- v0.8.2 ↗ (opens in a new tab)Breaking
“vLLM is pinned to 0.27. The vllm extra now requires vllm>=0.27.1,<0.28 (#801). Without a pin, pip install "nnsight[vllm]" installed vLLM 0.32, where taps stop firing after the prefill without an erro…”
From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS
Also in ML frameworks and libraries
See all 433| Rank | Project | Score |
|---|---|---|
| #150 | tsne-cudaCUDA implementation of t-SNE with a scikit-learn-style Python API | 65 out of 100 |
| #151 | minariPython library for creating and loading offline reinforcement learning datasets | 65 out of 100 |
| #153 | vit-pytorchPyTorch implementations of Vision Transformer and many of its variants | 64 out of 100 |
| #154 | catboostGradient boosting library over decision trees with categorical feature support | 64 out of 100 |
| #155 | elixir-nx/nxTensors and numerical definitions for Elixir, with XLA and LibTorch backends | 64 out of 100 |