NeMo Guardrails Library CLI Reference#
You should now be able to invoke the nemoguardrails CLI.
> nemoguardrails --help
Usage: nemoguardrails [OPTIONS] COMMAND [ARGS]...
Options:
-v, --version Show version and exit.
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it
or customize the installation.
--help Show this message and exit.
Commands:
chat Start an interactive chat session.
server Start a NeMo Guardrails server.
convert Convert Colang files and configs from older version to
the latest.
actions-server Start a NeMo Guardrails actions server.
find-providers List and select LLM providers interactively.
eval Evaluation a guardrail configuration.
You can also use the --help flag to learn more about each of the nemoguardrails commands.
chat#
nemoguardrails chat --config examples/configs/content_safety [--verbose] [--streaming]
Options#
Option |
Description |
|---|---|
|
Path to a directory containing configuration files. Can also point to a single configuration file. Default: |
|
Enable verbose mode with detailed logging information. |
|
Enable verbose mode but exclude LLM prompts and responses. |
|
Simplify the verbose output. |
|
Enable debug mode with rich flow execution info. Levels: |
|
Enable streaming mode if the configuration supports it. |
|
Connect to a server instead of loading config locally. Requires |
|
The config ID to use when connecting to a server. |
actions-server#
Start a separate server for running custom actions in an isolated environment.
nemoguardrails actions-server --port 8001
Options#
Option |
Description |
|---|---|
|
The port that the server should listen on. Default: |
server#
Start the FastAPI server for serving guardrails configurations over HTTP.
nemoguardrails server --config examples/configs --port 8000
Options#
Option |
Description |
|---|---|
|
The port that the server should listen on. Default: |
|
Path to a directory containing multiple configuration sub-folders. |
|
The default configuration to use when no config is specified in requests. |
|
Enable verbose mode with detailed logs including prompts. |
|
Disable the Chat UI served at the root path. |
|
Enable auto reload when configuration files change. |
|
A prefix to add to all server paths. Must start with |
eval#
Evaluate guardrail configurations with various testing and compliance workflows.
nemoguardrails eval run --config examples/configs/content_safety
Subcommands#
Subcommand |
Description |
|---|---|
|
Run the interactions for an evaluation. |
|
Check the policy compliance of the interactions in the output path. |
|
Launch the Evaluation UI. |
|
Run a rail evaluation task. |
Use nemoguardrails eval <subcommand> --help for details on each subcommand.
convert#
Convert Colang files and configurations from older versions to the latest format.
nemoguardrails convert ./my-config --from-version 1.0 --validate
Arguments#
Argument |
Description |
|---|---|
|
The path to the file or directory to migrate. Required. |
Options#
Option |
Description |
|---|---|
|
The version of the Colang files to migrate from. Options: |
|
Enable verbose mode with detailed logs. |
|
Validate the output using the Colang Parser. |
|
Use the active decorator in the migration. Default: enabled. |
|
Add a main flow to the config. Default: enabled. |
find-providers#
List and select LLM providers interactively. This command helps you discover available providers for text completion and chat completion models.
nemoguardrails find-providers --list
Options#
Option |
Description |
|---|---|
|
List all available providers without interactive selection. |
List Mode#
Run the following command to list all available providers:
nemoguardrails find-providers --list
Interactive Mode#
Run the command without options to start an interactive provider selection:
nemoguardrails find-providers
Select a provider type:
Type to filter between “text completion” and “chat completion”.
Use arrow keys to navigate through matches.
Press Tab to autocomplete.
Press Enter to select.
Select a specific provider:
Type to filter through available providers.
Use arrow keys to navigate through matches.
Press Tab to autocomplete.
Press Enter to select.
Example#
Available Provider Types: (type to filter, use arrows to select)
• text completion
• chat completion
Select provider type: text
Available text completion providers: (type to filter, use arrows to select)
• anthropic
• google_palm
• openai
• ...
Select provider: openai
Selected text completion provider: openai