Instructions to use APTO-001/Qwen3.5-27B-SafetyTuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use APTO-001/Qwen3.5-27B-SafetyTuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="APTO-001/Qwen3.5-27B-SafetyTuned") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("APTO-001/Qwen3.5-27B-SafetyTuned") model = AutoModelForCausalLM.from_pretrained("APTO-001/Qwen3.5-27B-SafetyTuned", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use APTO-001/Qwen3.5-27B-SafetyTuned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "APTO-001/Qwen3.5-27B-SafetyTuned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "APTO-001/Qwen3.5-27B-SafetyTuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/APTO-001/Qwen3.5-27B-SafetyTuned
- SGLang
How to use APTO-001/Qwen3.5-27B-SafetyTuned 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 "APTO-001/Qwen3.5-27B-SafetyTuned" \ --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": "APTO-001/Qwen3.5-27B-SafetyTuned", "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 "APTO-001/Qwen3.5-27B-SafetyTuned" \ --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": "APTO-001/Qwen3.5-27B-SafetyTuned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use APTO-001/Qwen3.5-27B-SafetyTuned with Docker Model Runner:
docker model run hf.co/APTO-001/Qwen3.5-27B-SafetyTuned
Qwen3.5-27B-SafetyTuned
Qwen/Qwen3.5-27B ใซๅฏพใใๆ ชๅผไผ็คพAPTOใๆฅๆฌ่ชใซ็นๅใใๅฎๅ จๆงใใฅใผใใณใฐ๏ผSFT๏ผใๆฝใใใขใใซใงใใๅฎๅ จๆงใฎๅไธใจๅฏพ่ฉฑๅ่ณชใฎ็ถญๆใไธก็ซใใฆใใพใใ
A safety-tuned version of Qwen/Qwen3.5-27B by APTO, K.K., with Japanese-focused safety SFT. English version is provided below.
ๆฆ่ฆ
- ใใผในใขใใซ: Qwen/Qwen3.5-27B๏ผApache 2.0๏ผ
- ๅญฆ็ฟๆๆณ: LoRA SFT
- ๅญฆ็ฟใใผใฟ: APTO-001/ja-safety-sft-dataset
- GGUF ้ๅญๅ็: APTO-001/Qwen3.5-27B-SafetyTuned-GGUF
ๆง่ฝๆค่จผ็ตๆ
| ๆๆจ | ใใฅใผใใณใฐๅ | ใใฅใผใใณใฐๅพ | ฮ |
|---|---|---|---|
| AC Acceptable Rate | 84.1% | 89.8% | +5.7pt |
| AC Violation Rate | 15.6% | 10.2% | -5.4pt |
| MT-Bench-ja๏ผๅฏพ่ฉฑๅ่ณช๏ผ | 8.97 | 8.97 | ็ถญๆ |
| MT-Bench EN | 9.21 | 9.35 | +0.14 |
| SORRY-Bench ๆๅฆ็ | 85.3% | 90.4% | +5.1pt |
| JMMLU๏ผ5-shot๏ผ | 67.8% | 75.6% | +7.9pt |
| JCommonsenseQA | 96.6% | 96.2% | ็ถญๆ |
| MGSM-ja๏ผๆฐๅญฆๆจ่ซ๏ผ | 87.6% | 88.0% | ็ถญๆ |
AC Acceptable Rate +5.7pt ใฎๅไธใจ MT-Bench-ja 8.97 ใฎๅฎๅ จ็ถญๆใๅๆใซ้ๆใใฆใใพใใJMMLU ใงใฏ +7.9pt ใฎๆๆใชๅไธใ่ฆณๆธฌใใใSORRY-Bench (ICLR2025ๅ ฌๅผใใณใใใผใฏ) ใงใๆๅฆ็ใ +5.1pt ๆนๅใใฆใใพใใ
ๅญฆ็ฟๆๆณ
ๆ ชๅผไผ็คพAPTOใฎใใผใฟไฝๆใใฆใใฆใซๅบใฅใ็ด18,000ไปถใฎๆฅๆฌ่ชๅฎๅ จๆงๅญฆ็ฟใใผใฟใ็จใใฆใใขใใซใตใคใบใซๆ้ฉๅใใLoRASFTใๅฎๆฝใใพใใใๅญฆ็ฟใใผใฟใฏใๅฎๅ จใชๆๅฆใใ้ๅฐๆๅฆ้ฒๆญขใใ้ไธญๆๅฆใใ่ช ๅฎใชไธ็ฅๅฟ็ญใใฎ4ใซใใดใชใงๆงๆใใใฆใใพใใ่ฉณ็ดฐใฏ APTO-001/ja-safety-sft-dataset ใใ่ฆงใใ ใใใ
ๅถ้ไบ้
ๆฌใขใใซใฏๆฅๆฌ่ชใฎๅฎๅ จๆงๅไธใไธป็ฎ็ใซ่จญ่จใใใฆใใพใใไธ่ฌ็ใชLLMใฎๅถ็ดใจใใฆใใใซใทใใผใทใงใณใๆฅๆฌ่ชไปฅๅคใฎ่จ่ชใงใฎๆๅใๅป็ใปๆณๅใชใฉใฎๅฐ้็ๅฉ่จใจใใฆใฎๅฉ็จใฏ้ฉๅใงใฏใใใพใใใ
ใฉใคใปใณใน
Apache 2.0๏ผใใผในใขใใซใจๅไธ๏ผ
ๅผ็จ
ๆฌใขใใซใฏใๆฅๆฌ่ชLLMๅฎๅ จๆงใฎไปฃ่กจ็ใชใใณใใใผใฏใงใใAnswerCarefullyใงใฎๆง่ฝๅไธใ็ฎ็ใฎไธใคใจใใฆ่จญ่จใใฆใใพใใๅฎๅ จๆง็ ็ฉถใซใใใฃใฆใฏใAnswerCarefullyใฎ่ซๆใปใใผใฟใปใใใใใใใฆใๅ็ งใใ ใใใ
@misc{answercarefully2024,
title = {AnswerCarefully: A Dataset for Improving the Safety of Japanese LLM Output},
author = {llm-jp},
year = {2024},
url = {https://huggingface.co/datasets/llm-jp/AnswerCarefully}
}
ใๅใๅใใ
ๆ ชๅผไผ็คพAPTOใงใฏใLLMใฎๅฎๅ จๆงใใฅใผใใณใฐใใใณๅญฆ็ฟใใผใฟใฎ่จญ่จใปไฝๆใซๅใ็ตใใงใใใพใใใ้ขๅฟใใๆใกใฎๆนใฏใๆฐ่ปฝใซใๅใๅใใใใ ใใใ
- Website: https://apto.co.jp/
Qwen3.5-27B-SafetyTuned (English)
Overview
- Base model: Qwen/Qwen3.5-27B (Apache 2.0)
- Method: LoRA SFT
- Training data: APTO-001/ja-safety-sft-dataset (approximately 18,000 Japanese safety items)
- GGUF quantized version: APTO-001/Qwen3.5-27B-SafetyTuned-GGUF
Evaluation Results
| Metric | Baseline | Tuned | ฮ |
|---|---|---|---|
| AC Acceptable Rate | 84.1% | 89.8% | +5.7pt |
| AC Violation Rate | 15.6% | 10.2% | -5.4pt |
| MT-Bench-ja (dialogue quality) | 8.97 | 8.97 | preserved |
| MT-Bench EN | 9.21 | 9.35 | +0.14 |
| SORRY-Bench refusal rate | 85.3% | 90.4% | +5.1pt |
| JMMLU (5-shot) | 67.8% | 75.6% | +7.9pt |
| JCommonsenseQA | 96.6% | 96.2% | preserved |
| MGSM-ja (math reasoning) | 87.6% | 88.0% | preserved |
AC Acceptable Rate improves by +5.7pt while MT-Bench-ja remains at 8.97. A significant +7.9pt improvement is observed on JMMLU, and refusal rate on SORRY-Bench (ICLR 2025 official benchmark) improves by +5.1pt.
Training Method
LoRA SFT optimized for this model size, using approximately 18,000 Japanese safety items created by APTO. The training data covers four categories โ safety refusal, over-refusal prevention, mid-refusal, and anti-hallucination. See APTO-001/ja-safety-sft-dataset for details.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"APTO-001/Qwen3.5-27B-SafetyTuned",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"APTO-001/Qwen3.5-27B-SafetyTuned", trust_remote_code=True
)
messages = [{"role": "user", "content": "your question here"}]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Limitations
Designed primarily for Japanese-language safety improvement. As with general LLMs, hallucinations may occur, behavior in languages other than Japanese is not specifically tuned, and the model is not intended as professional medical, legal, or financial advice.
License
Apache 2.0 (same as the base model)
Citation
This model is designed with one of its goals being to improve performance on AnswerCarefully, a representative Japanese LLM safety benchmark. For safety-related research, please also refer to the AnswerCarefully paper and dataset.
@misc{answercarefully2024,
title = {AnswerCarefully: A Dataset for Improving the Safety of Japanese LLM Output},
author = {llm-jp},
year = {2024},
url = {https://huggingface.co/datasets/llm-jp/AnswerCarefully}
}
Contact
APTO, K.K. designs and creates training data for LLM safety tuning. Please feel free to contact us for related inquiries.
- Website: https://apto.co.jp/
- Downloads last month
- 16