Instructions to use yuaay/vanguard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yuaay/vanguard with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yuaay/vanguard") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yuaay/vanguard") model = AutoModelForCausalLM.from_pretrained("yuaay/vanguard", device_map="auto") 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 yuaay/vanguard with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yuaay/vanguard" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yuaay/vanguard", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yuaay/vanguard
- SGLang
How to use yuaay/vanguard 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 "yuaay/vanguard" \ --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": "yuaay/vanguard", "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 "yuaay/vanguard" \ --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": "yuaay/vanguard", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yuaay/vanguard with Docker Model Runner:
docker model run hf.co/yuaay/vanguard
VANGUARD
VANGUARD is a general-purpose causal language model based on Qwen3-8B and further trained for agent-safety judgment. It uses the standard text-generation interface rather than a dedicated classifier head.
The safety training follows JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety. In addition to judging an observed trajectory, VANGUARD can anticipate safety-relevant future events from a partial trajectory and use them to identify risks before a harmful action occurs.
Model details
| Base model | Qwen/Qwen3-8B |
| Architecture | General-purpose causal language model |
| Specialized task | Predictive agent-safety judgment |
| Input | User instruction and agent trajectory prefix |
| Output | Safety label with a brief rationale |
| Labels | SAFE, POTENTIAL_UNSAFE, UNSAFE |
Usage
pip install -U transformers accelerate torch
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "YOUR_ORG/VANGUARD"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype="auto",
device_map="auto",
)
messages = [
{
"role": "system",
"content": "<SYSTEM_PROMPT>",
},
{
"role": "user",
"content": "<USER_PROMPT>",
},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
)
generated = output[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
Use the exact prompt template released with the checkpoint when reproducing paper results.
Citation
JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety
@misc{xiong2026janusforeseeinglatentrisk,
title = {JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety},
author = {Yuan Xiong and Linji Hao and Shizhu He and Yequan Wang and Lijun Li},
year = {2026},
eprint = {2607.19913},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2607.19913}
}
- Downloads last month
- 3