Instructions to use AI45Research/ReSI-Qwen3.6-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI45Research/ReSI-Qwen3.6-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AI45Research/ReSI-Qwen3.6-27B") 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/ReSI-Qwen3.6-27B") model = AutoModelForMultimodalLM.from_pretrained("AI45Research/ReSI-Qwen3.6-27B", 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/ReSI-Qwen3.6-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI45Research/ReSI-Qwen3.6-27B" # 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/ReSI-Qwen3.6-27B", "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/ReSI-Qwen3.6-27B
- SGLang
How to use AI45Research/ReSI-Qwen3.6-27B 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/ReSI-Qwen3.6-27B" \ --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/ReSI-Qwen3.6-27B", "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/ReSI-Qwen3.6-27B" \ --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/ReSI-Qwen3.6-27B", "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/ReSI-Qwen3.6-27B with Docker Model Runner:
docker model run hf.co/AI45Research/ReSI-Qwen3.6-27B
ReSI-Qwen3.6-27B
This repository contains the complete Qwen3.6-27B model after ReSI alignment, together with its tokenizer and inference code.
Quick start
Use Python 3.12 with a CUDA-enabled PyTorch installation. After downloading the repository, install the inference dependencies from requirements.txt:
pip install -r requirements.txt
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
model_id = "AI45Research/ReSI-Qwen3.6-27B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
attn_implementation="eager",
).eval()
messages = [{"role": "user", "content": "Explain why the sky is blue in three sentences."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, add_special_tokens=False, return_tensors="pt").to(
model.get_input_embeddings().weight.device
)
with torch.inference_mode():
outputs = model.generate(
**inputs, max_new_tokens=8192,
do_sample=True, temperature=1.0, top_p=0.95, top_k=20,
)
print(tokenizer.decode(outputs[0, inputs.input_ids.shape[-1]:], skip_special_tokens=True))
Alternatively, run the included script for streaming output:
python inference.py --model . --prompt "Explain why the sky is blue in three sentences."
The example and script use temperature 1.0, top-p 0.95, and top-k 20. The script accepts a local model directory or Hugging Face repository ID and supports sampling overrides. The default output limit is 8,192 tokens; increase --max-new-tokens for longer reasoning and answers.
Runtime
The verified loading path uses Transformers 5.15.0, BF16 weights, and eager attention. Model weights occupy approximately 51.0 GiB; allow additional memory for inference. The complete backbone, including its vision components, is retained; the example above demonstrates text inference.
Code and paper
Citation
If you use ReSI in your research, please cite:
@misc{zheng2026resirecursivesafetyimprovement,
title = {ReSI: Recursive Safety Improvement toward
Resistant and Resilient AI},
author = {Jingnan Zheng and Dongcheng Zhang and Yi Zhang and Ming Zhang
and Qiaosheng Zhang and Youbang Sun and An Zhang and Xiangnan He
and Tat-Seng Chua and Xia Hu and Bowen Zhou
and Chaochao Lu and Xiang Wang},
year = {2026},
eprint = {2610.12233},
archivePrefix = {arXiv},
primaryClass = {cs.CR},
url = {https://arxiv.org/abs/2610.12233}
}
- Downloads last month
- 6
Model tree for AI45Research/ReSI-Qwen3.6-27B
Base model
Qwen/Qwen3.6-27B