Image-Text-to-Text
Transformers
Safetensors
qwen3_5
agentdog
agent-safety
long-horizon
conversational
Instructions to use AI45Research/SafeRSI-27B-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI45Research/SafeRSI-27B-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AI45Research/SafeRSI-27B-V1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("AI45Research/SafeRSI-27B-V1") model = AutoModelForMultimodalLM.from_pretrained("AI45Research/SafeRSI-27B-V1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AI45Research/SafeRSI-27B-V1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI45Research/SafeRSI-27B-V1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI45Research/SafeRSI-27B-V1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/AI45Research/SafeRSI-27B-V1
- SGLang
How to use AI45Research/SafeRSI-27B-V1 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 "AI45Research/SafeRSI-27B-V1" \ --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": "AI45Research/SafeRSI-27B-V1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "AI45Research/SafeRSI-27B-V1" \ --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": "AI45Research/SafeRSI-27B-V1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use AI45Research/SafeRSI-27B-V1 with Docker Model Runner:
docker model run hf.co/AI45Research/SafeRSI-27B-V1
Use official AgentDoG2 Getting Started guide and canonical project page
Browse files
README.md
CHANGED
|
@@ -13,9 +13,9 @@ library_name: transformers
|
|
| 13 |
<p align="center">
|
| 14 |
π <a href="https://github.com/AI45Lab/AgentDoG"><b>GitHub</b></a> |
|
| 15 |
π€ <a href="https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe"><b>Models and Datasets</b></a> |
|
| 16 |
-
π <a href="https://
|
| 17 |
-
π¬ <a href="https://
|
| 18 |
-
π <a href="#
|
| 19 |
</p>
|
| 20 |
|
| 21 |
# AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
|
|
@@ -148,6 +148,8 @@ AgentDoG-Step adapts the StepGen data engine to build groups of unsafe, safely h
|
|
| 148 |
|
| 149 |
## Getting Started
|
| 150 |
|
|
|
|
|
|
|
| 151 |
### Download and load this policy
|
| 152 |
|
| 153 |
Install PyTorch, Accelerate, the HF CLI and a Transformers build that supports `Qwen3_5ForConditionalGeneration`:
|
|
@@ -452,7 +454,7 @@ One **step** is one tool call; one **turn** is one agent response. Means retain
|
|
| 452 |
<img src="./figs/benchmark-overview.png" width="95%" alt="ManipulationArena attack-strategy and channel distributions over 888 cases" />
|
| 453 |
</p>
|
| 454 |
|
| 455 |
-
See the [benchmark section](https://
|
| 456 |
|
| 457 |
## SafeRSI
|
| 458 |
|
|
@@ -496,7 +498,7 @@ All values are percentages. **ASR** is attack success rate (lower is better); **
|
|
| 496 |
- **V2 + Step** yields lower ASR on AgentLAB and AutoControl-Arena than V1 + Step, while V1 + Step has lower ManipulationArena ASR and higher BFCL-v3 accuracy. V2 does not improve every metric.
|
| 497 |
- These are **complete system configurations**. The scores do not isolate the contribution of a downloaded SafeRSI policy checkpoint alone.
|
| 498 |
|
| 499 |
-
See [SafeRSI on the project page](https://
|
| 500 |
|
| 501 |
## β οΈ Intended Use and Limitations
|
| 502 |
|
|
@@ -533,9 +535,9 @@ We thank the trajectory-safety benchmark contributors and the Jev project, whose
|
|
| 533 |
## π Resources
|
| 534 |
|
| 535 |
- [Source code](https://github.com/AI45Lab/AgentDoG)
|
| 536 |
-
- [Official AgentDoG2 README](https://github.com/
|
| 537 |
- [AgentDoG2 collection](https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe)
|
| 538 |
-
- [
|
| 539 |
-
- [Benchmarks](https://
|
| 540 |
-
- [SafeRSI](https://
|
| 541 |
-
- [Featured demos](https://
|
|
|
|
| 13 |
<p align="center">
|
| 14 |
π <a href="https://github.com/AI45Lab/AgentDoG"><b>GitHub</b></a> |
|
| 15 |
π€ <a href="https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe"><b>Models and Datasets</b></a> |
|
| 16 |
+
π <a href="https://ai45lab.github.io/AgentDoG/v2/"><b>Project Page</b></a> |
|
| 17 |
+
π¬ <a href="https://ai45lab.github.io/AgentDoG/v2/#demos"><b>Demos</b></a> |
|
| 18 |
+
π <a href="https://github.com/AI45Lab/AgentDoG/blob/main/examples/getting_started_v2.md#agentdog2-trajectory-auditing-with-transformers"><b>Getting Started</b></a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
# AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
|
|
|
|
| 148 |
|
| 149 |
## Getting Started
|
| 150 |
|
| 151 |
+
Official Getting Started: [AgentDoG2 trajectory auditing with Transformers](https://github.com/AI45Lab/AgentDoG/blob/main/examples/getting_started_v2.md#agentdog2-trajectory-auditing-with-transformers).
|
| 152 |
+
|
| 153 |
### Download and load this policy
|
| 154 |
|
| 155 |
Install PyTorch, Accelerate, the HF CLI and a Transformers build that supports `Qwen3_5ForConditionalGeneration`:
|
|
|
|
| 454 |
<img src="./figs/benchmark-overview.png" width="95%" alt="ManipulationArena attack-strategy and channel distributions over 888 cases" />
|
| 455 |
</p>
|
| 456 |
|
| 457 |
+
See the [benchmark section](https://ai45lab.github.io/AgentDoG/v2/#benchmarks) and [Hugging Face collection](https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe) for the benchmark entry points.
|
| 458 |
|
| 459 |
## SafeRSI
|
| 460 |
|
|
|
|
| 498 |
- **V2 + Step** yields lower ASR on AgentLAB and AutoControl-Arena than V1 + Step, while V1 + Step has lower ManipulationArena ASR and higher BFCL-v3 accuracy. V2 does not improve every metric.
|
| 499 |
- These are **complete system configurations**. The scores do not isolate the contribution of a downloaded SafeRSI policy checkpoint alone.
|
| 500 |
|
| 501 |
+
See [SafeRSI on the project page](https://ai45lab.github.io/AgentDoG/v2/#evolution) for further strategy-level diagnostic results.
|
| 502 |
|
| 503 |
## β οΈ Intended Use and Limitations
|
| 504 |
|
|
|
|
| 535 |
## π Resources
|
| 536 |
|
| 537 |
- [Source code](https://github.com/AI45Lab/AgentDoG)
|
| 538 |
+
- [Official AgentDoG2 README](https://github.com/AI45Lab/AgentDoG)
|
| 539 |
- [AgentDoG2 collection](https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe)
|
| 540 |
+
- [AgentDoG2 project page](https://ai45lab.github.io/AgentDoG/v2/)
|
| 541 |
+
- [Benchmarks](https://ai45lab.github.io/AgentDoG/v2/#benchmarks)
|
| 542 |
+
- [SafeRSI](https://ai45lab.github.io/AgentDoG/v2/#evolution)
|
| 543 |
+
- [Featured demos](https://ai45lab.github.io/AgentDoG/v2/#demos)
|