Instructions to use ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP") 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("ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP") model = AutoModelForMultimodalLM.from_pretrained("ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP", 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 ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP", "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/ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP
- SGLang
How to use ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP 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 "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP" \ --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": "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP", "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 "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP" \ --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": "ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP", "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 ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP with Docker Model Runner:
docker model run hf.co/ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP
Qwen3.8-27B-NVFP4-FP8KV-MTP by IG1
Quantization
This model has been quantized using llm-compressor v0.13.0 and transformers v5.14.1. It is based on the official example with a few modifications (see next section).
Quantization particularities
The sequence length has been increased to 8192 and the number of samples to 1024. The 1024 samples come from 4 different datasets:
- 256 general conversation samples (UltraChat)
- 256 math reasoning samples (GSM8K)
- 256 code samples (CodeAlpaca)
- 256 multilingual samples (Aya)
You can find the quantization script here.
The recipe targets Linear layers with the NVFP4 scheme, while excluding:
lm_headre:.*visual.*(vision tower)re:.*linear_attn.*(Gated DeltaNet layers)
About FP8 KV cache
Unlike our previous Qwen3.5/3.6 experiments, FP8 KV cache works correctly on Qwen3.8 thanks to the observer fusion fix in llm-compressor 0.13.0.
The checkpoint contains calibrated static FP8 scales (k_scale/v_scale) for the 16 full-attention layers. These scales are passive metadata:
- Without
--kv-cache-dtype fp8: vLLM ignores them and uses BF16 KV cache (default, recommended for maximum quality) - With
--kv-cache-dtype fp8: vLLM uses the calibrated scales for FP8 KV cache
Important note on capacity: On this hybrid architecture, FP8 KV cache does not significantly increase total KV cache capacity. The Gated DeltaNet state (48 layers) dominates memory usage and is not affected by --kv-cache-dtype. FP8 KV provides a modest decode speedup on the 16 attention layers, not more context length.
Qwen3.8 Modes & Reverse Proxy
Qwen 3.8 natively supports several runtime modes (instruct, thinking, preserve thinking) and multiple reasoning effort levels. Activating them requires sending vendor-specific parameters such as chat_template_kwargs, which most standard OpenAI clients do not expose.
To solve this, we built a lightweight reverse proxy that exposes each official mode as a distinct virtual model name. Your client simply picks the model — the proxy automatically injects the correct chat_template_kwargs, sampling parameters, and reasoning effort:
qwen38-instruct— Native instruct mode (no reasoning)qwen38-thinking— Thinking mode,reasoning_effortcontrollable by the clientqwen38-thinking-preserve— Thinking mode with historical thinking preservation- Optional pre-configured variants:
-low,-medium,-xhighfor each thinking mode
View the project on our GitHub: iguanesolutions/qwen38-rp
Inference
We run this model with vLLM, here is a sample execution command (from the official vllm's recipe):
docker run --rm --name 'Qwen3.8' --gpus all --privileged --ipc=host -p 8000:8000 \
-v /srv/cache:/root/.cache \
vllm/vllm-openai:qwen38 ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP \
--served-model-name 'Qwen3.8-27B' \
--max-model-len auto \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--reasoning-parser qwen3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":2}'
Note: The
vllm/vllm-openai:qwen38image is a temporary build with Qwen3.8 support. Once the next official vLLM release is out, use the standardvllm/vllm-openai:latest(or the release tag) instead.
A few notes about some of the parameters:
- Adapt the
/srv/cache:/root/.cachemount point to your liking. It contains files you want to keep between multiple runs (dynamo bytecode and AOT with torch compile but most importantly the huggingface folder for the model). --reasoning-parser qwen3and--tool-call-parser qwen3_coderare required for the reverse proxy's thinking modes and tool calls.--speculative-config '{"method":"mtp","num_speculative_tokens":2}'enables Multi-Token Prediction for lower latency. We recommend2over3based on acceptance rate measurements (~56% average draft acceptance with 3 tokens, better efficiency with 2).
Optional: FP8 KV cache
To enable FP8 KV cache with the calibrated scales, add:
--kv-cache-dtype fp8
Expected effects:
- ~10-20% decode speedup on attention layers
- No significant change in total KV cache capacity (see note above)
- Quality preserved thanks to calibrated scales
Speculative Decoding (MTP)
The layers responsible for Multi-Token Prediction have not been quantized and are available separately in the model_mtp.safetensors file. vLLM loads them automatically when --speculative-config is provided.
This is recommended for latency-focused serving scenarios (not total throughput/massive concurrent requests).
License
This model is a quantized version of Qwen/Qwen3.8-27B. Please refer to the original model card for license and usage terms.
- Downloads last month
- -
Model tree for ig1/Qwen3.8-27B-NVFP4-FP8KV-MTP
Base model
Qwen/Qwen3.8-27B