> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/guardrails/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/guardrails/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/guardrails/_mcp/server.

# Install the NeMo Guardrails Library

> Install NeMo Guardrails with pip, configure your environment, and verify the installation.

Follow these steps to install the NeMo Guardrails library.

## Prerequisites

Verify your system meets the following requirements before installation.

| Requirement          | Details                                                                                                                                        |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **Operating System** | Windows, Linux, MacOS                                                                                                                          |
| **Python**           | 3.10, 3.11, 3.12, or 3.13                                                                                                                      |
| **Hardware**         | 1 CPU with 4GB RAM. The NeMo Guardrails library runs on CPU. External models may require GPUs, which may be deployed separately to the library |

## Quick Start

Use the following steps to install the NeMo Guardrails library in a virtual environment.

1. Create and activate a virtual environment:

   ```bash
   python3 -m venv .venv
   source .venv/bin/activate
   ```

   ```bash
   python -m venv .venv
   source .venv/Scripts/activate
   ```

2. Install the NeMo Guardrails library. Set `NVIDIA_API_KEY` to your personal API key generated on [build.nvidia.com](https://build.nvidia.com/).

   ```bash
   pip install nemoguardrails
   ```

3. Set up an environment variable for your NVIDIA API key.

   ```bash
   export NVIDIA_API_KEY="your-nvidia-api-key"
   ```

   This is required to access NVIDIA-hosted models on [build.nvidia.com](https://build.nvidia.com). The tutorials and example configurations ([examples/configs](https://github.com/NVIDIA-NeMo/Guardrails/tree/develop/examples/configs)) in this library include configurations that use NVIDIA-hosted models.

## Alternative Installation Methods

Install the NeMo Guardrails library from source using pip or Poetry. Choose this method if you want to contribute to the library or use the latest development version.

```bash
git clone https://github.com/NVIDIA-NeMo/Guardrails.git nemoguardrails
cd nemoguardrails
python -m venv .venv
source .venv/bin/activate
pip install -e .
```

```bash
git clone https://github.com/NVIDIA-NeMo/Guardrails.git nemoguardrails
cd nemoguardrails
python -m venv .venv
source .venv/bin/activate
poetry install
```

When using Poetry, prefix CLI commands with `poetry run`:

```bash
poetry run nemoguardrails server --config examples/configs
```

## Extra Dependencies

You can install the NeMo Guardrails library with optional extra packages to add useful functionalities. The table below shows a comprehensive list.

| Extra          | Description                                                                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `server`       | [Guardrails API server](/run-guardrailed-inference/using-fastapi-server/overview) dependencies (aiofiles for async file handling, openai for API schemas). FastAPI is a core dependency. Required to run `nemoguardrails server`. |
| `sdd`          | [Sensitive data detection](/configure-guardrails/guardrail-catalog/pii-detection#presidio-based-sensitive-data-detection) using Presidio                                                                                          |
| `eval`         | [Policy-based evaluation tools](/evaluation/evaluate-configuration) for testing guardrails                                                                                                                                        |
| `tracing`      | OpenTelemetry tracing support                                                                                                                                                                                                     |
| `gcp`          | Google Cloud Platform language services                                                                                                                                                                                           |
| `jailbreak`    | YARA-based jailbreak detection heuristics                                                                                                                                                                                         |
| `multilingual` | Language detection for multilingual content                                                                                                                                                                                       |
| `all`          | All optional packages                                                                                                                                                                                                             |

Some features such as [AlignScore](/configure-guardrails/guardrail-catalog/third-party/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](/more-deployment-options/using-docker).

## Troubleshooting Installation Issues

Use the following information to resolve common installation issues.

### C++ Runtime Errors

The library uses [Annoy](https://github.com/spotify/annoy), which requires a C++ compiler. Most systems already have one installed. To check, run the following command:

```bash
g++ --version
```

If the command prints a version number (for example, `g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0`), a C++ compiler is already installed and no action is needed.

If the command is not found, install the compiler:

```bash
apt-get install gcc g++ python3-dev
```

Open a terminal (CMD or PowerShell) and run:

```bat
where cl
```

If the command prints a file path, a C++ compiler is already installed and no action is needed.

If the command is not found, install [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) (version 14.0 or greater).