OPEA guardrail microservice to provide factuality predictionguard for GenAI application
1.8K
Prediction Guard allows you to utilize hosted open access LLMs, LVMs, and embedding functionality with seamlessly integrated safeguards. In addition to providing a scalable access to open models, Prediction Guard allows you to configure factual consistency checks, toxicity filters, PII filters, and prompt injection blocking. Join the Prediction Guard Discord channel and request an API key to get started.
Checking for factual consistency can help to ensure that any LLM hallucinations are being found before being returned to a user. This microservice allows the user to compare two text passages (reference and text). The output will be a float number from 0.0 to 1.0 (with closer to 1.0 indicating more factual consistency between reference and text).
Setup the following environment variables first
export PREDICTIONGUARD_API_KEY=${your_predictionguard_api_key}
cd ../../../../
docker build -t opea/factuality-predictionguard:latest -f comps/guardrails/src/factuality_alignment/Dockerfile .
docker run -d --name="guardrails-factuality-predictionguard" -p 9075:9075 -e PREDICTIONGUARD_API_KEY=$PREDICTIONGUARD_API_KEY opea/guardrails-factuality-predictionguard:latest
curl -X POST http://localhost:9075/v1/factuality \
-H 'Content-Type: application/json' \
-d '{
"reference": "The sky is blue.",
"text": "The sky is green."
}'
Content type
Image
Digest
sha256:0db9ad29a…
Size
154.4 MB
Last updated
over 1 year ago
docker pull opea/guardrails-factuality-predictionguard