Install the NeMo Guardrails Library
Follow these steps to install the NeMo Guardrails library.
Prerequisites
Verify your system meets the following requirements before installation.
Starting with version 0.25.0, the NVIDIA NeMo Guardrails library requires Python 3.11 through 3.13. Python 3.10 reached end of life on October 1, 2026. Upgrade your Python environment before upgrading the library.
Quick Start
Use the following steps to install the NeMo Guardrails library in a virtual environment.
-
Create and activate a virtual environment:
Linux/macOS
Windows (Git Bash)
-
Install the NeMo Guardrails library. Set
NVIDIA_API_KEYto your personal API key generated on build.nvidia.com. -
Set up an environment variable for your NVIDIA API key.
This is required to access NVIDIA-hosted models on build.nvidia.com. The tutorials and example configurations (examples/configs) in this library include configurations that use NVIDIA-hosted models.
Verify the Installation
Run these commands in the virtual environment where you installed the library:
The first command prints the installed package version. The second lists the CLI commands. These checks do not call a model or require an API key. Follow a tutorial to verify inference with your selected models.
Get the Example Files
Installing with pip installs the Python package. To follow instructions that use repository paths such as examples/configs/, clone the repository and run those commands from its root:
For a released package, check out its matching release tag before using the examples. For example, use git checkout v<installed-version>, replacing <installed-version> with the version printed above.
The develop branch contains development examples that may require a newer package.
Alternative Installation Methods
Install the NeMo Guardrails library from source using pip or uv. Choose this method if you want to contribute to the library or use the latest development version.
pip
uv
Extra Dependencies
You can install the NeMo Guardrails library with optional extra packages to add useful functionalities. The table below shows a comprehensive list.
Starting with 0.25, the default installation does not require nest-asyncio.
Use async APIs in notebooks and async applications. Existing examples that import nest_asyncio require pip install 'nemoguardrails[nest-asyncio]'.
The chat-ui and all extras still install nest-asyncio through Chainlit. If you need an installation without that package, avoid those extras and verify your application’s other dependencies.
Some features such as AlignScore have additional requirements. See the feature documentation for details.
Docker
You can run the NeMo Guardrails library in a Docker container. For containerized deployment, see NeMo Guardrails with Docker.