Practical overview
When it fits
Use LIT when you need an interactive interface for debugging or comparing model behavior, rather than only inspecting predictions in code or in aggregate reports.
Who it is for
- Machine-learning practitioners investigating model errors and individual predictions.
- Researchers comparing model outputs or testing how input changes affect behavior.
- Developers integrating custom models and datasets through LIT's APIs.
Documented uses
- Identify types of examples on which a model performs poorly.
- Inspect an individual prediction using salience maps and prediction visualizations.
- Compare models or compare a model's outputs across examples.
- Explore model behavior across data slices, bins, custom metrics and embedding spaces.
- Create edited or generated counterfactual examples and evaluate model responses.
Requirements & limits
The project is open source under the Apache-2.0 license. The documented default installation is available through pip as `lit-nlp`.
- Custom models and datasets need a data loader following LIT's Dataset API and a model wrapper following its Model API.
- The default pip package includes the Python API, built-in interpretability components and web app; optional dependency groups cover supplied examples and tests.
- Source-based code changes require Python 3.9 or later and a frontend build with Yarn.
- Notebook use is documented for Colab, Jupyter and Google Cloud Vertex AI notebooks.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install LIT with pip
Install the LIT Python API, built-in interpretability components and web application.
Before you start
- Python package installer pip
Steps
Install the package with the command below.
pip install lit-nlpIf using the provided demos or test suite, install the corresponding optional dependencies, such as
lit-nlp[examples-discriminative-ai],lit-nlp[examples-generative-ai]orlit-nlp[test].
Expected outcome
The default package installation includes the LIT Python API, built-in interpretability components and web application; optional packages add dependencies for the selected examples or tests.
Guide limitations
- This installation guidance does not configure a custom model or dataset.
- The optional dependency groups cover the named examples and test suite.
Set up LIT from source for code changes
Prepare a source checkout and build the LIT frontend.
Before you start
- Python 3.9 or later
- Git
- A Python environment manager such as venv
- Yarn
Steps
Clone the repository with the command below and enter the
litdirectory.git clone https://github.com/PAIR-code/lit.gitCreate and activate a virtual environment with the command below and
source .venv/bin/activate.python -m venv .venvInstall the source and test dependencies with the command below.
python -m pip install -e '.[test]'Build the frontend by running
(cd lit_nlp; yarn && yarn build).
Expected outcome
The source installation and frontend build steps prepare a local LIT checkout for code changes.
Guide limitations
- The repository does not include a distributable version of the LIT app; the frontend must be built from source.
- The source instructions shown install dependencies for all examples and the test suite.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 10 October 2026
- Original website title
- PAIR-code/lit · Official homepage title · retained in its source language

