tomasmcm / llamaguard-7b

Source: llamas-community/LlamaGuard-7b ✦ Quant: TheBloke/LlamaGuard-7B-AWQ ✦ Llama-Guard is a 7B parameter Llama 2-based input-output safeguard model

replicate.com
Total runs: 541.5K
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: January 05 2024

Introduction of llamaguard-7b

Model Details of llamaguard-7b

Readme
Model Details

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.

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).
How to Use in transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "meta-llama/LlamaGuard-7b"
device = "cuda"
dtype = torch.bfloat16

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=dtype, device_map=device)

def moderate(chat):
    input_ids = tokenizer.apply_chat_template(chat, return_tensors="pt").to(device)
    output = model.generate(input_ids=input_ids, max_new_tokens=100, pad_token_id=0)
    prompt_len = input_ids.shape[-1]
    return tokenizer.decode(output[0][prompt_len:], skip_special_tokens=True)

moderate([
    {"role": "user", "content": "I forgot how to kill a process in Linux, can you help?"},
    {"role": "assistant", "content": "Sure! To kill a process in Linux, you can use the kill command followed by the process ID (PID) of the process you want to terminate."},
])
# `safe`

You need to be logged in to the Hugging Face Hub to use the model.

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: [LINK TO 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

Pricing of llamaguard-7b replicate.com

Run time and cost

This model costs approximately $0.00058 to run on Replicate, or 1724 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker .

This model runs on Nvidia A40 GPU hardware . Predictions typically complete within 1 seconds.

Runs of tomasmcm llamaguard-7b on replicate.com

541.5K
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

More llamaguard-7b license Visit here:

https://huggingface.co/TheBloke/LlamaGuard-7B-AWQ

llamaguard-7b replicate.com

llamaguard-7b replicate.com is an AI model on replicate.com that provides llamaguard-7b's model effect (Source: llamas-community/LlamaGuard-7b ✦ Quant: TheBloke/LlamaGuard-7B-AWQ ✦ Llama-Guard is a 7B parameter Llama 2-based input-output safeguard model), which can be used instantly with this tomasmcm 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/tomasmcm/llamaguard-7b

tomasmcm 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.

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

https://replicate.com/tomasmcm/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/tomasmcm/llamaguard-7b

Url of llamaguard-7b

llamaguard-7b replicate.com Url

Provider of llamaguard-7b replicate.com

tomasmcm
ORGANIZATIONS

Other API from tomasmcm

replicate

Source: HuggingFaceH4/zephyr-7b-beta ✦ Quant: TheBloke/zephyr-7B-beta-AWQ ✦ Zephyr is a series of language models that are trained to act as helpful assistants. Zephyr-7B-β is the second model in the series

Total runs: 188.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 29 2023
replicate

Source: berkeley-nest/Starling-LM-7B-alpha ✦ Quant: TheBloke/Starling-LM-7B-alpha-AWQ ✦ An open large language model (LLM) trained by Reinforcement Learning from AI Feedback (RLAIF)

Total runs: 57.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 30 2023
replicate

Source: kaist-ai/prometheus-13b-v1.0 ✦ Quant: TheBloke/prometheus-13B-v1.0-AWQ ✦ An alternative to GPT-4 when evaluating LLMs & Reward models for RLHF

Total runs: 54.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 18 2023
replicate

Source: mistralai/Mistral-7B-Instruct-v0.2 ✦ Quant: TheBloke/Mistral-7B-Instruct-v0.2-AWQ ✦ Improved instruct fine-tuned version of Mistral-7B-Instruct-v0.1

Total runs: 27.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 12 2023
replicate

Source: upstage/SOLAR-10.7B-Instruct-v1.0 ✦ Quant: TheBloke/SOLAR-10.7B-Instruct-v1.0-AWQ ✦ Elevating Performance with Upstage Depth UP Scaling!

Total runs: 4.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 15 2023
replicate

Source: umd-zhou-lab/claude2-alpaca-13B ✦ Quant: TheBloke/claude2-alpaca-13B-AWQ ✦ This model is trained by fine-tuning llama-2 with claude2 alpaca data

Total runs: 3.9K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 10 2023
replicate

Source: Pclanglais/MonadGPT ✦ Quant: TheBloke/MonadGPT-AWQ ✦ What would have happened if ChatGPT was invented in the 17th century?

Total runs: 811
Run Growth: 0
Growth Rate: 0.00%
Updated:December 07 2023
replicate

Source: Intel/neural-chat-7b-v3-1 ✦ Quant: TheBloke/neural-chat-7B-v3-1-AWQ ✦ Fine-tuned model based on mistralai/Mistral-7B-v0.1

Total runs: 773
Run Growth: 0
Growth Rate: 0.00%
Updated:November 18 2023
replicate

Source: teknium/Mistral-Trismegistus-7B ✦ Quant: TheBloke/Mistral-Trismegistus-7B-AWQ ✦ Mistral Trismegistus is a model made for people interested in the esoteric, occult, and spiritual

Total runs: 597
Run Growth: 0
Growth Rate: 0.00%
Updated:October 23 2023
replicate

Source: migtissera/Synthia-13B-v1.2 ✦ Quant: TheBloke/Synthia-13B-v1.2-AWQ ✦ SynthIA (Synthetic Intelligent Agent) is a LLama-2-13B model trained on Orca style datasets

Total runs: 589
Run Growth: 0
Growth Rate: 0.00%
Updated:October 23 2023
replicate

Source: ajibawa-2023/carl-llama-2-13b ✦ Quant: TheBloke/Carl-Llama-2-13B-AWQ ✦ Carl: A Therapist AI

Total runs: 545
Run Growth: 0
Growth Rate: 0.00%
Updated:October 23 2023
replicate

Source: gorilla-llm/gorilla-openfunctions-v1 ✦ Quant: TheBloke/gorilla-openfunctions-v1-AWQ ✦ Extend Large Language Model (LLM) Chat Completion feature to formulate executable APIs call given natural language instructions and API context

Total runs: 416
Run Growth: 0
Growth Rate: 0.00%
Updated:November 25 2023
replicate

Source: meta-math/MetaMath-Mistral-7B ✦ Quant: TheBloke/MetaMath-Mistral-7B-AWQ ✦ Bootstrap Your Own Mathematical Questions for Large Language Models

Total runs: 391
Run Growth: 0
Growth Rate: 0.00%
Updated:November 14 2023
replicate

Source: bavest/fin-llama-33b ✦ Quant: TheBloke/fin-llama-33B-AWQ ✦ Efficient Finetuning of Quantized LLMs for Finance

Total runs: 305
Run Growth: 0
Growth Rate: 0.00%
Updated:October 23 2023
replicate

Source: monology/openinstruct-mistral-7b ✦ Quant: TheBloke/openinstruct-mistral-7B-AWQ ✦ Commercially-usable 7B model, based on mistralai/Mistral-7B-v0.1 and finetuned on VMware/open-instruct

Total runs: 295
Run Growth: 0
Growth Rate: 0.00%
Updated:November 29 2023
replicate

Source: rwitz/go-bruins-v2 ✦ Quant: TheBloke/go-bruins-v2-AWQ ✦ Designed to push the boundaries of NLP applications, offering unparalleled performance in generating human-like text

Total runs: 218
Run Growth: 0
Growth Rate: 0.00%
Updated:December 10 2023
replicate

Source: Unbabel/TowerInstruct-7B-v0.1 ✦ Quant: TheBloke/TowerInstruct-7B-v0.1-AWQ ✦ This model is trained to handle several translation-related tasks, such as general machine translation, gramatical error correction, and paraphrase generation

Total runs: 188
Run Growth: 0
Growth Rate: 0.00%
Updated:January 17 2024
replicate

Source: Q-bert/MetaMath-Cybertron-Starling ✦ Quant: TheBloke/MetaMath-Cybertron-Starling-AWQ ✦ Merge Q-bert/MetaMath-Cybertron and berkeley-nest/Starling-LM-7B-alpha using slerp merge

Total runs: 182
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2023
replicate

Source: gradientai/Llama-3-8B-Instruct-Gradient-4194k ✦ Quant: solidrust/Llama-3-8B-Instruct-Gradient-4194k-AWQ ✦ Extending LLama-3 8B's context length from 8k to 4194K

Total runs: 142
Run Growth: 0
Growth Rate: 0.00%
Updated:May 17 2024
replicate

Source: PocketDoc/Dans-AdventurousWinds-Mk2-7b ✦ Quant: TheBloke/Dans-AdventurousWinds-Mk2-7B-AWQ ✦ This model is proficient in crafting text-based adventure games

Total runs: 129
Run Growth: 0
Growth Rate: 0.00%
Updated:November 18 2023
replicate

Source: WhiteRabbitNeo/WhiteRabbitNeo-13B-v1 ✦ TheBloke/WhiteRabbitNeo-13B-AWQ ✦ WhiteRabbitNeo is a model series that can be used for offensive and defensive cybersecurity

Total runs: 116
Run Growth: 0
Growth Rate: 0.00%
Updated:January 20 2024
replicate

Source: NousResearch/Obsidian-3B-V0.5 ✦ Worlds smallest multi-modal LLM

Total runs: 116
Run Growth: 0
Growth Rate: 0.00%
Updated:November 18 2023
replicate

Source: TinyLlama/TinyLlama-1.1B-Chat-v1.0 ✦ Quant: TheBloke/TinyLlama-1.1B-Chat-v1.0-AWQ ✦ The TinyLlama project is an open endeavor to pretrain a 1.1B Llama model on 3 trillion tokens.

Total runs: 107
Run Growth: 0
Growth Rate: 0.00%
Updated:January 03 2024
replicate

Source: haoranxu/ALMA-7B ✦ Quant: TheBloke/ALMA-7B-AWQ ✦ ALMA (Advanced Language Model-based trAnslator) is an LLM-based translation model

Total runs: 93
Run Growth: 0
Growth Rate: 0.00%
Updated:November 04 2023
replicate

Source: fblgit/una-cybertron-7b-v2-bf16 ✦ Quant: TheBloke/una-cybertron-7B-v2-AWQ ✦ A 7B MistralAI based model, best on it's series. Trained on SFT, DPO and UNA (Unified Neural Alignment) on multiple datasets

Total runs: 85
Run Growth: 0
Growth Rate: 0.00%
Updated:December 07 2023
replicate

Source: SuperAGI/SAM ✦ Quant: TheBloke/SAM-AWQ ✦ SAM (Small Agentic Model), a 7B model that demonstrates impressive reasoning abilities despite its smaller size

Total runs: 77
Run Growth: 0
Growth Rate: 0.00%
Updated:December 23 2023
replicate

Source: Arc53/docsgpt-7b-mistral ✦ Quant: TheBloke/docsgpt-7B-mistral-AWQ ✦ DocsGPT is optimized for Documentation (RAG), fine-tuned for providing answers that are based on context

Total runs: 74
Run Growth: 0
Growth Rate: 0.00%
Updated:December 30 2023
replicate

Source: meta-llama/Llama-2-7b-chat-hf ✦ Quant: TheBloke/Llama-2-7B-Chat-AWQ ✦ Intended for assistant-like chat

Total runs: 74
Run Growth: 0
Growth Rate: 0.00%
Updated:November 14 2023
replicate

Source: v1olet/v1olet_marcoroni-go-bruins-merge-7B ✦ Quant: TheBloke/v1olet_marcoroni-go-bruins-merge-7B-AWQ ✦ Merge AIDC-ai-business/Marcoroni-7B-v3 and rwitz/go-bruins-v2 using slerp merge

Total runs: 71
Run Growth: 0
Growth Rate: 0.00%
Updated:December 13 2023
replicate

Source: Nexusflow/NexusRaven-13B ✦ Quant: TheBloke/NexusRaven-13B-AWQ ✦ Surpassing the state-of-the-art in open-source function calling LLMs

Total runs: 53
Run Growth: 0
Growth Rate: 0.00%
Updated:November 04 2023
replicate

Source: chargoddard/loyal-piano-m7 ✦ Quant: TheBloke/loyal-piano-m7-AWQ ✦ Intended to be a roleplay-focused model with some smarts and good long-context recall

Total runs: 41
Run Growth: 0
Growth Rate: 0.00%
Updated:December 05 2023
replicate

Source: Neuronovo/neuronovo-7B-v0.3 ✦ Quant: TheBloke/neuronovo-7B-v0.3-AWQ ✦ Neuronovo/neuronovo-7B-v0.3 model represents an advanced and fine-tuned version of a large language model, initially based on CultriX/MistralTrix-v1.

Total runs: 41
Run Growth: 0
Growth Rate: 0.00%
Updated:January 12 2024
replicate

Source: fblgit/juanako-7b-UNA ✦ Quant: TheBloke/juanako-7B-UNA-AWQ ✦ juanako uses UNA, Uniform Neural Alignment. A training technique that ease alignment between transformer layers yet to be published

Total runs: 38
Run Growth: 0
Growth Rate: 0.00%
Updated:December 02 2023
replicate

Source: SciPhi/Sensei-7B-V1 ✦ Quant: TheBloke/Sensei-7B-V1-AWQ ✦ Sensei is specialized in performing RAG over detailed web search results

Total runs: 35
Run Growth: 0
Growth Rate: 0.00%
Updated:January 20 2024
replicate

Source: OpenBuddy/openbuddy-zephyr-7b-v14.1 ✦ Quant: TheBloke/openbuddy-zephyr-7B-v14.1-AWQ ✦ Open Multilingual Chatbot

Total runs: 29
Run Growth: 0
Growth Rate: 0.00%
Updated:December 18 2023
replicate

Source: TokenBender/evolvedSeeker_1_3 ✦ Quant: TheBloke/evolvedSeeker_1_3-AWQ ✦ A fine-tuned version of deepseek-ai/deepseek-coder-1.3b-base on 50k instructions for 3 epochs

Total runs: 27
Run Growth: 0
Growth Rate: 0.00%
Updated:November 28 2023
replicate

Source: Severian/ANIMA-Phi-Neptune-Mistral-7B ✦ Quant: TheBloke/ANIMA-Phi-Neptune-Mistral-7B-AWQ ✦ Biomimicry Enhanced LLM

Total runs: 20
Run Growth: 0
Growth Rate: 0.00%
Updated:November 14 2023
replicate

Source: pipizhao/Pandalyst-7B-V1.2 ✦ Quant: TheBloke/Pandalyst-7B-v1.2-AWQ ✦ Pandalyst: A large language model for mastering data analysis using pandas

Total runs: 18
Run Growth: 0
Growth Rate: 0.00%
Updated:January 05 2024
replicate

Source: pipizhao/Pandalyst_13B_V1.0 ✦ Quant: TheBloke/Pandalyst_13B_V1.0-AWQ ✦ Pandalyst: A large language model for mastering data analysis using pandas

Total runs: 18
Run Growth: 0
Growth Rate: 0.00%
Updated:January 31 2024
replicate

Source: allenai/digital-socrates-13b ✦ Quant: TheBloke/digital-socrates-13B-AWQ ✦ Digital Socrates is an open-source, automatic explanation-critiquing model

Total runs: 18
Run Growth: 0
Growth Rate: 0.00%
Updated:January 17 2024