Skip to content

Pytector v0.0.12 - Groq Llama Guard is here! 🚀

Latest
Compare
Choose a tag to compare
@MaxMLang MaxMLang released this 30 Oct 10:53

Release Date: October 30, 2024

I'm thrilled to announce the release of Pytector v0.0.12! Adding a new integration of Groq’s Llama Guard Integration, for ultra-fast API inference prompt injection detection


🔥 Highlights of Version 0.0.12

  • Groq’s Llama Guard Integration: This release introduces optional integration with Groq’s Llama Guard 3 8B API, which enables powerful content safety checks with specific hazard categorizations. Detects a wide range of unsafe content categories, from violent crimes to privacy violations, each with a unique hazard code for easy identification.

  • Ease of Use: Pytector’s design focuses on simplicity. An intuitive API with customizable options makes it easy to integrate into any project with just a few lines of code. Configuration requires only one API key for Groq integration, simplifying the setup process.


🚀 Installation

To get started with Pytector Version 0.0.12, you can install it via pip:

pip install pytector==0.0.12

Or, clone the repository and install directly from the source:

git clone https://github.com/MaxMLang/pytector.git
cd pytector
pip install .

📝 Getting Started

Here’s a quick example to get started with Pytector:

import pytector

# Initialize the detector with the DeBERTa model
detector = pytector.PromptInjectionDetector(model_name_or_url="deberta")

# Check if a prompt contains an injection
is_injection, probability = detector.detect_injection("Test your text input here")
print(f"Is injection: {is_injection}, Probability: {probability}")

For more usage instructions and examples, refer to the Getting Started Guide.


⚙️ Key Features

  • Multiple Model Support: Flexibility to choose the model that best fits your needs.
  • Groq Content Safety Check: Optional integration with Groq’s Llama Guard for comprehensive hazard detection, including categories like privacy violations, self-harm, and intellectual property concerns.
  • Customizable Thresholds: Set custom probability thresholds to fine-tune detection sensitivity.

Known Issues

  • Groq API Key Requirement: To use Groq’s Llama Guard feature, an API key is required.
  • Prototype Phase: While this release is production-ready, it’s still in early stages. Future improvements and enhancements are planned based on user feedback.

Feedback and Contributions

Your feedback is invaluable! If you encounter any issues or have suggestions, please submit them via GitHub Issues. Contributions are welcome; see our Contributing Guide for more information.