Instructions to use axteam/Qwen3.5-4B-AWQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axteam/Qwen3.5-4B-AWQ-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="axteam/Qwen3.5-4B-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("axteam/Qwen3.5-4B-AWQ-4bit") model = AutoModelForMultimodalLM.from_pretrained("axteam/Qwen3.5-4B-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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use axteam/Qwen3.5-4B-AWQ-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axteam/Qwen3.5-4B-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": "axteam/Qwen3.5-4B-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/axteam/Qwen3.5-4B-AWQ-4bit
- SGLang
How to use axteam/Qwen3.5-4B-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 "axteam/Qwen3.5-4B-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": "axteam/Qwen3.5-4B-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 "axteam/Qwen3.5-4B-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": "axteam/Qwen3.5-4B-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 axteam/Qwen3.5-4B-AWQ-4bit with Docker Model Runner:
docker model run hf.co/axteam/Qwen3.5-4B-AWQ-4bit
Qwen3.5-4B ยท AWQ INT4 (W4A16)
4-bit quantization of Qwen/Qwen3.5-4B, produced for efficient vLLM serving. Quantized by axteam.
Revision 2026-11-01: un-smoothed RMSNorm weights restored bit-exactly from the original. llm-compressor's offset-norm handling had left BF16 rounding noise (at most 0.4% in the effective gain) in the norms that AWQ does not smooth. Quantized weights and the AWQ-smoothed norms are unchanged. The measurements on this card were taken before this change.
| Base model | Qwen/Qwen3.5-4B |
| Method | AWQ INT4 (W4A16) |
| Format | compressed-tensors pack-quantized |
| Weights / activations | W4A16 โ INT4 asymmetric weights, group size 32 (BF16 scale + INT4 zero-point), BF16 activations |
| Architecture | Hybrid (linear-attention + full-attention) ยท Dense ยท multimodal (vision) ยท MTP head |
| Size on disk | ~4.2 GB |
| Calibration | 256 samples (Korean-heavy mixed corpus) |
| License | Apache-2.0 |
Quantization details
- Scheme โ W4A16 โ INT4 asymmetric weights, group size 32 (BF16 scale + INT4 zero-point), BF16 activations, stored as compressed-tensors
pack-quantized. - Kept in BF16 โ the vision tower & projector (
model.visual.*), the multi-token-prediction head (mtp.*), all RMSNorms, token embeddings, the LM head, the SSM non-linear parts (linear_attn.conv1d/A_log/dt_bias). Left unquantized to preserve quality (about 21% of all parameters in this build). - Tokenizer /
chat_template/generation_configare identical to the original.config.jsonis the original plus aquantization_configblock.
This is post-training quantization (PTQ) โ no retraining. AWQ uses a small calibration set (no gradient) to protect salient weight channels before rounding.
Benchmarks (measured)
Every column was measured with the same harness and settings โ lm-evaluation-harness on vLLM, greedy, few-shot completion (no chat template). Percentages are recovery vs. the BF16 original.
| Benchmark | BF16 (original) | FP8-dynamic | AWQ-8bit | NVFP4A16 | NVFP4 | AWQ-4bit (this repo) |
|---|---|---|---|---|---|---|
| MMLU (5-shot) | 55.18 | 57.99 (105.1%) | 54.79 (99.3%) | 60.58 (109.8%) | 58.61 (106.2%) | 60.89 (110.3%) |
| GSM8K (5-shot, strict) | 74.07 | 73.92 (99.8%) | 73.84 (99.7%) | 76.72 (103.6%) | 73.31 (99.0%) | 76.42 (103.2%) |
| ARC-Challenge (0-shot) | 54.61 | 53.92 (98.8%) | 54.52 (99.8%) | 54.86 (100.5%) | 53.92 (98.8%) | 54.35 (99.5%) |
| Winogrande (5-shot) | 68.75 | 67.96 (98.9%) | 69.14 (100.6%) | 68.90 (100.2%) | 69.38 (100.9%) | 68.90 (100.2%) |
| KMMLU (5-shot, direct) | 50.47 | 50.13 (99.3%) | 50.48 (100.0%) | 51.49 (102.0%) | 50.26 (99.6%) | 49.02 (97.1%) |
| HAE-RAE (0-shot) | 62.42 | 61.50 (98.5%) | 62.05 (99.4%) | 61.69 (98.8%) | 59.76 (95.7%) | 58.48 (93.7%) |
| Average | 60.92 | 60.90 (100.0%) | 60.81 (99.8%) | 62.37 (102.4%) | 60.87 (99.9%) | 61.34 (100.7%) |
Evaluation (measured)
Fidelity to the BF16 original on an internal mixed English/Korean set (100 prompts, BF16 greedy answers scored under each build โ same harness for every row).
| Metric | This model | BF16 original |
|---|---|---|
| Perplexity (lower = closer) | 1.6672 | 1.5703 (+6.2%) |
| Top-1 next-token agreement | 89.0% | 99.2% |
These measure fidelity to the base model, not absolute task scores.
Requirements
| Runtime | vLLM โ the architecture is in vLLM โฅ 0.17.0; tested here with vLLM 0.32.0. |
| vLLM install | vLLM 0.32 itself needs Python 3.11โ3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers โฅ5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 โ do not upgrade it separately). |
| GPU | NVIDIA Turing (sm75) or newer โ weight-only INT, no special tensor cores needed. V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.) |
| Memory | Weights: 4.2 GB. Add KV cache (grows with context length ร concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU. |
| Transformers (without vLLM) | transformers>=5.2.0 + compressed-tensors>=0.15.0 (checked on CPU with Qwen3.5-0.8B FP8 / AWQ-4bit / NVFP4A16 / NVFP4). |
| trust_remote_code | not needed |
Usage (vLLM)
Start an OpenAI-compatible server:
vllm serve axteam/Qwen3.5-4B-AWQ-4bit --max-model-len 32768
Query it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "axteam/Qwen3.5-4B-AWQ-4bit",
"messages": [{"role": "user", "content": "๋ํ๋ฏผ๊ตญ์ ์๋๋ ์ด๋์ธ๊ฐ์?"}],
"max_tokens": 512
}'
Offline inference in Python:
from vllm import LLM, SamplingParams
llm = LLM(model="axteam/Qwen3.5-4B-AWQ-4bit", max_model_len=32768)
params = SamplingParams(max_tokens=1024)
out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)
print(out[0].outputs[0].text)
# image input (URL or data: URI)
messages = [{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://example.com/your-image.png"}},
{"type": "text", "text": "Describe this image."},
]}]
out = llm.chat(messages, params)
print(out[0].outputs[0].text)
Thinking mode is on by default in the chat template; to turn it off pass
chat_template_kwargs={"enable_thinking": False}(Pythonllm.chat(..., chat_template_kwargs=...), or"chat_template_kwargs": {"enable_thinking": false}in the request body). Text-only serving: add--limit-mm-per-prompt '{"image": 0, "video": 0}'to skip loading the vision encoder's memory budget.
Reducing KV-cache memory (optional, serve-time)
The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the weight quantization above; for long contexts or large batches FP8 roughly halves KV-cache memory:
vllm serve axteam/Qwen3.5-4B-AWQ-4bit --kv-cache-dtype fp8
License
Quantized derivative of Qwen/Qwen3.5-4B (Apache-2.0). All original weights, tokenizer and chat template belong to the Qwen team.
ํ๊ตญ์ด ์์ฝ
Qwen/Qwen3.5-4B์ AWQ INT4 (W4A16) ์์ํ ๋น๋ ยท ์ ์ axteam
๊ฐ์
| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| ์๋ณธ ๋ชจ๋ธ | Qwen/Qwen3.5-4B |
| ์์ํ ๋ฐฉ์ | AWQ INT4 (W4A16) |
| ์ ์ฅ ํ์ | compressed-tensors pack-quantized |
| ๋ชจ๋ธ ๊ตฌ์กฐ | ํ์ด๋ธ๋ฆฌ๋ ์ดํ ์ (์ ํ ์ดํ ์ + ํ ์ดํ ์ ) ยท Dense ยท ๋ฉํฐ๋ชจ๋ฌ(๋น์ ) ยท MTP ํค๋ |
| ์ฉ๋ | ์ฝ 4.2 GB |
| ๋ณด์ ๋ฐ์ดํฐ | ์ํ 256๊ฐ (ํ๊ตญ์ด ์์ฃผ ํผํฉ ์ฝํผ์ค) |
์์ํ ์์ธ
- ๊ฐ์ค์น: INT4 ๋น๋์นญ, ๊ทธ๋ฃน ํฌ๊ธฐ 32 (BF16 ์ค์ผ์ผ + INT4 ์์ )
- ํ์ฑํ: BF16 (์์ํํ์ง ์์)
- ์์ํ ์ ์ฐจ: PTQ(ํ์ต ํ ์์ํ, ์ฌํ์ต ์์), AWQ ๋ฐฉ์ โ ๋ณด์ ๋ฐ์ดํฐ๋ก ํ์ฑํ๊ฐ ํฐ ๊ฐ์ค์น ์ฑ๋์ ์ฐพ์ ์ฑ๋๋ณ ์ค์ผ์ผ๋ก ๋ณดํธํ ๋ค INT4๋ก ๋ฐ์ฌ๋ฆผ
- BF16 ์ ์ง: ๋น์ ํ์ยทํฌ์์ธต(
model.visual.*), MTP ํค๋(mtp.*), ๋ชจ๋ RMSNorm, ํ ํฐ ์๋ฒ ๋ฉ, LM ํค๋, SSM์ ์ ํ์ธต ์ธ ํ๋ผ๋ฏธํฐ(linear_attn.conv1dยทA_logยทdt_bias) โ ์ ์ฒด ํ๋ผ๋ฏธํฐ์ ์ฝ 21% - ์๋ณธ ํ์ผ: ํ ํฌ๋์ด์ ยทchat templateยทgeneration config๋ ์๋ณธ๊ณผ ๋์ผ,
config.json์ ์๋ณธ์quantization_config๋ธ๋ก๋ง ์ถ๊ฐ
ํ์ง (์ค์ธก)
- ์๋ณธ ๋๋น ์ถฉ์ค๋: PPL 1.6672 (์๋ณธ 1.5703, +6.2%, ๋ฎ์์๋ก ์๋ณธ์ ๊ฐ๊น์), ๋ค์ ํ ํฐ top-1 ์ผ์น์จ 89.0% (์๋ณธ ์์ฒด ๊ธฐ์ค๊ฐ 99.2%) โ ๋ด๋ถ ์์ดยทํ๊ตญ์ด ํผํฉ ํ๋กฌํํธ 100๊ฐ, ์๋ณธ(BF16)์ greedy ๋ต๋ณ์ ๊ธฐ์ค ํ ์คํธ๋ก ์ธก์
- ๋ฒค์น๋งํฌ ํ๊ท : 61.34 (์๋ณธ 60.92, 100.7%) โ MMLUยทGSM8KยทARC-ChallengeยทWinograndeยทKMMLUยทHAE-RAE 6์ข ํ๊ท , lm-evaluation-harness + vLLM, chat template ์๋ few-shotยทgreedy, ๋ชจ๋ ๋น๋๋ฅผ ๊ฐ์ ์ค์ ์ผ๋ก ์ธก์
- ํ๊ตญ์ด ๋ฒค์น๋งํฌ: KMMLU 49.02 (์๋ณธ 50.47, 97.1%) ยท HAE-RAE 58.48 (์๋ณธ 62.42, 93.7%)
์๊ตฌ์ฌํญ
- ์คํ ์์ง: vLLM 0.17.0 ์ด์(์ด ๊ตฌ์กฐ๋ฅผ ์ง์ํ๋ ์ฒซ ๋ฒ์ ), ์ด ๋น๋๋ vLLM 0.32.0์์ ์คํ ํ์ธ
- vLLM 0.32 ์ค์น ์กฐ๊ฑด: Python 3.11~3.14, torch 2.13(CUDA 13.0 ๋น๋, CUDA 13 ์ง์ ๋๋ผ์ด๋ฒ ํ์), transformers 5.16.1 ์ด์ 5.20 ๋ฏธ๋ง, compressed-tensors 0.17.0 โ transformersยทcompressed-tensors๋ vLLM์ด ๋ฒ์ ์ ๊ณ ์ ํ๋ฏ๋ก compressed-tensors๋ฅผ ๋ฐ๋ก ์ ๊ทธ๋ ์ด๋ํ์ง ๋ง ๊ฒ (์ด ์ฒดํฌํฌ์ธํธ๋ 0.19.0์ผ๋ก ์ ์ฅ๋์ง๋ง 0.17.0์์๋ ๋ก๋๋จ)
- GPU: NVIDIA Turing(sm75) ์ด์, V100(sm70) ๋ฏธ์ง์ โ ๊ฐ์ค์น ์ ์ฉ ์ ์ ํ์์ด๋ผ FP8ยทFP4 ์ ์ฉ ํ ์์ฝ์ด ๋ถํ์ (GPU๋ณ ์ง์ ์ฌ๋ถ๋ vLLM 0.32 ์ปค๋ ์ ํ ์ฝ๋ ๊ธฐ์ค, ์ค์ ์คํ์ B200์์๋ง ํ์ธ)
- ๋ฉ๋ชจ๋ฆฌ: ๊ฐ์ค์น 4.2 GB + KV ์บ์(์ปจํ
์คํธ ๊ธธ์ด ร ๋์ ์์ฒญ ์์ ๋น๋ก) + ํ์ฑํยทCUDA graph์ฉ ์ GB โ GPU ํ ์ฅ์ ๋ค ๋ค์ด๊ฐ์ง ์์ผ๋ฉด
--tensor-parallel-size N์ผ๋ก ๋ถ์ฐ - Transformers๋ก ์ง์ ์ฌ์ฉ: transformers 5.2.0 ์ด์ + compressed-tensors 0.15.0 ์ด์ (Qwen3.5-0.8B์ FP8ยทAWQ-4bitยทNVFP4A16ยทNVFP4 ๋น๋๋ก CPU์์ ํ์ธ)
- trust_remote_code: ๋ถํ์
์ฌ์ฉ๋ฒ
- ์๋ฒ ์คํ:
vllm serve axteam/Qwen3.5-4B-AWQ-4bit --max-model-len 32768โ OpenAI ํธํ API - Python:
LLM(model="axteam/Qwen3.5-4B-AWQ-4bit", max_model_len=32768).chat(...)โ ์ ์ฒด ์์๋ ์ ์์ด ๋ณธ๋ฌธ 'Usage (vLLM)' ์ ์ฐธ๊ณ - thinking ๋ชจ๋: ๊ธฐ๋ณธ ์ผ์ง โ ๋๋ ค๋ฉด
chat_template_kwargs={"enable_thinking": False}์ ๋ฌ(Python์llm.chat()์ธ์, HTTP๋ ์์ฒญ ๋ณธ๋ฌธ์"chat_template_kwargs": {"enable_thinking": false}) - ์ด๋ฏธ์ง ์
๋ ฅ: ๋ฉ์์ง์
image_urlํญ๋ชฉ ์ฌ์ฉ - ํ
์คํธ๋ง ์ฌ์ฉํ ๋:
--limit-mm-per-prompt '{"image": 0, "video": 0}'โ ๋น์ ํ์์ฉ ๋ฉ๋ชจ๋ฆฌ ์์ฝ์ ์๋ตํด ๋ฉ๋ชจ๋ฆฌ ์ ์ฝ - KV ์บ์ ์ ๊ฐ(์ ํ):
vllm serve์--kv-cache-dtype fp8์ถ๊ฐ โ ๊ธฐ๋ณธ BF16์ธ KV ์บ์๋ฅผ FP8๋ก ์ ์ฅํด KV ์บ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ฝ ์ ๋ฐ์ผ๋ก ์ค์ (๊ธด ์ปจํ ์คํธยท๋์ ์์ฒญ์ด ๋ง์ ๋ ์ ๋ฆฌ, ๊ฐ์ค์น ์์ํ์ ๋ณ๊ฐ์ธ ์คํ ์ต์ )
์ฐธ๊ณ
- ์์ ์ด๋ ฅ (2026-11-01): AWQ๊ฐ ์ค๋ฌด๋ฉํ์ง ์๋ RMSNorm ๊ฐ์ค์น๋ฅผ ์๋ณธ๊ณผ ๋นํธ ๋จ์๋ก ๊ฐ๊ฒ ๋ณต์ โ llm-compressor๊ฐ ๋จ๊ธด BF16 ๋ฐ์ฌ๋ฆผ ์ค์ฐจ(์คํจ ๊ฐ์ค์น ๊ธฐ์ค ์ต๋ 0.4%) ์ ๊ฑฐ, ์์ํ ๊ฐ์ค์น์ AWQ๋ก ์ค๋ฌด๋ฉ๋ RMSNorm์ ๋ณ๊ฒฝ ์์, ํ์ง ํญ๋ชฉ์ ์ธก์ ๊ฐ์ ๋ณต์ ์ ๊ธฐ์ค
๋ผ์ด์ ์ค
- ๋ผ์ด์ ์ค: Apache-2.0 โ ์๋ณธ ๋ชจ๋ธ์ ๋ผ์ด์ ์ค๋ฅผ ๊ทธ๋๋ก ๋ฐ๋ฆ
- ๊ถ๋ฆฌ: ์๋ณธ ๊ฐ์ค์นยทํ ํฌ๋์ด์ ยทchat template์ Qwen ํ(Alibaba) ์์ , ์ด ๋ฆฌํฌ๋ ์์ํ ํ์๋ฌผ
- Downloads last month
- 168