Instructions to use PiehSoft/Qwen3.6-40B-Deckard-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP 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 PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M # Run inference directly in the terminal: llama cli -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M # Run inference directly in the terminal: llama cli -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
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 PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
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 PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
Use Docker
docker model run hf.co/PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PiehSoft/Qwen3.6-40B-Deckard-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": "PiehSoft/Qwen3.6-40B-Deckard-MTP", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
- Ollama
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with Ollama:
ollama run hf.co/PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
- Unsloth Studio
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP 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 PiehSoft/Qwen3.6-40B-Deckard-MTP 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 PiehSoft/Qwen3.6-40B-Deckard-MTP to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for PiehSoft/Qwen3.6-40B-Deckard-MTP to start chatting
- Pi
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
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": "PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
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 "PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M" \ --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 PiehSoft/Qwen3.6-40B-Deckard-MTP with Docker Model Runner:
docker model run hf.co/PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
- Lemonade
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.6-40B-Deckard-MTP-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use PiehSoft/Qwen3.6-40B-Deckard-MTP with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
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 PiehSoft/Qwen3.6-40B-Deckard-MTP:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Single-needle retrieval holds to 1M tokens (3.85x YaRN) + the llama.cpp context-cap workaround.
Long-Context Retrieval: Single-Needle Recall Holds to 1M Tokens (3.85x YaRN)
Model: PiehSoft/Qwen3.6-40B-Deckard-MTP (the MTP-grafted variant)
Base merge: DavidAU/Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking-NEO-CODE-Di-IMatrix-MAX-GGUF
Hardware: Single NVIDIA RTX PRO 6000 Blackwell (96GB)
Runtime: llama.cpp (build 9352 / b4c0549a4), native sm_120a CUDA kernels
TL;DR
This model retrieves a single planted fact ("needle") cleanly from contexts up to
1,010,000 tokens using YaRN extension (3.85x over the 262,144 native window), at
100% pass rate across every needle depth tested, on a single workstation GPU.
There is a llama.cpp server bug that caps context to the training length regardless of
YaRN settings; the workaround is documented below.
This is a single-needle retrieval result. It demonstrates recall, not multi-hop
reasoning at length. See the Scope section before drawing broader conclusions.
Results
Needle-in-a-haystack (NIAH): a coherent filler text is built to a target token length,
an out-of-distribution fact is planted at a given depth, and the model is asked to recall
it. Pass = exact match of the planted value. Token-accurate haystack sizing via the real
Qwen tokenizer.
Config: Q6_K, q8 keys / q4 values KV cache, ubatch 2048, FlashAttention on.
length 0% 25% 50% 75% 100% extension factor
131072 PASS PASS PASS PASS PASS native
262144 PASS PASS PASS PASS PASS native
393216 PASS - PASS - PASS 1.5x YaRN
524288 - - PASS - - 2x YaRN
1010000 PASS PASS PASS PASS PASS 3.85x YaRN
(- = not run, not a failure. The 393K/512K rows were probes; native and 1M are full
depth sweeps.)
Native 262K is perfect across all depths. Extension via YaRN holds clean with no
lost-in-the-middle degradation at any tested length, including the full 1M sweep.
VRAM
Single instance at 1M context loads at ~90GB with q8 keys / q4 values, leaving
headroom on the 96GB card. (An earlier 73GB reading that suggested tighter limits turned
out to be two model instances running simultaneously; single-instance footprint is lower
than that scare implied, but the q4 value cache is doing real work to keep 1M under the
ceiling. Full q8 KV at 1M would not fit.)
Prefill speed at length
Prefill (prompt processing) decays with context as expected from the attention term, but
gracefully:
context prefill tok/s (approx, cold)
~12K ~2590
~32K ~2190
~131K ~1410
~262K ~1090
~512K ~700
~1M ~390
A full 1M prefill takes roughly 34 minutes on this hardware. This is a one-time entry
cost to reach high context, not a per-token tax once the context is loaded.
The llama.cpp context-cap workaround
llama.cpp's server caps n_ctx to the model's declared training context regardless of
your YaRN flags. Symptom in the startup log:
n_ctx_seq (524288) > n_ctx_train (262144) -- possible training context overflow
the slot context (524288) exceeds the training context of the model (262144) - capping
new slot, n_ctx = 262144
This is a known issue (ggml-org/llama.cpp#22140).
Bare --rope-scaling yarn flags do not defeat it, and this GGUF ships with norope.scaling metadata baked in (architecture prefix is qwen35), so the CLI flags alone
get clamped.
The fix is to override the declared training context so the cap check passes:
--override-kv qwen35.context_length=int:1010000 \
--rope-scaling yarn \
--rope-scale 3.85 \
--yarn-orig-ctx 262144 \
-c 1010000 \
--cache-type-k q8_0 --cache-type-v q4_0 \
--ctx-checkpoints 0
Notes:
--override-kv qwen35.context_length=int:1010000raises the declared training context.
Set it to your maximum target once; control the actual context with-c.--rope-scaleis target / native. For 512K that's2.0; for 1M,1010000 / 262144 = 3.85.--ctx-checkpoints 0is for clean one-shot benchmarking only. For interactive use,
leave checkpoints on so multi-turn sessions reuse cache.- A correct launch shows
new slot, n_ctx = 1010000and a "full capacity will not be
utilized" note instead of the "capping" line.
A second gotcha for anyone scripting NIAH against the server: a 1M prefill exceeds the
OpenAI client's default ~600s read timeout, which silently cancels the request mid-prefill.
Set an explicit infinite read timeout on the client (httpx.Timeout(read=None)).
Scope and honest caveats
This result is deliberately narrow. What it shows and does not show:
- Single-needle, not multi-hop. This proves the model can retrieve one planted fact
at extreme length. It does not show it can reason across multiple facts at length,
which is what real long-context work (e.g. codebase reasoning) requires. Multi-needle
and multi-hop at extension are the next tests. - trials=1 per cell. 5/5 PASS across depths is a strong signal, but it is "did not
fail once," not a statistical reliability claim. Paper-grade would want trials=3-5. - q8 keys / q4 values, not full q8 KV. Results are valid for that cache config, which
is how you'd realistically run 1M on this card anyway.
Why it extends this well (hypothesis)
Qwen3.6 is a hybrid: gated linear-attention / SSM layers with full attention only every
4th layer. YaRN only acts on the RoPE'd full-attention layers, so there are far fewer
layers to degrade under positional extension than in a pure-attention model. The same
property keeps the KV cache cheap as context grows (most layers don't carry a per-token
KV cost), which is why 1M fits in ~90GB. The architecture appears to be doing the heavy
lifting on both the retrieval-stability and the memory-footprint fronts.
Reproduce
The NIAH harness used to produce this grid is in the repo underbenchmarks/niah_smoke.py. It builds
token-accurate haystacks, plants randomized out-of-distribution needles, and scores exact
recall across a length x depth grid. See the script header for usage.
Spec-decode tuning for this model (combined ngram + MTP, and why n_max 2 beats n_max 3
on this graft) is written up inbenchmarks/SPEC_DECODE_TUNING.md,
with its harness at benchmarks/decode_speed.py.
Single-needle, not multi-hop. This proves the model can retrieve one planted fact
at extreme length. It does not show it can reason across multiple facts at length,
Agreed. This model is very unlikely to maintain logical coherency past ~300k. I even struggle to get MiniMax M3 to hold together one braincell past 300k, and that was trained on a native 1m window.