Skip to content

Installation

Requirements

  • Python 3.10 or higher
  • PyTorch 2.4 or higher

Install from PyPI

The simplest way to install NNsight is via pip:

pip install nnsight

Install from Source

For the latest development version, install directly from GitHub:

pip install git+https://github.com/nnsight/nnsight.git

Or clone the repository and install in editable mode:

git clone https://github.com/nnsight/nnsight.git
cd nnsight
pip install -e .

Optional Dependencies

vLLM Support

For high-performance inference with vLLM, install the vllm extra:

pip install nnsight[vllm]

Verify Installation

Verify your installation by running:

import nnsight
print(nnsight.__version__)

Next Steps

Once installed, head to the Quick Start guide to run your first intervention!