Instructions to use ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP") 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("ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP") model = AutoModelForMultimodalLM.from_pretrained("ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP", 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 ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP", "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/ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP
- SGLang
How to use ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP 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 "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP" \ --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": "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP", "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 "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP" \ --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": "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP", "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 ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP with Docker Model Runner:
docker model run hf.co/ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP
Swift-Qwen3.8-27B-Uncensored-MTP
An abliterated Swift-Qwen3.8-27B, UkisAI's reasoning-efficient fine-tune of Qwen3.8-27B. It applies the single-direction refusal ablation of orcarouter/Qwen3.8-27B-Uncensored (Arditi et al. 2024), with orcarouter's own direction, to Swift's weights. The vision tower is untouched and the MTP head is kept and edited consistently, so self-speculative decoding works.
Full BF16 safetensors. Quantized: GGUF (llama.cpp, Unsloth-dynamic Q2 to Q8) and NVFP4 (vLLM, SGLang).
Results
| Model | Refusals | KL divergence |
|---|---|---|
| This model (against Swift) | 15/100 | 0.0634 |
| Swift-Qwen3.8-27B | 98/100 | 0 |
| Reference: orcarouter/Qwen3.8-27B-Uncensored (against Qwen3.8-27B) | 17/100 | 0.0621 |
| Reference: Qwen3.8-27B | 98/100 | 0 |
All four rows are our measurements with Heretic's built-in
evaluation (evaluate_model, BF16):
- Refusals: 100 prompts from
mlabonne/harmful_behaviors, greedy, up to 100 tokens, Heretic's keyword-based refusal detector. - KL divergence: first-token distributions on 100 prompts from
mlabonne/harmless_alpaca, against the original model. - Thinking is closed immediately with a response prefix (
"\n</think>\n\n"), so answers are scored, not reasoning. - Refusal counts depend on the evaluation setup and are not comparable across model cards.
Method
orcarouter's card describes one refusal direction r: the massive-activation-masked mean difference
of harmful (AdvBench) minus harmless (Alpaca) last-token residuals at layer 38, orthogonalized out of
every residual-writing matrix in float32. That edit is fully determined by r, so r was recovered
from the difference between orcarouter's weights and Qwen3.8-27B's, then projected out of Swift's own
matrices.
Edited tensors (131, the same set as orcarouter's), computed in float32 and stored in BF16:
| Component | Tensors | Edit |
|---|---|---|
self_attn.o_proj (16 full-attention layers + MTP) |
17 | W' = W - r (rᵀ W) |
linear_attn.out_proj (48 Gated DeltaNet layers) |
48 | W' = W - r (rᵀ W) |
mlp.down_proj (64 layers + MTP) |
65 | W' = W - r (rᵀ W) |
embed_tokens |
1 | E' = E - (E r) rᵀ |
Everything else is Swift's, including the vision tower, lm_head and the other 13 MTP tensors. All
1199 tensors are present.
Recovering r:
- Each tensor's difference is rank one along one shared direction (per-tensor cosine to
rat least 0.9999), at full strength (fitted scale 0.999). Five hidden dimensions are never edited: the masked massive-activation dimensions, exactly zero inr. - The estimate is the top eigenvector of the summed Gram matrices of the differences, refined by a per-coordinate least-squares fit over elements whose BF16 rounding step is small against the edit.
- Applying the recovered
rto Qwen3.8-27B reproduces orcarouter's 131 tensors with 99.75% of elements bit-identical; the rest differ by BF16 rounding (largest per-tensor error 0.7% of the edit).
Transfer to Swift:
- Swift's fine-tune changed 256 tensors, 80 of them among the 131 edited. The edit projects
rout of Swift's matrices rather than adding orcarouter's difference, so those changes are projected too. - Refusal directions computed the same way for both models (layer 38, 400 harmful and 400 harmless prompts) have a cosine of 0.99995: the fine-tune did not move the direction.
abliteration/ holds r (r.pt), the recovery report (recover.json) and the scripts
(orca_tools.py, orca.sh). abliteration.json lists the edited tensors and the hash of r.
Usage
Architecture, tokenizer and chat template are Swift's and Qwen3.8-27B's.
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
vllm serve ajgazin/Swift-Qwen3.8-27B-Uncensored-MTP \
--dtype bfloat16 \
--max-model-len 262144 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder
Self-speculative decoding with the MTP head (flags from the Swift card):
# vLLM
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
# SGLang
--speculative-algorithm EAGLE --speculative-num-steps 3 \
--speculative-eagle-topk 1 --speculative-num-draft-tokens 4
Sampling, as for Swift and Qwen: temperature 1.0, top_p 0.95, top_k 20, min_p 0.
Not evaluated
General benchmarks, refusal behaviour in thinking mode, whether Swift's shorter reasoning traces survive, and MTP acceptance against Swift.
License
Derivative of Swift-Qwen3.8-27B, under the Swift Open License v1.0 (Swift model card): free for individuals and organizations up to US$1,000,000 annual recurring revenue, above that commercial use needs a Swift Enterprise License from UkisAI. Qwen3.8-27B and orcarouter/Qwen3.8-27B-Uncensored are Apache 2.0.
Intended use
The model answers requests the original declines. You are responsible for how you use it and for complying with applicable law and the license.
Credits
- Qwen for Qwen3.8-27B.
- UkisAI for Swift-Qwen3.8-27B, which includes a component derived from BottleCap AI's ThinkingCap-Qwen3.6-27B.
- OrcaRouter for Qwen3.8-27B-Uncensored and its refusal direction.
- Arditi et al., Refusal in Language Models Is Mediated by a Single Direction (2024).
- Heretic, used for evaluation.
- Downloads last month
- 733