Image-Text-to-Text
Transformers
Safetensors
qwen3_5
compressed-tensors
w8a8
int8
quantized
qwen
multimodal
vision-language
vllm
conversational
8-bit precision
Instructions to use rovangju/Swift-Qwen3.8-27b-W8A8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rovangju/Swift-Qwen3.8-27b-W8A8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="rovangju/Swift-Qwen3.8-27b-W8A8") 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("rovangju/Swift-Qwen3.8-27b-W8A8") model = AutoModelForMultimodalLM.from_pretrained("rovangju/Swift-Qwen3.8-27b-W8A8", 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 rovangju/Swift-Qwen3.8-27b-W8A8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rovangju/Swift-Qwen3.8-27b-W8A8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rovangju/Swift-Qwen3.8-27b-W8A8", "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/rovangju/Swift-Qwen3.8-27b-W8A8
- SGLang
How to use rovangju/Swift-Qwen3.8-27b-W8A8 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 "rovangju/Swift-Qwen3.8-27b-W8A8" \ --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": "rovangju/Swift-Qwen3.8-27b-W8A8", "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 "rovangju/Swift-Qwen3.8-27b-W8A8" \ --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": "rovangju/Swift-Qwen3.8-27b-W8A8", "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 rovangju/Swift-Qwen3.8-27b-W8A8 with Docker Model Runner:
docker model run hf.co/rovangju/Swift-Qwen3.8-27b-W8A8
Update README.md
Browse filesBit of cleanup of llm fluff.
README.md
CHANGED
|
@@ -6,7 +6,7 @@ library_name: transformers
|
|
| 6 |
base_model: ukisai/Swift-Qwen3.8-27b
|
| 7 |
quantized_with:
|
| 8 |
name: llm-compressor
|
| 9 |
-
version:
|
| 10 |
tags:
|
| 11 |
- compressed-tensors
|
| 12 |
- w8a8
|
|
@@ -75,11 +75,6 @@ Two things were handled deliberately during quantization:
|
|
| 75 |
original index, per-channel scale shapes checked, and a hard failure if any
|
| 76 |
activation scale tensors were written) passed for all shards.
|
| 77 |
|
| 78 |
-
## Requirements
|
| 79 |
-
|
| 80 |
-
- vLLM with compressed-tensors W8A8 INT8 support (compute capability **≥ 7.5**)
|
| 81 |
-
- Fits on a single 64 GB GPU (loaded at ~28.5 GiB)
|
| 82 |
-
|
| 83 |
## Usage — vLLM
|
| 84 |
|
| 85 |
```bash
|
|
@@ -120,16 +115,6 @@ are wide; treat them as a sanity gate, not a final benchmark. The strict-match
|
|
| 120 |
GSM8K score is a known artifact of the harness's strict filter on this
|
| 121 |
template, not a model failure.
|
| 122 |
|
| 123 |
-
## Reproducing the quantization
|
| 124 |
-
|
| 125 |
-
```bash
|
| 126 |
-
CUDA_VISIBLE_DEVICES=1 .venv/bin/python scripts/quantize_swift_w8a8.py
|
| 127 |
-
```
|
| 128 |
-
|
| 129 |
-
- Base model resident in RAM (~95 GB free needed); quant ops stream each
|
| 130 |
-
module onto a free GPU (needs ~10 GB free on `cuda:0`)
|
| 131 |
-
- ~45 GB free disk; ~5–10 min wall time
|
| 132 |
-
|
| 133 |
## Appendix — benchmark serve script
|
| 134 |
|
| 135 |
The vLLM run used for the benchmark numbers above (identical for both
|
|
@@ -137,12 +122,8 @@ models; the only difference between the two runs was the model path):
|
|
| 137 |
|
| 138 |
```bash
|
| 139 |
#!/usr/bin/env bash
|
| 140 |
-
# 03-w8a8-champ: kv-cache-dtype removed, attn backend -> FLASH_ATTN, K -> 5
|
| 141 |
-
# generated from study.yaml by bench/study.py — do not hand-edit;
|
| 142 |
-
# edit the run entry in study.yaml and rerun `python bench/study.py materialize`.
|
| 143 |
-
set -euo pipefail
|
| 144 |
|
| 145 |
-
|
| 146 |
|
| 147 |
vllm serve <MODEL> \
|
| 148 |
--dtype bfloat16 \
|
|
@@ -169,4 +150,4 @@ Swift distribution.
|
|
| 169 |
`swift-open-license-1.0`, inherited from the base model
|
| 170 |
[ukisai/Swift-Qwen3.8-27b](https://huggingface.co/ukisai/Swift-Qwen3.8-27b) —
|
| 171 |
see the [base model's LICENSE](https://huggingface.co/ukisai/Swift-Qwen3.8-27b/blob/main/LICENSE)
|
| 172 |
-
for the exact terms (this quantization adds no restrictions of its own).
|
|
|
|
| 6 |
base_model: ukisai/Swift-Qwen3.8-27b
|
| 7 |
quantized_with:
|
| 8 |
name: llm-compressor
|
| 9 |
+
version: '0.14'
|
| 10 |
tags:
|
| 11 |
- compressed-tensors
|
| 12 |
- w8a8
|
|
|
|
| 75 |
original index, per-channel scale shapes checked, and a hard failure if any
|
| 76 |
activation scale tensors were written) passed for all shards.
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
## Usage — vLLM
|
| 79 |
|
| 80 |
```bash
|
|
|
|
| 115 |
GSM8K score is a known artifact of the harness's strict filter on this
|
| 116 |
template, not a model failure.
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
## Appendix — benchmark serve script
|
| 119 |
|
| 120 |
The vLLM run used for the benchmark numbers above (identical for both
|
|
|
|
| 122 |
|
| 123 |
```bash
|
| 124 |
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
+
set -euo pipefail
|
| 127 |
|
| 128 |
vllm serve <MODEL> \
|
| 129 |
--dtype bfloat16 \
|
|
|
|
| 150 |
`swift-open-license-1.0`, inherited from the base model
|
| 151 |
[ukisai/Swift-Qwen3.8-27b](https://huggingface.co/ukisai/Swift-Qwen3.8-27b) —
|
| 152 |
see the [base model's LICENSE](https://huggingface.co/ukisai/Swift-Qwen3.8-27b/blob/main/LICENSE)
|
| 153 |
+
for the exact terms (this quantization adds no restrictions of its own).
|