Text Generation
Transformers
Safetensors
English
llama
Moderation
Safety
Filter
guardrail
prompt-injection
conversational
text-generation-inference
Instructions to use GeneralAnalysis/GA_Guard_1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GeneralAnalysis/GA_Guard_1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GeneralAnalysis/GA_Guard_1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GeneralAnalysis/GA_Guard_1B") model = AutoModelForCausalLM.from_pretrained("GeneralAnalysis/GA_Guard_1B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GeneralAnalysis/GA_Guard_1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GeneralAnalysis/GA_Guard_1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GeneralAnalysis/GA_Guard_1B
- SGLang
How to use GeneralAnalysis/GA_Guard_1B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "GeneralAnalysis/GA_Guard_1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "GeneralAnalysis/GA_Guard_1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GeneralAnalysis/GA_Guard_1B with Docker Model Runner:
docker model run hf.co/GeneralAnalysis/GA_Guard_1B
Rename public model card to GA Guard 1B
Browse files- README.md +2 -2
- chat_template.jinja +1 -1
README.md
CHANGED
|
@@ -31,7 +31,7 @@ tags:
|
|
| 31 |
|
| 32 |
Introducing the GA Guard series: a family of open-weight moderation models built to help developers and organizations keep language models safe, compliant, and aligned with real-world use.
|
| 33 |
|
| 34 |
-
**GA Guard
|
| 35 |
|
| 36 |
**GA Guard** detects violations across the following seven categories:
|
| 37 |
|
|
@@ -146,4 +146,4 @@ Not-violation tokens:
|
|
| 146 |
|
| 147 |
## Intended Use
|
| 148 |
|
| 149 |
-
GA Guard
|
|
|
|
| 31 |
|
| 32 |
Introducing the GA Guard series: a family of open-weight moderation models built to help developers and organizations keep language models safe, compliant, and aligned with real-world use.
|
| 33 |
|
| 34 |
+
**GA Guard 1B** is the Llama 3.2 1B variant of the GA Guard family. It is optimized for low-latency moderation and classifies a piece of text against seven safety policies in a single generation.
|
| 35 |
|
| 36 |
**GA Guard** detects violations across the following seven categories:
|
| 37 |
|
|
|
|
| 146 |
|
| 147 |
## Intended Use
|
| 148 |
|
| 149 |
+
GA Guard 1B is intended for automated moderation, agent input screening, prompt-injection detection, and safety triage. It should be used as one layer in a broader safety system, especially for high-risk domains or decisions that require human review.
|
chat_template.jinja
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{#-
|
| 2 |
-
GA Guard
|
| 3 |
|
| 4 |
Bakes in the guard system prompt that the model was trained on (the seven
|
| 5 |
policies + output-format instructions + "Reasoning effort: LOW" suffix), so
|
|
|
|
| 1 |
{#-
|
| 2 |
+
GA Guard 1B chat template.
|
| 3 |
|
| 4 |
Bakes in the guard system prompt that the model was trained on (the seven
|
| 5 |
policies + output-format instructions + "Reasoning effort: LOW" suffix), so
|