Instructions to use Inferact/Qwen3.8-Flash-Next-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Inferact/Qwen3.8-Flash-Next-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Inferact/Qwen3.8-Flash-Next-NVFP4") 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("Inferact/Qwen3.8-Flash-Next-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("Inferact/Qwen3.8-Flash-Next-NVFP4", 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 Inferact/Qwen3.8-Flash-Next-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Inferact/Qwen3.8-Flash-Next-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Inferact/Qwen3.8-Flash-Next-NVFP4", "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/Inferact/Qwen3.8-Flash-Next-NVFP4
- SGLang
How to use Inferact/Qwen3.8-Flash-Next-NVFP4 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 "Inferact/Qwen3.8-Flash-Next-NVFP4" \ --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": "Inferact/Qwen3.8-Flash-Next-NVFP4", "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 "Inferact/Qwen3.8-Flash-Next-NVFP4" \ --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": "Inferact/Qwen3.8-Flash-Next-NVFP4", "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 Inferact/Qwen3.8-Flash-Next-NVFP4 with Docker Model Runner:
docker model run hf.co/Inferact/Qwen3.8-Flash-Next-NVFP4
Is 180GB right?
Hi, is 180GB right? it is the same as the FP8 i think.
Thank you!
I don't have a concrete answer here but my understanding is - yes. If you add up all the safetensor files you get ~180gb. I think the experts have been quantized to NVFP4 but the n-gram embedding layer isn't and it's like 95GB?
Yes The N-gram is still fp16 in offical recipe, the choices are bf16, fp16 and fp32 in sglang.
Waiting for the n-gram to be quantized to fp8/nvfp4
This thing flies on a single RTX Pro 6000 offloading all the n-gram stuff to system ram.
This thing flies on a single RTX Pro 6000 offloading all the n-gram stuff to system ram.
Can you share your recipe?
This thing flies on a single RTX Pro 6000 offloading all the n-gram stuff to system ram.
Can you share your recipe?
I run this in docker, but this is the recipe. If you want the full docker setup I can share that also.
# Requirements: native Linux (NOT WSL2), NVIDIA driver, and a vllm build that
# contains the qwen3_8_flash_next model (the NVIDIA fork our image is built from,
# v0.1.dev20073+g8e685d198 — stock pip vLLM may not have this model yet).
# Weights must be in the HF cache: export HF_HOME=/path/to/huggingface first.
VLLM_PLE_CPU_OFFLOAD=1 \
CUDA_DEVICE_ORDER=PCI_BUS_ID \
CUDA_VISIBLE_DEVICES=0 \
vllm serve Inferact/Qwen3.8-Flash-Next-NVFP4 \
--served-model-name qwen38-flash-next \
--host 127.0.0.1 --port 8000 \
--max-model-len 262144 \
--gpu-memory-utilization 0.95 \
--max-num-seqs 25 \
--kv-cache-memory 11500000000 \
--distributed-executor-backend mp \
--enable-prefix-caching \
--no-enable-flashinfer-autotune \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--reasoning-parser qwen3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Notes for the bare-metal folks:
- Only 3 changes vs our Docker run:
VLLM_PLE_CPU_OFFLOAD=1goes in the shell env,HF_HOMEmust point at the dir containinghub/models--Inferact--Qwen3.8-Flash-Next-NVFP4, and the CDI/device flags disappear (vLLM grabs the GPU directly viaCUDA_VISIBLE_DEVICES). Everything else is identical to the verified config. - RAM check first:
free -gbefore serving — the PLE offload worker needs tens of GB of host RAM; 128 GB min, 192 GB comfortable. - Optional bare-metal-only extra:
PYTORCH_ALLOC_CONF=expandable_segments:Truedoes work without Docker (no seccomp wall for the PLE worker'spidfd_getfd)
Measured performance (this exact config)
Metric Result
──────────────────────────────────────
Prefill 12,396 tok/s (5,457-tok prompt)
Decode, single stream 158 tok/s
Decode, 2 concurrent 287 tok/s system
Decode, 8 concurrent 715 tok/s system
25-concurrent JSON burst, thinking off 25/25 OK, 1.3s wall, p50 0.81s
Engine stability 0 crashes / 0 OOM / 0 × 500 across full battery
docker run --runtime nvidia --gpus all --ipc=host
--memory 120g
--shm-size 26g
-v /home/cheng/model/Qwen3.8-Flash-Next-NVFP4:/model
-p 8000:8000
--ipc=host
-e VLLM_PLE_CPU_OFFLOAD=1
-e PYTORCH_ALLOC_CONF=expandable_segments:True
-e CUDA_DEVICE_ORDER=PCI_BUS_ID
vllm/vllm-openai:qwen38-flash-next
/model
--served-model-name qwen38-flash-next
--host 0.0.0.0 --port 8000
--max-model-len 32768
--gpu-memory-utilization 0.85
--max-num-seqs 2
--tensor-parallel-size 4
--distributed-executor-backend mp
--enable-prefix-caching
--no-enable-flashinfer-autotune
--enable-auto-tool-choice
--tool-call-parser qwen3_coder
--reasoning-parser qwen3
--enforce-eager
I tested several commands and they all overflowed the video memory. Mine is 4*3090 512G memory.