Skip to content

Commit 5e0c89b

Browse files
abodhankarPouyanpi
authored andcommitted
Add Nemoguard NIM blueprint (#932)
* NemoGuard NIM integration to NIM Blueprint Signed-off-by: Aditi Bodhankar <[email protected]> * NeMo Guardrails integration into NIM Blueprint Signed-off-by: Aditi Bodhankar <[email protected]> --------- Signed-off-by: Aditi Bodhankar <[email protected]>
1 parent f2147d7 commit 5e0c89b

File tree

2 files changed

+1807
-0
lines changed

2 files changed

+1807
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Safeguarding AI Virtual Assistant NIM Blueprint with NVIDIA NeMo Guardrails and NemoGuard NIMs
2+
3+
**NOTE: this documentation is intended for developers that want to integrate NeMo Guardrails into [NVIDIA Blueprints](https://build.nvidia.com/blueprints)**
4+
5+
NVIDIA Blueprints are comprehensive reference workflows that accelerate AI application development and deployment. They make it easy to start building and setting up virtual assistants, offering ready-made workflows and tools. Whether you need a simple AI-powered chatbot or a fully animated digital human interface, NVIDIA provides resources to help you create an AI assistant that’s scalable and aligned with your brand. For example, developers can use the **[NVIDIA AI Blueprint for AI virtual assistants](https://build.nvidia.com/nvidia/ai-virtual-assistant-for-customer-service)** to build an AI assistant for customer service for delivering a responsive, efficient customer support experience.
6+
7+
8+
## Prerequisites and Setup
9+
10+
### NVIDIA Blueprint
11+
12+
The NVIDIA Blueprint for AI virtual assistants can be deployed either with the NVIDIA-hosted endpoints or with locally hosted NIM microservices. To get started with the deployment:
13+
- **[Using the NVIDIA-hosted endpoint](https://build.nvidia.com/nvidia/ai-virtual-assistant-for-customer-service)**: The launchable opens to a jupyter notebook - `ai-virtual-assitant-notebook.ipynb`. Make sure that the [compute requirements](https://github.com/NVIDIA-AI-Blueprints/ai-virtual-assistant?tab=readme-ov-file#hardware-requirements) are satisfied
14+
15+
### Integrating NemoGuard
16+
17+
First create a `nemoguardrails.yaml` file at `ai-virtual-assistant/deploy/compose` directory to download and initialize NeMo Guardrails toolkit. Make sure it has the following content in it. You can change the port as per your requirement.
18+
19+
```
20+
services:
21+
nemoguardrails:
22+
build:
23+
context: ../../../nemoguardrails # Path to the cloned repository
24+
dockerfile: Dockerfile
25+
container_name: nemoguardrails
26+
runtime: nvidia
27+
deploy:
28+
resources:
29+
reservations:
30+
devices:
31+
- driver: nvidia
32+
count: 1
33+
capabilities: [gpu]
34+
environment:
35+
NGC_API_KEY: ${NGC_API_KEY} # NVIDIA GPU Cloud API Key
36+
ports:
37+
- "8650:8650" # Map container port 8000 to host port 8000
38+
- "8000:8000"
39+
user: "${USER_ID:-1000}:${GROUP_ID:-1000}" # Use the current user's UID/GID
40+
command: >
41+
bash -c "
42+
export OPENAI_API_KEY=${OPENAI_API_KEY} &&
43+
cd nemoguardrails
44+
pip install --no-cache-dir -e .[all]
45+
"
46+
47+
```
48+
49+
Follow the notebook from - `nemoguardrails/examples/notebooks/safeguard_ai_virtual_assistant_notebook.ipynb` to deploy the NemoGuard NIM using downloadable containers and learn to step by step integrate it into the NIM blueprint
50+
51+
### NIM Blueprint API Usage
52+
Use the `ai-virtual-assistant/notebooks/api_usage.ipynb` to run the blueprint api to see the agent response

0 commit comments

Comments
 (0)