CoolFace
Apppublic

potato-pzy/LLM_Guard

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

GenAI Shield V2

A web application powered by Llama-Prompt-Guard-2-86M for pre-inference prompt screening, and post-inference response monitoring.

Local Development

  1. 1.Create a virtual environment and install dependencies:
bash
   python -m venv venv
   source venv/bin/activate
   pip install -r requirements.txt
  1. 1.Download the Prompt Guard model weights:
bash
   python download_model.py
  1. 1.Run the application:
bash
   export GEMINI_API_KEY="your-gemini-key"
   python genai_app.py

Deploying to Hugging Face Spaces

  1. 1.Create a new Space on Hugging Face.
  2. 2.Choose Docker as the SDK.
  3. 3.Choose the Blank template.
  4. 4.Go to Settings > Variables and Secrets and add your secrets:
  5. 5.GEMINI_API_KEY: Your Google Gemini API key.
  6. 6.Push this repository to your Hugging Face Space repository. Hugging Face will automatically build and run the Docker image.
potato-pzy/LLM_Guard · CoolFace