Skip to content

Guide · Agent skill

How to use the nnsight interpretability agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains the nnsight-remote-interpretability agent skill, a set of instructions and reference files that teaches an AI agent to write code for nnsight, a Python library for reading and changing the internals of neural networks. It is written for readers who have never installed an agent skill. By the end you will know how to install it, how to ask for help with a natural request, and what to check before sending any data to a remote service.

nnsight Neural Network InterpretabilityOrchestra-Research/AI-Research-SKILLs · MIT

Quick start

  1. 1Download the ZIP. Download the skill ZIP from this page and keep it somewhere you can find it.
  2. 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder.
  3. 3Or upload it in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Install nnsight and torch. Run pip install nnsight, plus torch version 2.0.0 or newer, in the Python environment you will use.
  5. 5Ask a specific research question. Describe the model, the internal component and the output you want in plain language.
  6. 6Set up NDIF only if needed. For remote runs on very large models, get an API key from login.ndif.us and set it as described in the skill.

What the skill makes the agent do

nnsight lets you look inside a model while it runs. You can read intermediate activations from a layer, save them, and overwrite them to test which parts of the model affect its output. The skill loads guidance on this library into your agent so it can write and explain these experiments for you.

The skill covers three workflows: activation analysis, activation patching, and remote execution through NDIF. Its source says the same code can run locally on a small model or remotely on a very large one (70B+) by setting remote=True.

  • Activation analysis: collect layer outputs and attention values, then inspect shapes, norms and top predictions.
  • Activation patching: copy activations from a clean prompt into a corrupted run and compare predictions.
  • Remote execution: run the same trace on large models hosted by NDIF, without a local GPU.

Install the skill from a ZIP or the Claude apps

Option 1, personal folder: download the ZIP from this page and unzip it into ~/.claude/skills/. Option 2, one project: unzip it into the .claude/skills/ folder inside that project.

Option 3, Claude apps: upload the ZIP under Settings → Capabilities → Skills.

  • The skill folder should contain SKILL.md, plus references/api.md, references/README.md and references/tutorials.md.
  • You also need Python with the nnsight package (>=0.5.0) and torch (>=2.0.0) installed to run the code the agent writes.

Install the Python packages the code needs

The skill's own installation section uses pip. Install the basic package, or add the vLLM extra if you want vLLM support.

pip install nnsight pip install "nnsight[vllm]"

How to trigger the skill with natural requests

You do not need special syntax. Describe the research goal in plain language and mention the model or the kind of analysis you need. The skill's description says it applies when you need to run interpretability experiments on massive models without local GPU resources, or when working with any PyTorch architecture.

Good requests name the model, the question, and the output you want. For example, ask for code that finds which layers matter for a fact, or asks for a layer-by-layer norm table on GPT-2.

  • Write activation patching code that swaps layer 8 from a clean prompt into a corrupted one on GPT-2.
  • Show me layer-by-layer activation norms for Llama-class models and explain the output.
  • Help me run this 70B interpretability experiment through NDIF without a local GPU.

Set up NDIF for remote execution

For remote runs, sign up at login.ndif.us to get an API key. The source shows two ways to provide it: set the NDIF_API_KEY environment variable, or set it directly in nnsight's CONFIG object. Use one of these methods, and do not paste the key into shared code.

import os os.environ["NDIF_API_KEY"] = "your_key" # Or configure directly from nnsight import CONFIG CONFIG.API_KEY = "your_key"

Read the safety notes before running remote code

This skill runs scripts and uses the network. Remote execution sends your inputs to NDIF servers, so prompts and anything else you send leave your machine. Do not use remote execution with sensitive or proprietary model weights or prompts unless your own policy allows sending them to a third-party service.

Local runs still download model weights from HuggingFace. Review any code the agent writes before running it, especially code that changes model activations or contacts a remote service.

  • Confirm whether a run is local (no remote=True) or remote before you start it.
  • Keep API keys out of files you share.
  • Remember that model weights are downloaded from HuggingFace the first time you load them.

Tips for better results

Ask the agent to explain each line of the trace block, since the saved values are only readable after the context closes. If you are working on a small model, you can also ask for a TransformerLens version, because the skill notes that TransformerLens may be simpler for small local models.

  • Call .save() on any value you need after the trace block ends.
  • Start with GPT-2 locally to check the logic before moving to a larger model.
  • Name the layer count or the tokens you care about so the agent uses the right indices.

What people use it for

  • Teaching a student to read layer activations on GPT-2 with norm and top-token outputs.
  • Writing an activation patching sweep over layers and token positions for a factual recall prompt.
  • Running a remote trace on a 70B-class Llama model from a laptop without a local GPU.
  • Asking the agent to explain existing nnsight code line by line before modifying it.

Frequently asked questions

Is the nnsight agent skill free?

The skill is released under the MIT licence, as stated in its source. The nnsight library is installed with pip, and the source does not state any price for NDIF, so check login.ndif.us for its current terms.

How do I install nnsight for this skill?

Run pip install nnsight in your Python environment. For vLLM support, run pip install "nnsight[vllm]". The skill needs nnsight 0.5.0 or newer and torch 2.0.0 or newer.

Do I need an API key?

Only for remote execution. Sign up at login.ndif.us to get an NDIF API key. Local runs on small models such as GPT-2 do not use the remote service.

Where do I put the skill folder?

Unzip it into ~/.claude/skills/ for personal use or into .claude/skills/ inside a project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

Is it safe to use remote execution?

Remote execution sends your inputs to NDIF servers, so avoid it for sensitive or proprietary model weights or prompts. The skill runs scripts and uses the network, so review code before you run it.

Should I use TransformerLens or nnsight?

Use nnsight when you need large-model access through NDIF or want to work with any PyTorch architecture. The skill notes that TransformerLens may be simpler for small local models with one consistent API.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits ML researchers and students learning mechanistic interpretability on GPT-2 or Llama-class models, and teams without big GPUs who want NDIF access to very large models. It is a specialist research library, so people who want a general AI assistant or ordinary app code should pick something else. If your data is sensitive, do not use remote execution, and consider TransformerLens for simpler small-model work.

Download the skill