Text Generation
Transformers
Safetensors
English
qwen3
agent-safety
tool-use
guard-model
step-level-safety
conversational
text-generation-inference
Instructions to use ninty-seven/StepGuard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ninty-seven/StepGuard with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ninty-seven/StepGuard") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ninty-seven/StepGuard") model = AutoModelForCausalLM.from_pretrained("ninty-seven/StepGuard", 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 ninty-seven/StepGuard with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ninty-seven/StepGuard" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ninty-seven/StepGuard", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ninty-seven/StepGuard
- SGLang
How to use ninty-seven/StepGuard 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 "ninty-seven/StepGuard" \ --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": "ninty-seven/StepGuard", "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 "ninty-seven/StepGuard" \ --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": "ninty-seven/StepGuard", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ninty-seven/StepGuard with Docker Model Runner:
docker model run hf.co/ninty-seven/StepGuard
Rename model and update model card to StepGuard
Browse files
README.md
CHANGED
|
@@ -11,9 +11,9 @@ tags:
|
|
| 11 |
- step-level-safety
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
**
|
| 17 |
tool-using LLM agents. It supports both pre-execution evaluation of candidate
|
| 18 |
tool actions and safety auditing of completed agent trajectories.
|
| 19 |
|
|
@@ -22,8 +22,8 @@ with cold-start supervised fine-tuning on data generated by **StepGen**, followe
|
|
| 22 |
by **Balance-GRPO** post-training to reduce the performance gap between safe and
|
| 23 |
unsafe decisions.
|
| 24 |
|
| 25 |
-
- **Project page:** https://zheng977.github.io/
|
| 26 |
-
- **Code:** https://github.com/zheng977/
|
| 27 |
|
| 28 |
## Intended Use
|
| 29 |
|
|
|
|
| 11 |
- step-level-safety
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# StepGuard
|
| 15 |
|
| 16 |
+
**StepGuard** is a 4B guard model for step-level safety judgment in
|
| 17 |
tool-using LLM agents. It supports both pre-execution evaluation of candidate
|
| 18 |
tool actions and safety auditing of completed agent trajectories.
|
| 19 |
|
|
|
|
| 22 |
by **Balance-GRPO** post-training to reduce the performance gap between safe and
|
| 23 |
unsafe decisions.
|
| 24 |
|
| 25 |
+
- **Project page:** https://zheng977.github.io/StepGuard/
|
| 26 |
+
- **Code:** https://github.com/zheng977/StepGuard
|
| 27 |
|
| 28 |
## Intended Use
|
| 29 |
|