Skip to content

nnsight Neural Network Interpretability

Lets the agent inspect and modify internal activations of PyTorch models, locally or remotely via NDIF

Stars
14,195
Licence
MIT
Files
4 files

What it does

This skill teaches the agent how to use nnsight, a Python library that lets researchers look inside a neural network while it runs, read intermediate activations, and change them to test what parts of the model do. Once installed, the agent can write and explain this kind of experiment code, and can point to a remote service (NDIF) so very large models (70B+) can be probed without a local GPU. It is aimed at interpretability research rather than general AI use.

Great for

  • ML researchers or students learning mechanistic interpretability on GPT-2 or Llama-class models
  • Engineers who need activation patching or layer-by-layer analysis code written for them
  • Teams without big GPUs who want to run experiments on very large models through NDIF

Skip it if

  • People who just want to use an AI chatbot or build ordinary apps; this is a specialist research library
  • Work involving sensitive or proprietary model weights or prompts sent to a third-party remote service, since remote execution sends your inputs to NDIF servers
  • Users who want a single stable API across many models; the skill itself notes TransformerLens may be simpler for small local models

Try asking

  • “Write nnsight code that saves the residual stream of layers 5 to 10 for a prompt and compares them”
  • “Set up an activation patching experiment that swaps activations from a clean prompt into a corrupted one”
  • “Convert my local nnsight trace to run remotely on Llama-3.1-405B with NDIF”
  • “Explain what the .save() call does in an nnsight tracing block”
Step-by-step guide: how to use nnsight Neural Network InterpretabilityInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 4 original files, the MIT licence and an attribution note.

    nnsight.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip nnsight.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip nnsight.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Start with a small model such as gpt2 locally to verify your trace logic before switching to remote=True
  • Call .save() on every value you need after the trace context exits, otherwise it will not be available
  • Keep your NDIF API key out of shared code and notebooks; store it in an environment variable

What's inside

  • references/api.md
  • references/README.md
  • references/tutorials.md
  • SKILL.md

Redistributed unmodified from Orchestra-Research/AI-Research-SKILLs under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.