Guardrails

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.

What is Guardrails?

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.

Overview of Guardrails

What it is

NVIDIA NeMo Guardrails is an open-source toolkit for adding programmable guardrails to LLM-based conversational systems. Guardrails (or "rails") control the output of a large language model, such as avoiding certain topics, following predefined dialog paths, using a specific language style, or extracting structured data.

Key features

  • Building Trustworthy, Safe, and Secure LLM-based Applications: define rails to guide and safeguard conversations, prevent unwanted topics.
  • Connecting models, chains, and other services securely: seamlessly and securely link an LLM to other services (tools).
  • Controllable dialog: steer the LLM to follow pre-defined conversational paths, enforce standard operating procedures.
  • Five types of guardrails: Input rails, Dialog rails, Retrieval rails, Execution rails, and Output rails.
  • Protection against common LLM vulnerabilities such as jailbreaks and prompt injections.
  • Supports multiple LLMs including OpenAI GPT-3.5, GPT-4, LLaMa-2, Falcon, Vicuna, or Mosaic.

Use cases

  1. Question Answering over a set of documents (Retrieval Augmented Generation): enforce fact-checking and output moderation.
  2. Domain-specific Assistants (chatbots): ensure the assistant stays on topic and follows designed conversational flows.
  3. LLM Endpoints: add guardrails to custom LLMs for safer customer interaction.
  4. LangChain Chains (optional): add a guardrails layer around LangChain chains.

Getting started

Install using pip:

pip install nemoguardrails

Example usage with Python API:

from nemoguardrails import LLMRails, RailsConfig

config = RailsConfig.from_path("PATH/TO/CONFIG")
rails = LLMRails(config)

completion = rails.generate(
    messages=[{"role": "user", "content": "Hello world!"}]
)

License and pricing

The license is not stated (NOASSERTION). The project is open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/nvidia-nemoguardrails.svg)](https://yunodb.com/tools/nvidia-nemoguardrails?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/nvidia-nemoguardrails?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/nvidia-nemoguardrails.svg" alt="Featured on YunoDB" height="20"></a>