NeMo Guardrails Library Configuration Overview
Before using the NeMo Guardrails library, you need to prepare configuration files that define your guardrails behavior. When you initialize the library’s core classes or the nemoguardrails CLI chat or server, it will load these configuration files as shown in the next chapter About Running Guardrailed Inference. This section provides complete instructions on preparing your configuration files and executable scripts.
A guardrails configuration includes the following components. You can start with a basic configuration and add more components as needed. All the components should be placed in the config folder, and the locations in the following table are relative to the config folder.
Example Configuration Folder Structures
The following are example configuration folder structures.
-
Basic configuration
-
Configuration with Colang rails and custom actions
-
Configuration with custom LLM provider registration
-
Complete configuration with all components
Next Steps
For each component, refer to the following sections for more details:
- Configuring YAML File - A complete guide to writing your
config.ymlfile. - Colang -
.coflow files inrailsfolder. - Custom Actions -
actions.pyoractions/folder for callable actions. - Custom Initialization -
config.pyfor custom initialization. - Knowledge Base -
kb/folder for RAG.
After preparing your configuration files, you can use the NeMo Guardrails SDK to instantiate the core classes (RailsConfig and LLMRails) and run guardrails on your LLM applications.
For detailed SDK usage, including loading configurations, generating responses, streaming, and debugging, refer to About Running Guardrailed Inference.