Commands
Thenemoguardrails eval command provides tools for evaluating guardrail configurations.
nemoguardrails eval run
Run interactions for an evaluation.Options
path
default:"config"
Path to a directory containing eval configuration files. Short flag:
-epath
required
Path to a directory containing guardrail configuration files. Short flag:
-gpath
Output directory for the results. Defaults to a folder in the current directory with the same name as the guardrail configuration. Short flag:
-ostring
default:"json"
The format for output files:
json or yaml.integer
default:"1"
The degree of parallelism to use when running the checks.
Examples
Basic Evaluation
With Custom Output
Parallel Execution
YAML Output
Evaluation Config Structure
Create an evaluation config directory:nemoguardrails eval check-compliance
Check policy compliance using an LLM judge.Options
string
required
The name of the model to use as a judge. Must be configured in the evaluation config’s
models key.path
default:"config"
Path to eval configuration files. Short flag:
-earray
One or more output directories from evaluation runs. Defaults to folders in the current directory (except
config). Short flag: -oarray
IDs of policies to check. If not specified, all policies will be checked. Short flag:
-pboolean
default:"false"
Enable verbose output. Short flag:
-vboolean
default:"false"
Force compliance check even if results exist. Short flag:
-fboolean
default:"false"
Disable LLM caching (enabled by default).
boolean
default:"false"
Reset compliance check data.
integer
default:"1"
Degree of parallelism for running checks.
Examples
Basic Compliance Check
Check Specific Policies
Verbose Mode
Force Re-check
Parallel Checking
nemoguardrails eval ui
Launch the evaluation UI to view results.Options
path
default:"config"
Path to eval configuration directory.
array
One or more output directories from evaluation runs.
Examples
Launch UI
http://localhost:8501.
nemoguardrails eval rail
Run specific rail evaluation tasks.Complete Evaluation Workflow
1. Setup Evaluation Config
2. Run Evaluation
3. Check Compliance
4. View Results in UI
Output Format
Results are saved in the output directory:Best Practices
- Start Small: Begin with a small set of test cases and expand
- Use Parallelism: Use
--parallelto speed up large evaluations - Cache LLM Calls: Keep caching enabled to save API costs
- Version Control: Keep eval configs in version control
- Regular Testing: Run evaluations as part of CI/CD
- Review Failures: Use UI to investigate non-compliant cases
Troubleshooting
No Test Cases Found
Ensure yourtest_cases.yml is in the eval config directory and properly formatted.
LLM Judge Errors
Make sure the judge model is configured inconfig.yml: