Instructions to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K") 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 AutoModel model = AutoModel.from_pretrained("AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K", dtype="auto") - llama-cpp-python
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K", filename="mmproj-F16.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16 # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16 # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16 # Run inference directly in the terminal: ./llama-cli -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Use Docker
docker model run hf.co/AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
- LM Studio
- Jan
- vLLM
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K", "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/AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
- SGLang
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K 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 "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K" \ --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": "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K", "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 "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K" \ --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": "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K", "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" } } ] } ] }' - Ollama
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Ollama:
ollama run hf.co/AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
- Unsloth Studio
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K to start chatting
- Pi
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Docker Model Runner:
docker model run hf.co/AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
- Lemonade
How to use AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K:F16
Run and chat with the model
lemonade run user.Qwen3.6-27B-MTP-Custom-IQ6_K-F16
List all available models
lemonade list
Qwen3.6-27B-MTP-Custom-IQ6_K
Overview
This repository provides a highly optimized, custom-quantized GGUF model of Qwen3.6 27B, specifically engineered for local deployment on Dual-GPU setups (e.g., 2x RTX 3090 24GB).
The primary research objective of this quantization is to achieve an extreme context length (up to 200K tokens in F16 KV Cache) while maximizing inference speed through Multi-Token Prediction (MTP / Self-Speculative Decoding) and retaining most of the original model's capacities. To achieve this, the base network was quantized to IQ6_K using a custom iMatrix, while the critical NextN layers and embeddings were strictly preserved in Q8_0.
The base model used for this requantization is unsloth/Qwen3.6-27B-GGUF-MTP.
Engine Compatibility
Important: This model has been specifically designed for and tested on ik_llama.cpp.
Standard llama.cpp releases currently only support the specific handling of MTP layers through one specific branch (see Unsloth's official repo) but ik_llama.cpp brings combined with mixed custom quantizations and a better splitting for multi-GPU setups. Using ik_llama.cpp is highly recommended to achieve the expected draft acceptance rates and multi-GPU VRAM distribution and might be necessary due to the custom quantization used here.
Research & Methodology
Preserving Speculative Decoding (MTP)
Most standard quantization pipelines compress the entire model, which severely degrades the NextN layers responsible for Multi-Token Prediction or completely suppress it. This results in poor speculative decoding acceptance rates. During the quantization process, the following custom layer overriding was applied:
--custom-q "blk\\.64\\.nextn\\..*=q8_0"
This forces the speculative heads to remain in high precision. In practical testing, this setup achieved a Draft Acceptance Rate of ~89.9% (438 accepted / 487 generated), effectively doubling the generation speed (~35 tokens/s) on a heavy ~200K token context load.
Chat Template Optimization
The original Qwen3.6 chat template contains known formatting bugs that can affect inference behavior and lacks the Developer role. To resolve this, the previous custom GGUF I built was manually patched using the Hugging Face tool CISCai/gguf-editor but this new one is directly quantized from Unsloth's MTP ready BF16 model. It therefore integrate directly the Unsloth corrected chat_template into the GGUF metadata, ensuring stable and correct out-of-the-box formatting without the need for manual template overrides.
iMatrix Calibration
The model was calibrated using a custom, shuffled iMatrix to ensure high fidelity across coding, instruction-following, and bilingual tasks (English/French).
The dataset was built by merging and shuffling the following subsets from eaddario/imatrix-calibration:
code_smalltools_smalltext_en_smalltext_fr_small
Recommended Usage
To replicate the optimal performance (200K context, F16 Cache, Multi-GPU) using ik_llama.cpp, use the following llama-server command. Note the specific use of --split-mode graph and --tensor-split 3,2 for optimal PCIe bandwidth management across dual RTX 3090s. This command appeared to be the best one I could come across as I do not own an NVLink at the moment.
/path/to/ik_llama.cpp/build/bin/llama-server \
-m /path/to/qwen3.6-27B-MTP-Custom-IQ6_K.gguf \
--mmproj /path/to/mmproj-F16.gguf \
--split-mode graph \
--tensor-split 3,2 \
--max-gpu 2 \
--host 0.0.0.0 \
--port 8080 \
--ctx-size 200231 \
--parallel 1 \
--gpu-layers 999 \
--cache-type-k f16 \
--cache-type-v f16 \
--context-shift on \
--flash-attn on \
-b 2048 -ub 2048 \
-amb 512 -rtr -sas -smgs -muge \
-mtp --draft-max 4 --draft-p-min 0.70 \
--graph-reduce-type f16 \
--cache-ram 16384 \
--cache-ram-similarity 0.85 \
--cache-ram-n-min 2048 \
--parallel-tool-calls \
--recurrent-ckpt-mode per-step \
--image-min-tokens 1024 \
--mtmd-kq-type f16 \
--alias Qwen3.6-27b \
--jinja
If I may add, I also developed a proxy to enable users to select thinking or non-thinking behaviors and applied the recommended sampling parameters AND the "Preserve Thinking" option. You may find it on my GitHub.
Hardware Requirements
- Target VRAM: 48 GB (Tested on 2x NVIDIA RTX 3090 24GB).
- RAM: Minimum 32GB system RAM (Prompt caching and system overhead).
- Context limit: The command above loads ~13GB of KV cache across the two GPUs. If you experience OOM (Out of Memory) errors, consider reducing
--ctx-sizeor using 8-bit cache (--cache-type-k q8_0 --cache-type-v q8_0).
Acknowledgments
This project was made possible thanks to the outstanding tools and contributions from the open-source AI community. Special thanks to:
- Radamanthys11: For providing the high-quality base
Qwen3.6-27B-MTP-Q8_0-GGUFmodel used as the foundation on my original requantizations. This model was not used anymore for this new repo. - eaddario: For the extremely diverse
imatrix-calibrationdataset, which was crucial in building the custom, multilingual, and code-heavy iMatrix. - Unsloth: For identifying the formatting bugs in the original model and providing the optimized, bug-free chat template and publishing the base BF16 MTP-ready model used on this project.
- ikawrakow: For the
ik_llama.cppfork, whose advanced graph-splitting and speculative decoding capabilities made running this extreme context on dual GPUs a reality. - The Qwen Team: For researching and releasing the exceptional Qwen3.6 architecture.
- Downloads last month
- 73
6-bit
Model tree for AlexanderKyng/Qwen3.6-27B-MTP-Custom-IQ6_K
Base model
Qwen/Qwen3.6-27B