Integrating with NeMo Guardrails
NeMo Guardrails uses the LangChain ChatNVIDIA connector to connect to a locally running NIM microservice like Llama 3.1 NemoGuard 8B TopicControl NIM.
The topic control microservice exposes the standard OpenAI interface on the v1/completions and v1/chat/completions endpoints.
NeMo Guardrails simplifies the complexity of building the prompt template, parsing the topic control model responses, and provides a programmable method to build a chatbot with content safety rails.
To integrate NeMo Guardrails with the topic control microservice, create a config.yml file that is similar to the following example:
-
Field
enginespecifiesnim. -
Field
parameters.base_urlspecifies the IP address and port of the Llama 3.1 NemoGuard 8B TopicControl NIM host. -
Field
parameters.model_namein the Guardrails configuration must match the model name served by the Llama 3.1 NemoGuard 8B TopicControl NIM. -
The rails definition specifies
topic_controlas the model.
Refer to NVIDIA NeMo Guardrails documentation for more information about the configuration file.