meta / llamaguard-7b

A 7B parameter Llama 2-based input-output safeguard model

replicate.com
Total runs: 19
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Github
Model's Last Updated: 12月 21 2024

Introduction of llamaguard-7b

Model Details of llamaguard-7b

Readme
Model Details

This repository contains the model weights both in the vanilla Llama format and the Hugging Face transformers format. If you have not received access, please review this discussion

Llama-Guard is a 7B parameter Llama 2 -based input-output safeguard model. It can be used for classifying content in both LLM inputs (prompt classification) and in LLM responses (response classification). It acts as an LLM: it generates text in its output that indicates whether a given prompt or response is safe/unsafe, and if unsafe based on a policy, it also lists the violating subcategories. Here is an example:

In order to produce classifier scores, we look at the probability for the first token, and turn that into an “unsafe” class probability. Model users can then make binary decisions by applying a desired threshold to the probability scores.

Training and Evaluation
Training Data

We use a mix of prompts that come from the Anthropic dataset and redteaming examples that we have collected in house, in a separate process from our production redteaming. In particular, we took the prompts only from the Anthropic dataset, and generated new responses from our in-house LLaMA models, using jailbreaking techniques to elicit violating responses. We then annotated Anthropic data (prompts & responses) in house, mapping labels according to the categories identified above. Overall we have ~13K training examples.

Taxonomy of harms and Risk Guidelines

As automated content risk mitigation relies on classifiers to make decisions about content in real time, a prerequisite to building these systems is to have the following components: - A taxonomy of risks that are of interest – these become the classes of a classifier. - A risk guideline that determines where we put the line between encouraged and discouraged outputs for each risk category in the taxonomy. Together with this model, we release an open taxonomy inspired by existing open taxonomies such as those employed by Google, Microsoft and OpenAI in the hope that it can be useful to the community. This taxonomy does not necessarily reflect Meta’s own internal policies and is meant to demonstrate the value of our method to tune LLMs into classifiers that show high performance and high degrees of adaptability to different policies.

The Llama-Guard Safety Taxonomy & Risk Guidelines

Below, we provide both the harm types themselves under this taxonomy and also examples of the specific kinds of content that would be considered harmful under each category:

  • Violence & Hate encompasses statements that encourage or could help people plan or engage in violence. Similarly, statements that advocate discrimination, contain slurs, or voice hateful sentiments against people based on their sensitive personal characteristics (ex: race, color, religion, national origin, sexual orientation, gender, gender identity, or disability) would also be considered inappropriate under this category.
  • Sexual Content encompasses statements encouraging someone (who could be underage) to engage in specific sex acts. Similarly, sexually explicit (i.e., erotic) statements would also be considered inappropriate under this category.
  • Guns & Illegal Weapons encompasses statements that specifically encourage, condone, or could help people plan or execute specific crimes involving the illegal acquisition, creation, or use of guns or illegal weapons (ex: explosives, biological agents, or chemical weapons), including instructions on how to create or use them.
  • Regulated or Controlled Substances encompasses statements that specifically encourage or could help people to illegally produce, transfer, or consume regulated or controlled substances like illegal drugs, tobacco, alcohol, or cannabis.
  • Suicide & Self Harm encompasses statements that encourage, condone, or enable people to harm themselves (ex: by providing instructions or information on methods of self-harm). When people express or imply an intent to harm themselves, any response other than one that provides links to appropriate health resources would be considered inappropriate (even if entirely supportive).
  • Criminal Planning encompasses miscellaneous statements that encourage, condone, or could help people plan or execute specific criminal activities, like arson, kidnapping, or theft. Items should only be considered harmful under this category when they could not be read as violating any of the other harm types above (ex: statements that encourage violence should be considered violating under Violence & Hate rather than this category).

For more details, see this Colab notebook .

Evaluation results

We compare the performance of the model against standard content moderation APIs in the industry, including OpenAI , Azure Content Safety ,and PerspectiveAPI from Google on both public and in-house benchmarks. The public benchmarks include ToxicChat and OpenAI Moderation .

Note: comparisons are not exactly apples-to-apples due to mismatches in each taxonomy. The interested reader can find a more detailed discussion about this in our paper .

Our Test Set (Prompt) OpenAI Mod ToxicChat Our Test Set (Response)
Llama-Guard 0.945 0.847 0.626 0.953
OpenAI API 0.764 0.856 0.588 0.769
Perspective API 0.728 0.787 0.532 0.699

Runs of meta llamaguard-7b on replicate.com

19
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About llamaguard-7b replicate.com Model

llamaguard-7b replicate.com

llamaguard-7b replicate.com is an AI model on replicate.com that provides llamaguard-7b's model effect (A 7B parameter Llama 2-based input-output safeguard model), which can be used instantly with this meta llamaguard-7b model. replicate.com supports a free trial of the llamaguard-7b model, and also provides paid use of the llamaguard-7b. Support call llamaguard-7b model through api, including Node.js, Python, http.

llamaguard-7b replicate.com Url

https://replicate.com/meta/llamaguard-7b

meta llamaguard-7b online free

llamaguard-7b replicate.com is an online trial and call api platform, which integrates llamaguard-7b's modeling effects, including api services, and provides a free online trial of llamaguard-7b, you can try llamaguard-7b online for free by clicking the link below.

meta llamaguard-7b online free url in replicate.com:

https://replicate.com/meta/llamaguard-7b

llamaguard-7b install

llamaguard-7b is an open source model from GitHub that offers a free installation service, and any user can find llamaguard-7b on GitHub to install. At the same time, replicate.com provides the effect of llamaguard-7b install, users can directly use llamaguard-7b installed effect in replicate.com for debugging and trial. It also supports api for free installation.

llamaguard-7b install url in replicate.com:

https://replicate.com/meta/llamaguard-7b

llamaguard-7b install url in github:

https://github.com/lucataco/cog-LlamaGuard-7b

Url of llamaguard-7b

Provider of llamaguard-7b replicate.com

Other API from meta

replicate

An 8 billion parameter language model from Meta, fine tuned for chat completions

Total runs: 353.0M
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 18 2024
replicate

A 70 billion parameter language model from Meta, fine tuned for chat completions

Total runs: 149.0M
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 18 2024
replicate

Base version of Llama 3, an 8 billion parameter language model from Meta.

Total runs: 50.8M
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 18 2024
replicate

A 7 billion parameter language model from Meta, fine tuned for chat completions

Total runs: 17.5M
Run Growth: 0
Growth Rate: 0.00%
Updated:11月 02 2023
replicate

A 70 billion parameter language model from Meta, fine tuned for chat completions

Total runs: 9.2M
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 13 2023
replicate

Meta's flagship 405 billion parameter language model, fine-tuned for chat completions

Total runs: 5.2M
Run Growth: 0
Growth Rate: 0.00%
Updated:7月 23 2024
replicate

A 13 billion parameter language model from Meta, fine tuned for chat completions

Total runs: 4.8M
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 13 2023
replicate

Generate music from a prompt or melody

Total runs: 2.4M
Run Growth: 0
Growth Rate: 0.00%
Updated:3月 28 2024
replicate

Base version of Llama 3, a 70 billion parameter language model from Meta.

Total runs: 825.5K
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 18 2024
replicate

A llama-3 based moderation and safeguarding language model

Total runs: 733.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:5月 08 2024
replicate

Base version of Llama 2 7B, a 7 billion parameter language model

Total runs: 651.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 13 2023
replicate

Base version of Llama 2, a 70 billion parameter language model from Meta.

Total runs: 351.9K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 13 2023
replicate

Base version of Llama 2 13B, a 13 billion parameter language model

Total runs: 201.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 13 2023
replicate

A 34 billion parameter Llama tuned for coding and conversation

Total runs: 154.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 09 2024
replicate

A 13 billion parameter Llama tuned for code completion

Total runs: 112.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 29 2023
replicate

A 7 billion parameter Llama tuned for coding and conversation

Total runs: 65.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 09 2024
replicate

A 13 billion parameter Llama tuned for coding and conversation

Total runs: 46.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 07 2023
replicate

A Llama-3.1-8B pretrained model, fine-tuned for content safety classification

Total runs: 31.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:12月 21 2024
replicate

Detects any class given class names

Total runs: 27.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 29 2022
replicate

Instance-Conditioned GAN

Total runs: 26.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 25 2021
replicate

A 70 billion parameter Llama tuned for coding and conversation

Total runs: 21.9K
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 31 2024
replicate

A 7 billion parameter Llama tuned for coding and conversation

Total runs: 15.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 07 2023
replicate

SAM 2: Segment Anything v2 (for Images)

Total runs: 11.5K
Run Growth: 0
Growth Rate: 0.00%
Updated:7月 31 2024
replicate

A 17 billion parameter model with 128 experts

Total runs: 11.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 06 2025
replicate

A 34 billion parameter Llama tuned for coding and conversation

Total runs: 10.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:8月 26 2023
replicate

A 34 billion parameter Llama tuned for coding with Python

Total runs: 6.5K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 29 2023
replicate

A 13 billion parameter Llama tuned for coding with Python

Total runs: 3.9K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 07 2023
replicate

A 7 billion parameter Llama tuned for coding with Python

Total runs: 3.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:9月 07 2023
replicate

SAM 2: Segment Anything v2 (for videos)

Total runs: 2.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:8月 14 2024
replicate

Cut and Learn for unsupervised object detection and instance segmentation

Total runs: 2.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:2月 06 2023
replicate

A 70 billion parameter Llama tuned for coding with Python

Total runs: 1.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 30 2024
replicate

Masked-attention Mask Transformer for Universal Image Segmentation

Total runs: 658
Run Growth: 0
Growth Rate: 0.00%
Updated:2月 21 2022
replicate

Supervised Weakly from hashtAGs

Total runs: 294
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 23 2022
replicate

A Single Model for Many Visual Modalities

Total runs: 247
Run Growth: 0
Growth Rate: 0.00%
Updated:1月 30 2022
replicate

A Llama-3.2-11B pretrained model, fine-tuned for content safety classification

Total runs: 153
Run Growth: 0
Growth Rate: 0.00%
Updated:12月 24 2024
replicate

A 17 billion parameter model with 16 experts

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:4月 06 2025