Instructions to use dudeman2512/Qwen3.8-27B-int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dudeman2512/Qwen3.8-27B-int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dudeman2512/Qwen3.8-27B-int4") 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("dudeman2512/Qwen3.8-27B-int4") model = AutoModelForMultimodalLM.from_pretrained("dudeman2512/Qwen3.8-27B-int4", 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 dudeman2512/Qwen3.8-27B-int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dudeman2512/Qwen3.8-27B-int4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dudeman2512/Qwen3.8-27B-int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dudeman2512/Qwen3.8-27B-int4
- SGLang
How to use dudeman2512/Qwen3.8-27B-int4 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 "dudeman2512/Qwen3.8-27B-int4" \ --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": "dudeman2512/Qwen3.8-27B-int4", "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 "dudeman2512/Qwen3.8-27B-int4" \ --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": "dudeman2512/Qwen3.8-27B-int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dudeman2512/Qwen3.8-27B-int4 with Docker Model Runner:
docker model run hf.co/dudeman2512/Qwen3.8-27B-int4
Qwen3.8-27B-int4
int4 quantization of Qwen/Qwen3.8-27B, produced with compressed-tensors by streaming the checkpoint tensor-by-tensor (the model is never fully instantiated).
4-bit integer weights in groups of 128 with a BF16 scale. Smallest of the set and the highest error.
All quantizations of this model
| Variant | Format | Size | vs BF16 | Mean rel. error | Linears quantized | Left BF16 |
|---|---|---|---|---|---|---|
| Qwen3.8-27B-FP8 | float-quantized |
30.35 GB | 55% | 0.0264 | 615 | 0 |
| Qwen3.8-27B-NVFP4 | nvfp4-pack-quantized |
19.29 GB | 35% | 0.0950 | 615 | 0 |
| Qwen3.8-27B-int4 ← this one | pack-quantized |
18.31 GB | 33% | 0.1178 | 588 | 27 |
Mean relative error is ||dequant(W) - W|| / ||W||, averaged over a sample of quantized Linear layers, measured against the original BF16 weights. Lower is better.
This variant
| Format | pack-quantized |
| Weight bits | 4 |
| Group size | 128 |
| Strategy | group |
| Linears quantized | 588 |
| Left in BF16 | 27 |
| Shards | 5 |
| On disk | 18.31 GB |
| Mean relative error | 0.1178 |
| Shape/dtype conformance failures | 0 |
Layers left in BF16
27 Linear layers could not be quantized at group size 128: their in_features is not a multiple of 128. They are stored as BF16 and listed in the ignore list of config.json, so servers load them unquantized rather than misreading them.
They are all in the vision tower, so the language model is fully quantized:
model.visual.blocks.0.mlp.linear_fc2
model.visual.blocks.1.mlp.linear_fc2
model.visual.blocks.10.mlp.linear_fc2
model.visual.blocks.11.mlp.linear_fc2
model.visual.blocks.12.mlp.linear_fc2
model.visual.blocks.13.mlp.linear_fc2
... and 21 more
Use with vLLM
vllm serve dudeman2512/Qwen3.8-27B-int4
How this was made
Every produced tensor is checked for shape/dtype conformance against what the server expects, then reconstruction error is measured against the source BF16 weights, before anything is published. The numbers in the table above are those measurements — not estimates.
- Downloads last month
- 32
Model tree for dudeman2512/Qwen3.8-27B-int4
Base model
Qwen/Qwen3.8-27B