Instructions to use barrydeen/Qwen3.8-27B-AWQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use barrydeen/Qwen3.8-27B-AWQ-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="barrydeen/Qwen3.8-27B-AWQ-4bit") 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("barrydeen/Qwen3.8-27B-AWQ-4bit") model = AutoModelForMultimodalLM.from_pretrained("barrydeen/Qwen3.8-27B-AWQ-4bit", 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 barrydeen/Qwen3.8-27B-AWQ-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "barrydeen/Qwen3.8-27B-AWQ-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barrydeen/Qwen3.8-27B-AWQ-4bit", "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/barrydeen/Qwen3.8-27B-AWQ-4bit
- SGLang
How to use barrydeen/Qwen3.8-27B-AWQ-4bit 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 "barrydeen/Qwen3.8-27B-AWQ-4bit" \ --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": "barrydeen/Qwen3.8-27B-AWQ-4bit", "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 "barrydeen/Qwen3.8-27B-AWQ-4bit" \ --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": "barrydeen/Qwen3.8-27B-AWQ-4bit", "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 barrydeen/Qwen3.8-27B-AWQ-4bit with Docker Model Runner:
docker model run hf.co/barrydeen/Qwen3.8-27B-AWQ-4bit
Qwen3.8-27B-AWQ-4bit
AWQ W4A16 quantization of Qwen/Qwen3.8-27B,
produced with llm-compressor in
compressed-tensors pack-quantized format — the best-optimised Marlin path on Ampere (SM 8.6).
Built for 2× RTX 3090 running vLLM, but nothing here is 3090-specific.
| Size | 27.8 GB (from 55.6 GB BF16) |
| Format | compressed-tensors / pack-quantized |
| Scheme | W4A16 asymmetric, group size 128 |
| Quantized modules | 256 Linear layers |
| Vision tower | preserved, BF16 |
| Gated DeltaNet | preserved, BF16 |
| MTP head | preserved, BF16 |
| Architecture string | Qwen3_5ForConditionalGeneration |
Why this one is bigger than other 4-bit builds
Qwen3.8-27B is a hybrid model. Only 16 of its 64 decoder layers use full attention; the
other 48 use Gated DeltaNet (linear_attn.*). Those DeltaNet projections are extremely
sensitive to quantization, so they are left at full BF16 precision here, along with the vision
tower and the multi-token-prediction head.
That means only 256 Linear modules are quantized — 16 layers × 4 attention projections plus 64 layers × 3 MLP projections — rather than the ~448 you would get by assuming a uniform architecture. Keeping 48 layers of DeltaNet in BF16 costs roughly 7 GB versus builds that quantize everything, and that is the entire difference in file size.
Everything protected here matches the exclusion set of the official FP8 release's
modules_to_not_convert.
Usage
vLLM
vllm serve barrydeen/Qwen3.8-27B-AWQ-4bit \
--trust-remote-code \
--tensor-parallel-size 2 \
--max-model-len 131072 \
--gpu-memory-utilization 0.91 \
--enable-prefix-caching \
--enable-auto-tool-choice \
--tool-call-parser qwen3_xml \
--reasoning-parser qwen3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Two things worth knowing:
- Use tensor parallelism, not pipeline parallelism, if you enable MTP. The MTP draft model
does not implement
SupportsPP, and startup fails withNotImplementedError: Pipeline parallelism is not supported for this model. Without MTP,--pipeline-parallel-size 2is fine. - If your host has no CUDA toolkit, set
VLLM_USE_FLASHINFER_SAMPLER=0. FlashInfer's sampler JIT-compiles kernels and will fail withCould not find nvcc.
Transformers
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained(
"barrydeen/Qwen3.8-27B-AWQ-4bit", device_map="auto", trust_remote_code=True,
)
processor = AutoProcessor.from_pretrained(
"barrydeen/Qwen3.8-27B-AWQ-4bit", trust_remote_code=True,
)
Measured performance
2× RTX 3090, vLLM 0.26.0, TP=2, MTP speculative decoding with 3 draft tokens:
| Metric | Value |
|---|---|
| Generation | 85–95 tok/s |
| MTP acceptance | 67.1% |
| Tokens per forward step | 3.01 |
| KV cache @ 131k context | 178,667 tokens |
Speculative acceptance by draft position: 85% / 69% / 47%.
Quantization details
- Source:
Qwen/Qwen3.8-27BBF16 — not re-quantized from the FP8 release. - Method: AWQ via llm-compressor,
W4A16_ASYM, group size 128. - Calibration: 512 samples from
HuggingFaceH4/ultrachat_200k(train_sft), chat-template formatted,max_seq_length=1024. - Pipeline: sequential, one decoder layer at a time
(
sequential_targets=["Qwen3_5DecoderLayer"]), so each layer is calibrated against the actual quantized output of the layers before it.
Excluded from quantization: linear_attn.* (Gated DeltaNet), the full visual.* tower,
mtp.*, lm_head, embed_tokens, all norms, and the MoE gates.
Limitations and honest notes
- Calibration used 1024-token sequences, not 2048. Quantizing a 27B model alongside the sequential pipeline's activation cache exceeded available memory at 2048. Halving sequence length was chosen over halving sample count, on the reasoning that activation-statistic diversity across 512 distinct conversations matters more for AWQ than per-sample length. It does mean activations from the 1024–2048 token range were not observed during calibration.
- Calibration data is text-only. The vision tower is not quantized, so it is unaffected, but no image data was used.
- No formal benchmark suite has been run. The performance figures above are measured; quality has been verified only by inspection (coherent generation, correct arithmetic, working code output, no degradation under tool-calling). If you benchmark it, please open a discussion — particularly a comparison against builds that quantize the DeltaNet layers, since that is the central claim here and it deserves numbers rather than reasoning.
License
Apache 2.0, inherited from the base model.
- Downloads last month
- 11,874
Model tree for barrydeen/Qwen3.8-27B-AWQ-4bit
Base model
Qwen/Qwen3.8-27B