About Guardrails Configuration Store#

In a guardrail configuration, you can configure models and policies (prompts) to apply to user inputs and LLM outputs. You can manage multiple guardrail configurations in the NeMo Guardrails microservice, as the microservice stores configurations in the default PostgreSQL or a database you provide.

After you create guardrail configurations, you can specify the ID of the configuration you want to apply in each guardrail inference request to the NeMo Guardrails microservice inference endpoint.

If you saved a configuration in a namespace other than default, include the namespace in the ID (<namespace>/<guardrail-config-name>). Otherwise, Guardrails assumes that the namespace is default.

Note

The namespace here is the NeMo microservices platform namespace and not associated with Kubernetes namespace.

The database needs to be configured at the time of installing the NeMo Guardrails microservice. You can choose from the following storage backends for the microservice.

  • Bitnami PostgreSQL Database: This is the default option.

  • External PostgreSQL Database: This is a recommended option for production deployments if you have an existing database.

To learn more about setting up a database for the guardrail configuration store, refer to Set Up PostgreSQL for Storing Guardrails Configurations in the NeMo Guardrails microservice Helm installation guide.

You can also configure the microservice to preload guardrail configurations from a directory or a Kubernetes ConfigMap. When the microservice starts, it saves these configurations in the PostgresSQL Database. You can configure your values file to load one or more configurations from one of the following sources.

  • NFS Storage: Set configStore.nfs to load configurations from a file system.

  • In-line Configurations: Set configStore.files to load configurations a YAML object.

To learn more about loading guardrail configurations from a directory or a Kubernetes ConfigMap, refer to Preload Guardrail Configurations From the Values File in the NeMo Guardrails microservice Helm installation guide.