Instructions to use morosystems/ThinkingCap-Qwen3.6-27B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use morosystems/ThinkingCap-Qwen3.6-27B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="morosystems/ThinkingCap-Qwen3.6-27B-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("morosystems/ThinkingCap-Qwen3.6-27B-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("morosystems/ThinkingCap-Qwen3.6-27B-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 morosystems/ThinkingCap-Qwen3.6-27B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "morosystems/ThinkingCap-Qwen3.6-27B-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": "morosystems/ThinkingCap-Qwen3.6-27B-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/morosystems/ThinkingCap-Qwen3.6-27B-NVFP4
- SGLang
How to use morosystems/ThinkingCap-Qwen3.6-27B-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 "morosystems/ThinkingCap-Qwen3.6-27B-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": "morosystems/ThinkingCap-Qwen3.6-27B-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 "morosystems/ThinkingCap-Qwen3.6-27B-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": "morosystems/ThinkingCap-Qwen3.6-27B-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 morosystems/ThinkingCap-Qwen3.6-27B-NVFP4 with Docker Model Runner:
docker model run hf.co/morosystems/ThinkingCap-Qwen3.6-27B-NVFP4
config.json declares static FP8 kv_cache_scheme but ships no k_scale/v_scale tensors
Summary
config.json advertises static FP8 KV-cache quantization, but the checkpoint contains zerok_scale/v_scale tensors. vLLM therefore falls back to an uncalibrated scaling factor of 1.0
and emits accuracy warnings.
Because the setting comes from the checkpoint's own quantization_config, it cannot be
overridden or disabled from the serving side β so downstream users have no workaround.
Details
config.json declares:
"kv_cache_scheme": {"dynamic": false, "num_bits": 8, "type": "float"}
dynamic: false denotes static quantization, which requires precomputed scales stored in the
weights. Enumerating every *scale* tensor in model.safetensors.index.json (2,399 tensors):
| suffix | count | purpose |
|---|---|---|
input_scale |
400 | NVFP4 linear activation scales β |
weight_scale |
400 | NVFP4 weight scales β |
weight_scale_2 |
400 | NVFP4 second-level scales β |
k_scale |
0 | KV-cache key scales β |
v_scale |
0 | KV-cache value scales β |
The NVFP4 weight quantization is complete and correct. It is specifically the KV-cache
calibration that is declared in config but absent from the weights.
The model has 64 layers β 16 full_attention and 48 linear_attention β so exactly 16 k_scale
and 16 v_scale tensors are expected (only full-attention layers maintain a KV cache).
Observed behavior
WARNING [kv_cache.py] Checkpoint does not provide a q scaling factor. Setting it to k_scale.
WARNING [kv_cache.py] Using KV cache scaling factor 1.0 for fp8_e4m3. If this is unintended,
verify that k/v_scale scaling factors are properly set in the checkpoint.
WARNING [kv_cache.py] Using uncalibrated q_scale 1.0 and/or prob_scale 1.0 with fp8 attention.
This may cause accuracy issues.
Reproduced identically on two vLLM versions β this is not a version-specific artifact:
vllm/vllm-openai:v0.19.1-cu130-ubuntu2404vllm/vllm-openai:vllm-x86_64-cu13-0.25.1(v0.25.1)
With an unfitted scale of 1.0, the e4m3 dynamic range is not matched to the actual K/V activation
distribution, so available mantissa precision is not used effectively. The effect is expected to
compound over long contexts.
No downstream workaround
All of the following still yield fp8 KV with scale 1.0, because the checkpoint config takes
precedence over CLI flags:
- omitting
--kv-cache-dtypeentirely - explicitly passing
--kv-cache-dtype auto
Reference: a sibling quant of the same base model does this correctly
unsloth/Qwen3.6-27B-NVFP4 (same base model and architecture, compressed-tensors) ships:
| tensor | ThinkingCap-Qwen3.6-27B-NVFP4 | unsloth/Qwen3.6-27B-NVFP4 |
|---|---|---|
k_scale |
0 | 16 β |
v_scale |
0 | 16 β |
16 matches the 16 full_attention layers exactly. Its kv_cache_scheme also records"observer": "static_minmax", documenting how the scales were calibrated.
Suggested fix (either resolves it)
- Run KV-cache calibration and ship the 16
k_scale+ 16v_scaletensors β preserves the
FP8 KV memory savings. (Preferred.) - Remove
kv_cache_schemefromconfig.jsonβ a one-line change; serving stacks then use
bf16 KV cache. Trades memory for accuracy.
Most likely cause: the kv_cache_scheme block was inherited/templated into the config during the
finetune-and-requantize step, while the KV calibration pass was not run.
Environment
- Model:
morosystems/ThinkingCap-Qwen3.6-27B-NVFP4(snapshot656627c8) - vLLM: 0.19.1 (cu130) and 0.25.1 β same behavior on both
- GPU: NVIDIA RTX PRO 6000 Blackwell (compute capability 12.0)
- Flags:
--max-model-len 262144 --dtype bfloat16 --enable-prefix-caching