Purple Llama

Active
GitHub Python NOASSERTION

Description

Meta's set of tools to assess and improve LLM security, including safety benchmarks, prompt injection detection, and output auditing to help evaluate and enhance the safety of large language models.

Key Features

  • Llama Guard models for input/output content moderation and safety filtering
  • Prompt Guard to detect and block prompt injection and jailbreak attacks
  • Code Shield for inference-time filtering of insecure LLM-generated code
  • CyberSec Eval v1/v2/v3 benchmarks for measuring LLM cybersecurity risks
  • Supports 7 new languages and 128K context window via Llama 3.2
  • Permissive MIT licensing for evals, Llama Community License for models

Use Cases

💡 Add safety guardrails to LLM-powered applications against harmful outputs
💡 Evaluate cybersecurity risks of LLMs before production deployment
💡 Filter insecure code suggestions from AI coding assistants
💡 Build purple-team evaluation pipelines for generative AI red/blue teaming

Quick Start

Install via the llama-recipes repository. Use Llama Guard models for content filtering by loading them as Hugging Face models. Run CyberSec Eval benchmarks from the Purple Llama repo. Integrate Code Shield via the provided notebook. All components are available on Hugging Face under the Llama Community License.

Related Projects