PredictionGuard
Prediction Guard is a secure, scalable GenAI platform that safeguards sensitive data, prevents common AI malfunctions, and runs on affordable hardware.
Overview
Integration details
This integration utilizes the Prediction Guard API, which includes various safeguards and security features.
Setup
To access Prediction Guard models, contact us here to get a Prediction Guard API key and get started.
Credentials
Once you have a key, you can set it with
import os
if "PREDICTIONGUARD_API_KEY" not in os.environ:
os.environ["PREDICTIONGUARD_API_KEY"] = "ayTOMTiX6x2ShuoHwczcAP5fVFR1n5Kz5hMyEu7y"
Installation
%pip install -qU langchain-predictionguard
Instantiation
from langchain_predictionguard import PredictionGuard
# If predictionguard_api_key is not passed, default behavior is to use the `PREDICTIONGUARD_API_KEY` environment variable.
llm = PredictionGuard(model="Hermes-3-Llama-3.1-8B")
Invocation
llm.invoke("Tell me a short funny joke.")
' I need a laugh.\nA man walks into a library and asks the librarian, "Do you have any books on paranoia?"\nThe librarian whispers, "They\'re right behind you."'
Process Input
With Prediction Guard, you can guard your model inputs for PII or prompt injections using one of our input checks. See the Prediction Guard docs for more information.