Instructions to use amarck/Qwen3.8-27B-Heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amarck/Qwen3.8-27B-Heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="amarck/Qwen3.8-27B-Heretic") 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("amarck/Qwen3.8-27B-Heretic") model = AutoModelForMultimodalLM.from_pretrained("amarck/Qwen3.8-27B-Heretic", 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 amarck/Qwen3.8-27B-Heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amarck/Qwen3.8-27B-Heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amarck/Qwen3.8-27B-Heretic", "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/amarck/Qwen3.8-27B-Heretic
- SGLang
How to use amarck/Qwen3.8-27B-Heretic 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 "amarck/Qwen3.8-27B-Heretic" \ --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": "amarck/Qwen3.8-27B-Heretic", "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 "amarck/Qwen3.8-27B-Heretic" \ --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": "amarck/Qwen3.8-27B-Heretic", "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 amarck/Qwen3.8-27B-Heretic with Docker Model Runner:
docker model run hf.co/amarck/Qwen3.8-27B-Heretic
Qwen3.8-27B-Heretic
This is a merged BF16 export of Qwen/Qwen3.8-27B processed with Heretic to reduce refusal behavior.
It was abliterated with standard methods.
Selected optimization result
- Heretic trial: 64
- Completed search trials: 138
- Refusal-keyword matches: 66/100 (lower is better)
- KL divergence from the base model: 0.0088 (lower is better)
- Evaluation prompts: Heretic's default 100-prompt harmful-behaviors and harmless-Alpaca scorer sets
The selected result was the strongest refusal-reduction point on the observed Pareto frontier. These two optimization metrics are not comprehensive capability or safety evaluations.
Validation
The merged artifact was independently loaded from the exported directory with Transformers on an NVIDIA H200 and successfully generated a coherent response. All 12 weight shards were read during that test.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "amarck/Qwen3.8-27B-Heretic"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
messages = [{"role": "user", "content": "Hello!"}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
response = tokenizer.decode(
outputs[0, inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
print(response)
Important
This modification intentionally reduces refusal behavior and may increase the likelihood of unsafe, inaccurate, or otherwise undesirable outputs. Evaluate it for your use case and apply appropriate safeguards. The base model's license and usage terms continue to apply.
- Downloads last month
- 8
Model tree for amarck/Qwen3.8-27B-Heretic
Base model
Qwen/Qwen3.8-27B