Image-Text-to-Text
Transformers
Safetensors
qwen3_5
fp8
quantized
vllm
llm-compressor
vision-language
qwen3.5
conversational
compressed-tensors
Instructions to use tcotter/Qwen3.5-9B-FP8-Dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tcotter/Qwen3.5-9B-FP8-Dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tcotter/Qwen3.5-9B-FP8-Dynamic") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("tcotter/Qwen3.5-9B-FP8-Dynamic") model = AutoModelForImageTextToText.from_pretrained("tcotter/Qwen3.5-9B-FP8-Dynamic") 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
- vLLM
How to use tcotter/Qwen3.5-9B-FP8-Dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tcotter/Qwen3.5-9B-FP8-Dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tcotter/Qwen3.5-9B-FP8-Dynamic", "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/tcotter/Qwen3.5-9B-FP8-Dynamic
- SGLang
How to use tcotter/Qwen3.5-9B-FP8-Dynamic 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 "tcotter/Qwen3.5-9B-FP8-Dynamic" \ --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": "tcotter/Qwen3.5-9B-FP8-Dynamic", "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 "tcotter/Qwen3.5-9B-FP8-Dynamic" \ --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": "tcotter/Qwen3.5-9B-FP8-Dynamic", "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 tcotter/Qwen3.5-9B-FP8-Dynamic with Docker Model Runner:
docker model run hf.co/tcotter/Qwen3.5-9B-FP8-Dynamic
Qwen3.5-9B-FP8-Dynamic
FP8 dynamically quantised version of Qwen/Qwen3.5-9B, created using llm-compressor.
Quantisation Details
- Scheme:
FP8_DYNAMIC(W8A8 — FP8 per-channel weights, dynamic per-token activation quantisation) - Target layers: All
Linearmodules except those listed below - Ignored layers:
lm_head— output projection to vocabularyre:.*visual.*— entire vision encoder (patch embed, attention, MLP, merger)re:.*linear_attn.*— GatedDeltaNet hybrid linear attention layers (Qwen3.5-specific architecture)
These layers remain in BF16 as they are sensitive to quantisation. In particular, the vision encoder's merger layers are a bottleneck between the visual and language representations, and the GatedDeltaNet layers contain small 32-dimensional projections that lose significant precision under FP8.
Usage with vLLM
from vllm import LLM
model = LLM("tcotter/Qwen3.5-9B-FP8-Dynamic")
vLLM auto-detects the quantisation config from the checkpoint — no --quantization flag needed.
Usage with Transformers
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained("tcotter/Qwen3.5-9B-FP8-Dynamic")
processor = AutoProcessor.from_pretrained("tcotter/Qwen3.5-9B-FP8-Dynamic")
Quantisation Recipe
from transformers import AutoModelForImageTextToText, AutoProcessor
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
model = AutoModelForImageTextToText.from_pretrained(
"Qwen/Qwen3.5-9B", dtype="auto", trust_remote_code=True
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen3.5-9B", trust_remote_code=True)
recipe = QuantizationModifier(
targets="Linear",
scheme="FP8_DYNAMIC",
ignore=[
"lm_head",
"re:.*visual.*",
"re:.*linear_attn.*",
],
)
oneshot(model=model, recipe=recipe)
model.save_pretrained("Qwen3.5-9B-FP8-Dynamic")
processor.save_pretrained("Qwen3.5-9B-FP8-Dynamic")
Notes
- Qwen3.5 uses a hybrid architecture with both standard self-attention and GatedDeltaNet linear attention layers. The linear attention layers are excluded from quantisation as their small projection dimensions (32-dim in_proj_a and in_proj_b) are particularly sensitive to precision loss.
- Qwen3.5 uses a 16px patch size (vs 14px in Qwen2.5), allowing ~30% more pixels per visual token at the same inference cost.
- Tested on NVIDIA L4 (24GB) GPUs.
- Downloads last month
- 187