This repository contains the code and examples discussed in the blog post "Building Safer AI Chatbots: A Practical Guide to LLM Guardrails".
This repostiory demonstrates how to implement guardrails for LLM-based chatbots using the NeMo Guardrails framework. The project includes:
- A fictional "LLMotors" chatbot implementation
- Step-by-step guide to adding input and output checks
- Examples of basic and more advanced guardrails
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Run the demo:
python llm_guardrails_demo/ui.py
The different guardrail configurations mentioned in the blog post can be found in the guardrail_configs
directory. To change the guardrail copy and paste the desired configuration into the llm_guardrails_demo/config
directory.
For a comprehensive guide on implementing LLM guardrails, read the full blog post here TODO.