You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ NeMo Guardrails is an open-source toolkit for easily adding *programmable guardr
26
26
27
27
Python 3.9, 3.10 or 3.11.
28
28
29
-
NeMo Guardrails uses [annoy](https://github.com/spotify/annoy) which is a C++ library with Python bindings. To install NeMo Guardrails you will need to have the C++ compiler and dev tools installed. Check out the [Installation Guide](https://docs.nvidia.com/nemo/guardrails/getting_started/installation-guide.html#prerequisites) for platform-specific instructions.
29
+
NeMo Guardrails uses [annoy](https://github.com/spotify/annoy) which is a C++ library with Python bindings. To install NeMo Guardrails you will need to have the C++ compiler and dev tools installed. Check out the [Installation Guide](https://docs.nvidia.com/nemo/guardrails/getting-started/installation-guide.html#prerequisites) for platform-specific instructions.
30
30
31
31
## Installation
32
32
@@ -36,7 +36,7 @@ To install using pip:
36
36
> pip install nemoguardrails
37
37
```
38
38
39
-
For more detailed instructions, see the [Installation Guide](https://docs.nvidia.com/nemo/guardrails/getting_started/installation-guide.html).
39
+
For more detailed instructions, see the [Installation Guide](https://docs.nvidia.com/nemo/guardrails/getting-started/installation-guide.html).
40
40
41
41
## Overview
42
42
@@ -74,7 +74,7 @@ You can use programmable guardrails in different types of use cases:
74
74
75
75
### Usage
76
76
77
-
To add programmable guardrails to your application you can use the Python API or a guardrails server (see the [Server Guide](https://docs.nvidia.com/nemo/guardrails/user_guides/server-guide.html) for more details). Using the Python API is similar to using the LLM directly. Calling the guardrails layer instead of the LLM requires only minimal changes to the code base, and it involves two simple steps:
77
+
To add programmable guardrails to your application you can use the Python API or a guardrails server (see the [Server Guide](https://docs.nvidia.com/nemo/guardrails/user-guides/server-guide.html) for more details). Using the Python API is similar to using the LLM directly. Calling the guardrails layer instead of the LLM requires only minimal changes to the code base, and it involves two simple steps:
78
78
79
79
1. Loading a guardrails configuration and creating an `LLMRails` instance.
80
80
2. Making the calls to the LLM using the `generate`/`generate_async` methods.
@@ -105,7 +105,7 @@ NeMo Guardrails is an async-first toolkit, which means that the core mechanics a
105
105
106
106
### Supported LLMs
107
107
108
-
You can use NeMo Guardrails with multiple LLMs like OpenAI GPT-3.5, GPT-4, LLaMa-2, Falcon, Vicuna, or Mosaic. For more details, check out the [Supported LLM Models](https://docs.nvidia.com/nemo/guardrails/user_guides/configuration-guide.html#supported-llm-models) section in the Configuration Guide.
108
+
You can use NeMo Guardrails with multiple LLMs like OpenAI GPT-3.5, GPT-4, LLaMa-2, Falcon, Vicuna, or Mosaic. For more details, check out the [Supported LLM Models](https://docs.nvidia.com/nemo/guardrails/user-guides/configuration-guide.html#supported-llm-models) section in the Configuration Guide.
109
109
110
110
### Types of Guardrails
111
111
@@ -117,7 +117,7 @@ NeMo Guardrails supports five main types of guardrails:
117
117
118
118
1.**Input rails**: applied to the input from the user; an input rail can reject the input, stopping any additional processing, or alter the input (e.g., to mask potentially sensitive data, to rephrase).
119
119
120
-
2.**Dialog rails**: influence how the LLM is prompted; dialog rails operate on canonical form messages for details see [Colang Guide](https://docs.nvidia.com/nemo/guardrails/user_guides/colang-language-syntax-guide.html)) and determine if an action should be executed, if the LLM should be invoked to generate the next step or a response, if a predefined response should be used instead, etc.
120
+
2.**Dialog rails**: influence how the LLM is prompted; dialog rails operate on canonical form messages for details see [Colang Guide](https://docs.nvidia.com/nemo/guardrails/user-guides/colang-language-syntax-guide.html)) and determine if an action should be executed, if the LLM should be invoked to generate the next step or a response, if a predefined response should be used instead, etc.
121
121
122
122
3.**Retrieval rails**: applied to the retrieved chunks in the case of a RAG (Retrieval Augmented Generation) scenario; a retrieval rail can reject a chunk, preventing it from being used to prompt the LLM, or alter the relevant chunks (e.g., to mask potentially sensitive data).
123
123
@@ -141,7 +141,7 @@ The standard structure for a guardrails configuration folder looks like this:
141
141
│ ├── ...
142
142
```
143
143
144
-
The `config.yml` contains all the general configuration options, such as LLM models, active rails, and custom configuration data". The `config.py` file contains any custom initialization code and the `actions.py` contains any custom python actions. For a complete overview, see the [Configuration Guide](https://docs.nvidia.com/nemo/guardrails/user_guides/configuration-guide.html).
144
+
The `config.yml` contains all the general configuration options, such as LLM models, active rails, and custom configuration data". The `config.py` file contains any custom initialization code and the `actions.py` contains any custom python actions. For a complete overview, see the [Configuration Guide](https://docs.nvidia.com/nemo/guardrails/user-guides/configuration-guide.html).
145
145
146
146
Below is an example `config.yml`:
147
147
@@ -212,30 +212,30 @@ To configure and implement various types of guardrails, this toolkit introduces
212
212
213
213
**NOTE**: Currently two versions of Colang, 1.0 and 2.0, are supported and Colang 1.0 is the default. Versions 0.1.0 up to 0.7.1 of NeMo Guardrails used Colang 1.0 exclusively. Versions 0.8.0 introduced Colang 2.0-alpha and version 0.9.0 introduced Colang 2.0-beta. We expect Colang 2.0 to go out of Beta and replace 1.0 as the default option in NeMo Guardrails version 0.11.0.
214
214
215
-
For a brief introduction to the Colang 1.0 syntax, see the [Colang 1.0 Language Syntax Guide](https://docs.nvidia.com/nemo/guardrails/user_guides/colang-language-syntax-guide.html).
215
+
For a brief introduction to the Colang 1.0 syntax, see the [Colang 1.0 Language Syntax Guide](https://docs.nvidia.com/nemo/guardrails/user-guides/colang-language-syntax-guide.html).
216
216
217
217
To get started with Colang 2.0, see the [Colang 2.0 Documentation](https://docs.nvidia.com/nemo/guardrails/colang_2/overview.html).
218
218
219
219
### Guardrails Library
220
220
221
-
NeMo Guardrails comes with a set of [built-in guardrails](https://docs.nvidia.com/nemo/guardrails/user_guides/guardrails-library.html).
221
+
NeMo Guardrails comes with a set of [built-in guardrails](https://docs.nvidia.com/nemo/guardrails/user-guides/guardrails-library.html).
222
222
223
223
> **NOTE**: The built-in guardrails are only intended to enable you to get started quickly with NeMo Guardrails. For production use cases, further development and testing of the rails are needed.
- [RAG hallucination detection using Patronus Lynx](https://docs.nvidia.com/nemo/guardrails/user_guides/guardrails-library.html#patronus-lynx-based-rag-hallucination-detection)
235
-
- [Presidio-based Sensitive Data Detection](https://docs.nvidia.com/nemo/guardrails/user_guides/guardrails-library.html#presidio-based-sensitive-data-detection)
236
-
- [Input moderation using ActiveFence](https://docs.nvidia.com/nemo/guardrails/user_guides/guardrails-library.html#activefence)
237
-
- [RAG Hallucination detection using Got It AI's TruthChecker API](https://docs.nvidia.com/nemo/guardrails/user_guides/guardrails-library.html#got-it-ai)
- [RAG hallucination detection using Patronus Lynx](https://docs.nvidia.com/nemo/guardrails/user-guides/guardrails-library.html#patronus-lynx-based-rag-hallucination-detection)
235
+
- [Presidio-based Sensitive Data Detection](https://docs.nvidia.com/nemo/guardrails/user-guides/guardrails-library.html#presidio-based-sensitive-data-detection)
236
+
- [Input moderation using ActiveFence](https://docs.nvidia.com/nemo/guardrails/user-guides/guardrails-library.html#activefence)
237
+
- [RAG Hallucination detection using Got It AI's TruthChecker API](https://docs.nvidia.com/nemo/guardrails/user-guides/guardrails-library.html#got-it-ai)
To start a guardrails server, you can also use a Docker container. NeMo Guardrails provides a [Dockerfile](./Dockerfile) that you can use to build a `nemoguardrails` image. For further information, see the [using Docker](https://docs.nvidia.com/nemo/guardrails/user_guides/advanced/using-docker.html) section.
287
+
To start a guardrails server, you can also use a Docker container. NeMo Guardrails provides a [Dockerfile](./Dockerfile) that you can use to build a `nemoguardrails` image. For further information, see the [using Docker](https://docs.nvidia.com/nemo/guardrails/user-guides/advanced/using-docker.html) section.
288
288
289
289
## Integration with LangChain
290
290
291
-
NeMo Guardrails integrates seamlessly with LangChain. You can easily wrap a guardrails configuration around a LangChain chain (or any `Runnable`). You can also call a LangChain chain from within a guardrails configuration. For more details, check out the [LangChain Integration Documentation](https://docs.nvidia.com/nemo/guardrails/user_guides/langchain/langchain-integration.html)
291
+
NeMo Guardrails integrates seamlessly with LangChain. You can easily wrap a guardrails configuration around a LangChain chain (or any `Runnable`). You can also call a LangChain chain from within a guardrails configuration. For more details, check out the [LangChain Integration Documentation](https://docs.nvidia.com/nemo/guardrails/user-guides/langchain/langchain-integration.html)
292
292
293
293
## Evaluation
294
294
@@ -309,7 +309,7 @@ To the best of our knowledge, NeMo Guardrails is the only guardrails toolkit tha
Copy file name to clipboardExpand all lines: docs/README.md
+25-25
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ The documentation is divided into the following sections:
13
13
14
14
This section will help you get started quickly with NeMo Guardrails.
15
15
16
-
*[Installation guide](getting_started/installation-guide.md): This guide walks you through the process of setting up your environment and installing NeMo Guardrails
17
-
*[Getting Started guides](./getting_started): A series of guides that will help you understand the core concepts and build your first guardrails configurations. These guides include Jupyter notebooks that you can experiment with.
16
+
*[Installation guide](getting-started/installation-guide.md): This guide walks you through the process of setting up your environment and installing NeMo Guardrails
17
+
*[Getting Started guides](./getting-started): A series of guides that will help you understand the core concepts and build your first guardrails configurations. These guides include Jupyter notebooks that you can experiment with.
18
18
19
19
## Examples
20
20
@@ -35,16 +35,16 @@ These examples are meant to showcase the process of building rails, not as out-o
35
35
36
36
The user guides cover the core details of the NeMo Guardrails toolkit and how to configure and use different features to make your own rails.
37
37
38
-
*[Guardrails Configuration Guide](user_guides/configuration-guide.md): The complete guide to all the configuration options available in the `config.yml` file.
39
-
*[Guardrails Library](user_guides/guardrails-library.md): An overview of the starter built-in rails that NeMo Guardrails provide.
40
-
*[Guardrails Process](user_guides/guardrails-process.md): A detailed description of the guardrails process, i.e., the categories of rails and how they are called.
41
-
*[Colang Language Guide](user_guides/colang-language-syntax-guide.md): Learn the syntax and core concepts of Colang.
42
-
*[LLM Support for Guardrails](user_guides/llm-support.md): An easy to grasp summary of the current LLM support.
43
-
*[Python API](user_guides/python-api.md): Learn about the Python API, e.g., the `RailsConfig` and `LLMRails` classes.
44
-
*[CLI](user_guides/cli.md): Learn about the NeMo Guardrails CLI that can help you use the Chat CLI or start a server.
45
-
*[Server Guide](user_guides/server-guide.md): Learn how to use the NeMo Guardrails server.
46
-
*[Integration with LangChain](user_guides/langchain/langchain-integration.md): Integrate guardrails in your existing LangChain-powered app.
47
-
*[Detailed Logging](user_guides/detailed_logging/README.md): Learn how to get detailed logging information.
38
+
*[Guardrails Configuration Guide](user-guides/configuration-guide.md): The complete guide to all the configuration options available in the `config.yml` file.
39
+
*[Guardrails Library](user-guides/guardrails-library.md): An overview of the starter built-in rails that NeMo Guardrails provide.
40
+
*[Guardrails Process](user-guides/guardrails-process.md): A detailed description of the guardrails process, i.e., the categories of rails and how they are called.
41
+
*[Colang Language Guide](user-guides/colang-language-syntax-guide.md): Learn the syntax and core concepts of Colang.
42
+
*[LLM Support for Guardrails](user-guides/llm-support.md): An easy to grasp summary of the current LLM support.
43
+
*[Python API](user-guides/python-api.md): Learn about the Python API, e.g., the `RailsConfig` and `LLMRails` classes.
44
+
*[CLI](user-guides/cli.md): Learn about the NeMo Guardrails CLI that can help you use the Chat CLI or start a server.
45
+
*[Server Guide](user-guides/server-guide.md): Learn how to use the NeMo Guardrails server.
46
+
*[Integration with LangChain](user-guides/langchain/langchain-integration.md): Integrate guardrails in your existing LangChain-powered app.
47
+
*[Detailed Logging](user-guides/detailed-logging/README.md): Learn how to get detailed logging information.
48
48
49
49
## Security
50
50
@@ -65,19 +65,19 @@ There are also detailed guides on how to reproduce results and create datasets f
65
65
66
66
The following guides explain in more details various specific topics:
67
67
68
-
*[Generation Options](user_guides/advanced/generation-options.md): Learn how to have to use advanced generation options.
69
-
*[Prompt Customization](user_guides/advanced/prompt-customization.md): Learn how to customize the prompts for a new (or existing) type of LLM.
70
-
*[Embedding Search Providers](user_guides/advanced/embedding-search-providers.md): Learn about the core embedding search interface that NeMo guardrails uses for some of the core features.
71
-
*[Using Docker](user_guides/advanced/using-docker.md): Learn how to deploy NeMo Guardrails using Docker.
72
-
*[Streaming](user_guides/advanced/streaming.md): Learn about the streaming support in NeMo Guardrails.
73
-
*[AlignScore deployment](user_guides/advanced/align-score-deployment.md): Learn how to deploy an AlignScore server either directly or using Docker.
74
-
*[Extract User-provided Values](user_guides/advanced/extract-user-provided-values.md): Learn how to extract user-provided values like a name, a date or a query.
75
-
*[Bot Message Instructions](user_guides/advanced/bot-message-instructions.md): Learn how to further tweak the bot messages with specific instructions at runtime.
76
-
*[Event-based API](user_guides/advanced/event-based-api.md): Learn about the generic event-based interface that you can use to process additional information in your guardrails configuration.
77
-
*[Jailbreak Detection Heuristics Deployment](user_guides/advanced/jailbreak-detection-heuristics-deployment.md): Learn how to deploy the jailbreak detection heuristics server.
78
-
*[Llama Guard Deployment](user_guides/advanced/llama-guard-deployment.md): Learn how to deploy Llama Guard using vLLM.
79
-
*[Nested AsyncIO Loop](user_guides/advanced/nested-async-loop.md): Understand some of the low level issues regarding `asyncio` and how they are handled in NeMo Guardrails.
80
-
*[Vertex AI Setup](user_guides/advanced/vertexai-setup.md): Learn how to setup a Vertex AI account.
68
+
*[Generation Options](user-guides/advanced/generation-options.md): Learn how to have to use advanced generation options.
69
+
*[Prompt Customization](user-guides/advanced/prompt-customization.md): Learn how to customize the prompts for a new (or existing) type of LLM.
70
+
*[Embedding Search Providers](user-guides/advanced/embedding-search-providers.md): Learn about the core embedding search interface that NeMo guardrails uses for some of the core features.
71
+
*[Using Docker](user-guides/advanced/using-docker.md): Learn how to deploy NeMo Guardrails using Docker.
72
+
*[Streaming](user-guides/advanced/streaming.md): Learn about the streaming support in NeMo Guardrails.
73
+
*[AlignScore deployment](user-guides/advanced/align-score-deployment.md): Learn how to deploy an AlignScore server either directly or using Docker.
74
+
*[Extract User-provided Values](user-guides/advanced/extract-user-provided-values.md): Learn how to extract user-provided values like a name, a date or a query.
75
+
*[Bot Message Instructions](user-guides/advanced/bot-message-instructions.md): Learn how to further tweak the bot messages with specific instructions at runtime.
76
+
*[Event-based API](user-guides/advanced/event-based-api.md): Learn about the generic event-based interface that you can use to process additional information in your guardrails configuration.
77
+
*[Jailbreak Detection Heuristics Deployment](user-guides/advanced/jailbreak-detection-heuristics-deployment.md): Learn how to deploy the jailbreak detection heuristics server.
78
+
*[Llama Guard Deployment](user-guides/advanced/llama-guard-deployment.md): Learn how to deploy Llama Guard using vLLM.
79
+
*[Nested AsyncIO Loop](user-guides/advanced/nested-async-loop.md): Understand some of the low level issues regarding `asyncio` and how they are handled in NeMo Guardrails.
80
+
*[Vertex AI Setup](user-guides/advanced/vertexai-setup.md): Learn how to setup a Vertex AI account.
0 commit comments