Instructions to use xCloudinfo/Qwen3.8-27B-Uncensored-xCloud with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xCloudinfo/Qwen3.8-27B-Uncensored-xCloud with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xCloudinfo/Qwen3.8-27B-Uncensored-xCloud") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("xCloudinfo/Qwen3.8-27B-Uncensored-xCloud") model = AutoModelForMultimodalLM.from_pretrained("xCloudinfo/Qwen3.8-27B-Uncensored-xCloud", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xCloudinfo/Qwen3.8-27B-Uncensored-xCloud with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xCloudinfo/Qwen3.8-27B-Uncensored-xCloud
- SGLang
How to use xCloudinfo/Qwen3.8-27B-Uncensored-xCloud 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 "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud" \ --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": "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud", "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 "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud" \ --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": "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use xCloudinfo/Qwen3.8-27B-Uncensored-xCloud with Docker Model Runner:
docker model run hf.co/xCloudinfo/Qwen3.8-27B-Uncensored-xCloud
Qwen3.8-27B-Uncensored-xCloud
以 Qwen/Qwen3.8-27B 為底模,去除拒絕方向(abliteration)後的版本, 由 云碩科技(xCloudinfo) 製作。權重為我方自行從官方底模消除拒絕方向產生,非重新包裝任何第三方成品。
方法
依 Arditi 等人(2024)《Refusal in LLMs is mediated by a single direction》: 在網路中段層,以「觸發拒絕的提示」與「正常提示」的啟動向量差估出拒絕方向, 再把此方向從殘差流的寫入矩陣中正交化消除。不做微調、不需額外資料。
- 編輯對象:attention
o_proj+ MLPdown_proj(共 80 個矩陣),強度0.8。 - 保留不動:多 token 預測(MTP)草稿頭、混合線性注意力(SSM)投影、詞嵌入、視覺塔、
lm_head。 - 底模架構:
qwen3_5—— gated-delta 線性注意力與週期性 full-attention 的混合架構, 多模態(image-text-to-text),並含供推測解碼用的 MTP 頭。
行為
在小型紅隊探針上,拒絕率降到 0/4,同時保留一般能力(算術、多語問答)。
本模型為推理模型,會在最終答案前輸出 <think> 區塊。
使用方式 —— 請以「單一裝置」載入
這是混合(SSM/線性注意力)模型。用 device_map="auto" 拆到多張 GPU 會破壞遞迴狀態、輸出亂碼。
請載入到單一裝置:
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer, BitsAndBytesConfig
name = "xCloudinfo/Qwen3.8-27B-Uncensored-xCloud"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForImageTextToText.from_pretrained(
name,
quantization_config=BitsAndBytesConfig(load_in_4bit=True,
bnb_4bit_compute_dtype=torch.bfloat16),
device_map={"": 0}, # 單一裝置 —— 不要用 "auto"
)
需要 transformers>=5.8,並安裝 flash-linear-attention 與 causal_conv1d 以取得線性注意力的快速核。
負責任使用
移除拒絕方向等於移除一層安全機制。使用者需自行負責這些權重的用途, 並遵守底模的 Apache-2.0 授權與所有適用法律。
- Downloads last month
- 53