Instructions to use GadflyII/Qwen3-Coder-Next-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GadflyII/Qwen3-Coder-Next-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GadflyII/Qwen3-Coder-Next-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GadflyII/Qwen3-Coder-Next-NVFP4") model = AutoModelForCausalLM.from_pretrained("GadflyII/Qwen3-Coder-Next-NVFP4") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GadflyII/Qwen3-Coder-Next-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GadflyII/Qwen3-Coder-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": "GadflyII/Qwen3-Coder-Next-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GadflyII/Qwen3-Coder-Next-NVFP4
- SGLang
How to use GadflyII/Qwen3-Coder-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 "GadflyII/Qwen3-Coder-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": "GadflyII/Qwen3-Coder-Next-NVFP4", "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 "GadflyII/Qwen3-Coder-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": "GadflyII/Qwen3-Coder-Next-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GadflyII/Qwen3-Coder-Next-NVFP4 with Docker Model Runner:
docker model run hf.co/GadflyII/Qwen3-Coder-Next-NVFP4
Spark support
I was able to get it working
ExecStart=/usr/bin/docker run --rm --gpus all
--name vllm-coder-agent
-p 8100:8000
-v /home/user/.cache/huggingface:/root/.cache/huggingface
-v /home/user/.cache/vllm:/root/.cache/vllm
--ipc=host
vllm/vllm-openai:v0.17.1-cu130
--model GadflyII/Qwen3-Coder-Next-NVFP4
--gpu-memory-utilization 0.65
--max-model-len 65536
--kv-cache-dtype fp8
--enforce-eager
--enable-auto-tool-choice
--tool-call-parser hermes
however I can't run it without --enforce-eager so I'm capped at like 10 tok/s. Any ideas?
This is from a working docker compose I play around with:
services:
vllm-spark-pro:
image: nvcr.io/nvidia/vllm:26.03-py3
container_name: vllm-spark-pro
runtime: nvidia
ipc: host
deploy:
resources:
limits:
memory: 100G
ports:
- "8000:8000"
environment:
- NVIDIA_VISIBLE_DEVICES=all
- HF_TOKEN=${HF_TOKEN}
- VLLM_USE_FLASHINFER_MOE_FP4=0
- VLLM_NVFP4_GEMM_BACKEND=marlin # FORCES stable, fast GEMM
- VLLM_TEST_FORCE_FP8_MARLIN=1 # Routes FP8 KV cache through stable path
- VLLM_MARLIN_USE_ATOMIC_ADD=1 # This specifically speeds up the "summing" of huge attention matrices during those massive 100k+ token context reads.
command:
- "vllm"
- "serve"
- "GadflyII/Qwen3-Coder-Next-NVFP4"
- "--max-model-len"
- "262144"
#- "--chat-template"
#- "/app/data/pastebin_quen_template.jinja"
- "--max-num-batched-tokens"
- "65536"
- "--gpu-memory-utilization"
- "0.85"
- "--kv-cache-dtype"
- "fp8"
- "--enable-prefix-caching" # CRITICAL for coding models (fast multi-turn responses)
- "--tool-call-parser"
- "qwen3_xml"
- "--enable-auto-tool-choice"
- "--max-num-seqs"
- "4"
restart: unless-stopped
volumes:
- hf-cache:/root/.cache/huggingface
- ./:/app/data