GGUF
rocmfp4
qwen3.6
mtp
speculative-decoding
efficient-thinking
strix-halo
amd
rocm
vulkan
conversational
Instructions to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF", filename="ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF 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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16 # Run inference directly in the terminal: llama cli -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16 # Run inference directly in the terminal: llama cli -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16 # Run inference directly in the terminal: ./llama-cli -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
Use Docker
docker model run hf.co/plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
- LM Studio
- Jan
- Ollama
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with Ollama:
ollama run hf.co/plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
- Unsloth Studio
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF 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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF 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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF to start chatting
- Pi
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
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": "plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
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 "plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16" \ --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 plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with Docker Model Runner:
docker model run hf.co/plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
- Lemonade
How to use plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull plunderstruck/ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF:BF16
Run and chat with the model
lemonade run user.ThinkingCap-Qwen3.6-27B-MTP-ROCmFP4-GGUF-BF16
List all available models
lemonade list
Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- README.md +269 -0
- ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf +3 -0
- chat_template.jinja +287 -0
- mmproj-F32.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
mmproj-F32.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: bottlecapai/ThinkingCap-Qwen3.6-27B
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
library_name: gguf
|
| 5 |
+
tags:
|
| 6 |
+
- gguf
|
| 7 |
+
- rocmfp4
|
| 8 |
+
- qwen3.6
|
| 9 |
+
- mtp
|
| 10 |
+
- speculative-decoding
|
| 11 |
+
- efficient-thinking
|
| 12 |
+
- strix-halo
|
| 13 |
+
- amd
|
| 14 |
+
- rocm
|
| 15 |
+
- vulkan
|
| 16 |
+
base_model_relation: quantized
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
<div style="border:2px solid currentColor; font-family:ui-monospace,'SF Mono','Cascadia Mono',Consolas,'Liberation Mono',monospace;">
|
| 20 |
+
<div style="border-bottom:1px solid currentColor; padding:6px 12px; font-size:11px; letter-spacing:3px; text-transform:uppercase; opacity:0.7; text-align:center;">PLUNDERSTRUCK // ROCmFP4 QUANTIZED MODEL // STRIX HALO · gfx1151</div>
|
| 21 |
+
<div style="padding:14px; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:18px;">
|
| 22 |
+
<pre style="margin:0; flex:0 0 auto; font-family:ui-monospace,'SF Mono','Cascadia Mono',Consolas,monospace; font-size:6px; line-height:1.1; letter-spacing:0;">
|
| 23 |
+
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
| 24 |
+
▟███████████████████████▙
|
| 25 |
+
▄▟█████████████████████████████▙▄
|
| 26 |
+
▟███████████████████████████████████▙
|
| 27 |
+
▐███████████████▛▀▀▀▀▀▜███████████████▌
|
| 28 |
+
▝████████████████ ████████████▛▘
|
| 29 |
+
▐████▛▘ ▝▜████▌
|
| 30 |
+
▐█▌ ▟▙ ▐█▌
|
| 31 |
+
▐█▌ ▟███▙ ▐█▌
|
| 32 |
+
▀▀ ▟█████▙ ▀▀
|
| 33 |
+
▟███████▙
|
| 34 |
+
</pre>
|
| 35 |
+
<div style="flex:0 1 auto; max-width:100%; text-align:center;">
|
| 36 |
+
<div style="font-size:23px; font-weight:800; letter-spacing:1px;">THINKINGCAP-QWEN3.6-27B-MTP</div>
|
| 37 |
+
<div style="font-size:12.5px; letter-spacing:1px; opacity:0.8; margin-top:5px;"><span style="white-space:nowrap;">4-BIT ROCmFP4</span> · <span style="white-space:nowrap;">EFFICIENT-THINKING</span> · <span style="white-space:nowrap;">MTP SELF-SPECULATIVE DECODE</span> · <span style="white-space:nowrap;">VISION-CAPABLE</span> · <span style="white-space:nowrap;">SINGLE AMD APU</span></div>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
<table style="display:table; table-layout:fixed; width:100%; margin:0; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px;">
|
| 41 |
+
<tr>
|
| 42 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">FORMAT</div><div style="font-weight:700;">ROCmFP4 4-BIT</div></td>
|
| 43 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">PRECISION</div><div style="font-weight:700;">4.94 BPW</div></td>
|
| 44 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">SIZE</div><div style="font-weight:700;">16.9 GB</div></td>
|
| 45 |
+
<td style="border-top:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">CONTEXT</div><div style="font-weight:700;">262 K</div></td>
|
| 46 |
+
</tr>
|
| 47 |
+
<tr>
|
| 48 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">DRAFT</div><div style="font-weight:700;">MTP n-max 5</div></td>
|
| 49 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">VISION</div><div style="font-weight:700;">QWEN3-VL</div></td>
|
| 50 |
+
<td style="border-top:1px solid currentColor; border-right:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">BACKEND</div><div style="font-weight:700;">VULKAN0</div></td>
|
| 51 |
+
<td style="border-top:1px solid currentColor; padding:8px 12px;"><div style="font-size:10px; letter-spacing:1px; opacity:0.6;">CALIBRATION</div><div style="font-weight:700;">non-imatrix</div></td>
|
| 52 |
+
</tr>
|
| 53 |
+
</table>
|
| 54 |
+
</div>
|
| 55 |
+
|
| 56 |
+
<div style="border:1px solid currentColor; padding:10px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px; margin:14px 0;">
|
| 57 |
+
<b>ThinkingCap-Qwen3.6-27B</b> is <a href="https://huggingface.co/bottlecapai">bottlecapai</a>'s efficient-reasoning finetune of <b>Qwen3.6-27B</b> — trained to cut thinking-token consumption roughly in half (<b>↓45.8%</b> macro average) while holding answer quality, across knowledge, math, code, long-context, and agentic tasks. It scores <b>GPQA-Diamond 83.8</b>, <b>MMLU-Pro 85.4</b>, <b>GSM8K 96.5</b> (bottlecapai reported). This repo is the <b>ROCmFP4</b> quantization tuned for a single AMD Strix Halo APU, with the <b>MTP head preserved</b> for self-speculative decode and vision carried through from the base model.
|
| 58 |
+
</div>
|
| 59 |
+
|
| 60 |
+
<div style="border:2px solid #dc2626; padding:10px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px; margin:14px 0;">
|
| 61 |
+
<b style="color:#dc2626; letter-spacing:1px;">⚠ REQUIRES THE ROCmFPX FORK</b><br>
|
| 62 |
+
The custom <code>q4_0_rocmfp4</code> / <code>q4_0_rocmfp4_fast</code> tensor types <b>will not load in stock llama.cpp, LM Studio, Ollama, Jan, or koboldcpp</b>. Build/run with <a href="https://github.com/charlie12345/ROCmFPX">charlie12345/ROCmFPX</a> · branch <code>experimental-rocmfpx-branch</code>:
|
| 63 |
+
<br><br>
|
| 64 |
+
<code>git clone https://github.com/charlie12345/ROCmFPX</code><br>
|
| 65 |
+
<code>cd ROCmFPX && git checkout experimental-rocmfpx-branch</code><br>
|
| 66 |
+
<code>env JOBS=16 scripts/build-strix-rocmfp4-mtp.sh</code>
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
<div style="border:1px solid currentColor; padding:8px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px; margin:14px 0; opacity:0.85;">
|
| 70 |
+
<b>NOTE //</b> Ignore HuggingFace's auto-detected "F16" badge — its parser can't read ROCmFP4 and mislabels by the genuinely-f16 token embeddings. This is a <b>~4.9 bpw 4-bit</b> file; pick by filename in <i>Files and versions</i>.
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">01</span> · FILES</div>
|
| 74 |
+
|
| 75 |
+
<div style="overflow:hidden; border-radius:0;">
|
| 76 |
+
<table style="width:100%; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px;">
|
| 77 |
+
<thead><tr>
|
| 78 |
+
<th style="border:1px solid currentColor; padding:7px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px;">File</th>
|
| 79 |
+
<th style="border:1px solid currentColor; padding:7px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px;">Size</th>
|
| 80 |
+
<th style="border:1px solid currentColor; padding:7px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px;">Output head</th>
|
| 81 |
+
<th style="border:1px solid currentColor; padding:7px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px;">Pick if</th>
|
| 82 |
+
</tr></thead>
|
| 83 |
+
<tbody>
|
| 84 |
+
<tr><td style="border:1px solid currentColor; padding:7px 10px;"><code>…-STRIX-embF16-headQ6.gguf</code> ★</td><td style="border:1px solid currentColor; padding:7px 10px;">16.9 GB</td><td style="border:1px solid currentColor; padding:7px 10px;">Q6_K</td><td style="border:1px solid currentColor; padding:7px 10px;"><b>the one build</b> — best speed/quality balance: f16 embeddings + Q6 output head on the fast single-scale body</td></tr>
|
| 85 |
+
</tbody>
|
| 86 |
+
</table>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
One file — the **best speed/quality balance** in ROCmFP4 for Strix Halo. It keeps the two quality levers that are actually *felt* — genuine **f16 token embeddings** (from F16 source) and a **Q6_K output head** — on the fast single-scale `q4_0_rocmfp4_fast` body, plus the **MTP head**, with **no imatrix** (this recipe's daily-driver default; see §05). Repo bundles the **[`mmproj-F32.gguf`](./mmproj-F32.gguf)** Qwen3-VL vision projector and **[`chat_template.jinja`](./chat_template.jinja)** (froggeric's unified Qwen3.6 template — tool calls + inline think-toggle + vision).
|
| 90 |
+
|
| 91 |
+
<div style="overflow:hidden; border-radius:0;">
|
| 92 |
+
<table style="width:100%; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px;">
|
| 93 |
+
<tbody>
|
| 94 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px; width:42%;">token_embd</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;">F16 (full precision — a lookup, ~zero decode cost)</td></tr>
|
| 95 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">attention K/V (+ fused QKV)</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;"><code>q4_0_rocmfp4</code> (dual-scale)</td></tr>
|
| 96 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">FFN, lm-head, rest</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;"><code>q4_0_rocmfp4_fast</code> (single-scale)</td></tr>
|
| 97 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">MTP head</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;">preserved (<code>nextn_predict_layers=1</code>)</td></tr>
|
| 98 |
+
</tbody>
|
| 99 |
+
</table>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">02</span> · QUICK START</div>
|
| 103 |
+
|
| 104 |
+
Run from the folder holding the `.gguf` + `chat_template.jinja`:
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
env HSA_OVERRIDE_GFX_VERSION=11.5.1 GGML_HIP_ENABLE_UNIFIED_MEMORY=1 \
|
| 108 |
+
llama-server \
|
| 109 |
+
-m ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf \
|
| 110 |
+
--alias thinkingcap-27b \
|
| 111 |
+
--host 0.0.0.0 \
|
| 112 |
+
--port 8080 \
|
| 113 |
+
-dev Vulkan0 \
|
| 114 |
+
-ngl 999 \
|
| 115 |
+
-fa on \
|
| 116 |
+
-c 262144 \
|
| 117 |
+
-b 2048 \
|
| 118 |
+
-ub 256 \
|
| 119 |
+
-t 16 \
|
| 120 |
+
-tb 16 \
|
| 121 |
+
-ctk f16 \
|
| 122 |
+
-ctv f16 \
|
| 123 |
+
-cpent 256 \
|
| 124 |
+
-ctxcp 32 \
|
| 125 |
+
--cache-reuse 256 \
|
| 126 |
+
--cache-ram 65536 \
|
| 127 |
+
--temp 0.6 \
|
| 128 |
+
--top-p 0.95 \
|
| 129 |
+
--top-k 20 \
|
| 130 |
+
--min-p 0.0 \
|
| 131 |
+
--spec-type draft-mtp \
|
| 132 |
+
--spec-draft-device Vulkan0 \
|
| 133 |
+
--spec-draft-ngl all \
|
| 134 |
+
--spec-draft-type-k f16 \
|
| 135 |
+
--spec-draft-type-v f16 \
|
| 136 |
+
--spec-draft-n-max 5 \
|
| 137 |
+
--spec-draft-n-min 2 \
|
| 138 |
+
--spec-draft-p-min 0.0 \
|
| 139 |
+
--spec-draft-p-split 0.10 \
|
| 140 |
+
--chat-template-file chat_template.jinja \
|
| 141 |
+
--reasoning on \
|
| 142 |
+
--reasoning-format deepseek \
|
| 143 |
+
--chat-template-kwargs '{"preserve_thinking": true}' \
|
| 144 |
+
--jinja \
|
| 145 |
+
--parallel 1 \
|
| 146 |
+
--metrics \
|
| 147 |
+
--no-mmap \
|
| 148 |
+
--mmproj mmproj-F32.gguf \
|
| 149 |
+
--image-min-tokens 1024
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
The **last two lines enable vision** — the `mmproj-F32.gguf` Qwen3-VL projector is **bundled in this repo**; omit them for text-only. **`--image-min-tokens 1024` is required whenever `--mmproj` is set.**
|
| 153 |
+
|
| 154 |
+
<div style="border:1px solid currentColor; padding:8px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px; margin:12px 0; opacity:0.85;">
|
| 155 |
+
<b>NOTE //</b> bottlecapai's own recommended sampling for general use is <code>temp=1.0, top_p=0.95, top_k=20, min_p=0.0</code>. We serve at <code>temp 0.6</code> (Qwen3.6 "precise coding" preset) by default — raise to <code>1.0</code> for open-ended/creative tasks.
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<div style="overflow:hidden; border-radius:0;">
|
| 159 |
+
<table style="width:100%; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px;">
|
| 160 |
+
<thead><tr>
|
| 161 |
+
<th style="border:1px solid currentColor; padding:6px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px; width:40%;">Flag</th>
|
| 162 |
+
<th style="border:1px solid currentColor; padding:6px 10px; text-align:left; text-transform:uppercase; font-size:10px; letter-spacing:1px;">Function</th>
|
| 163 |
+
</tr></thead>
|
| 164 |
+
<tbody>
|
| 165 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>HSA_OVERRIDE_GFX_VERSION=11.5.1</code></td><td style="border:1px solid currentColor; padding:6px 10px;">treat the APU as gfx1151 (Strix Halo)</td></tr>
|
| 166 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>GGML_HIP_ENABLE_UNIFIED_MEMORY=1</code></td><td style="border:1px solid currentColor; padding:6px 10px;">allow use of the full 128 GB unified memory</td></tr>
|
| 167 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-dev Vulkan0</code></td><td style="border:1px solid currentColor; padding:6px 10px;">run on Vulkan (KHR_coopmat) — beats ROCm/HIP here for ROCmFP4 on Strix Halo</td></tr>
|
| 168 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-ngl 999 · -fa on</code></td><td style="border:1px solid currentColor; padding:6px 10px;">offload all layers · flash attention</td></tr>
|
| 169 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-c 262144</code></td><td style="border:1px solid currentColor; padding:6px 10px;">context length (256K)</td></tr>
|
| 170 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-b 2048 · -ub 256 · -t/-tb 16</code></td><td style="border:1px solid currentColor; padding:6px 10px;">prefill batch / micro-batch (256 = prefill optimum) · CPU threads</td></tr>
|
| 171 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-ctk f16 · -ctv f16</code></td><td style="border:1px solid currentColor; padding:6px 10px;">f16 KV cache — how we run it; drop to <code>q8_0</code>/<code>q4_0</code> to use less memory</td></tr>
|
| 172 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>-cpent · -ctxcp · --cache-reuse · --cache-ram 65536</code></td><td style="border:1px solid currentColor; padding:6px 10px;">cross-turn KV checkpointing + 64 GB resident reuse cache</td></tr>
|
| 173 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.0</code></td><td style="border:1px solid currentColor; padding:6px 10px;">precise-coding sampling (bottlecapai recommends 1.0 for general use)</td></tr>
|
| 174 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--spec-type draft-mtp · --spec-draft-n-max 5 · n-min 2</code></td><td style="border:1px solid currentColor; padding:6px 10px;">built-in MTP head, self-speculative; draft depth up to 5, at least 2</td></tr>
|
| 175 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--spec-draft-device Vulkan0 · -ngl all · type-k/v f16</code></td><td style="border:1px solid currentColor; padding:6px 10px;">draft head on Vulkan, fully offloaded, f16 draft KV</td></tr>
|
| 176 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--chat-template-file chat_template.jinja</code></td><td style="border:1px solid currentColor; padding:6px 10px;">bundled froggeric template (tool calls + think-toggle + vision)</td></tr>
|
| 177 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--reasoning on --reasoning-format deepseek + kwargs {preserve_thinking:true}</code></td><td style="border:1px solid currentColor; padding:6px 10px;">clean <code>content</code>+<code>reasoning_content</code>; keep <code><think></code> across turns so cross-turn cache survives</td></tr>
|
| 178 |
+
<tr><td style="border:1px solid currentColor; padding:6px 10px;"><code>--jinja --parallel 1 --metrics --no-mmap</code></td><td style="border:1px solid currentColor; padding:6px 10px;">apply template · single slot · metrics · weights in RAM</td></tr>
|
| 179 |
+
</tbody>
|
| 180 |
+
</table>
|
| 181 |
+
</div>
|
| 182 |
+
|
| 183 |
+
**OpenAI-compatible client (e.g. OpenCode).** In single-model mode llama-server ignores the request's `model` field, so the client's model name is just a label.
|
| 184 |
+
|
| 185 |
+
- Base URL: `http://<host>:8080/v1` · API key: any non-empty string (e.g. `sk-local`)
|
| 186 |
+
- Model id this server reports: `thinkingcap-27b`
|
| 187 |
+
|
| 188 |
+
A patched OpenCode that compacts conversation history **without** invalidating the prompt cache is at [`PlunderStruck/opencode`](https://github.com/PlunderStruck/opencode) — pair it with the checkpoint flags to keep long sessions fast.
|
| 189 |
+
|
| 190 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">03</span> · VISION</div>
|
| 191 |
+
|
| 192 |
+
Qwen3-VL lineage — vision works via the **bundled `mmproj-F32.gguf`** projector at launch with `--mmproj` (no different LLM GGUF needed).
|
| 193 |
+
|
| 194 |
+
```bash
|
| 195 |
+
# add to your llama-server launch:
|
| 196 |
+
--mmproj mmproj-F32.gguf \
|
| 197 |
+
--image-min-tokens 1024 # REQUIRED — Qwen-VL needs >=1024 image tokens or it misreads fine detail
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
<div style="border:1px solid currentColor; padding:8px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px; margin:12px 0; opacity:0.85;">
|
| 201 |
+
<b>NOTE //</b> this is a thinking model — for one-shot image Q&A, use the bundled template's think-toggle or allow enough tokens to finish <code><think></code>, else the visible answer can come back empty. With <code>--mmproj</code> loaded the server disables the <code>--cache-reuse</code> feature (multimodal caching isn't supported).
|
| 202 |
+
</div>
|
| 203 |
+
|
| 204 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">04</span> · PERFORMANCE & QUALITY</div>
|
| 205 |
+
|
| 206 |
+
**This is the best speed/quality balance in ROCmFP4 — by design, not the absolute fastest.** It keeps the two quality levers that are actually *felt* — genuine **f16 token embeddings** and a **Q6_K output head** — on the fast single-scale body, with **no imatrix** calibration (this recipe's default for the dense Qwen3.6-27B line — see the [27B card](https://huggingface.co/plunderstruck/Qwen3.6-27B-MTP-ROCmFP4-GGUF) for the full lever sweep and rationale).
|
| 207 |
+
|
| 208 |
+
<div style="border:1px solid currentColor; padding:8px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px; margin:12px 0; opacity:0.9;">
|
| 209 |
+
<b>WANT MAXIMUM FIDELITY INSTEAD OF SPEED?</b> bottlecapai's own GGUF repo ships standard K-quants — <a href="https://huggingface.co/bottlecapai/ThinkingCap-Qwen3.6-27B-GGUF"><b>Q4_K_M / Q8_0</b></a> — more faithful to the source at a slower decode. We optimize for throughput in ROCmFP4 on Strix Halo; grab one of those for the last bit of fidelity.
|
| 210 |
+
</div>
|
| 211 |
+
|
| 212 |
+
Hands-on, on a Framework Desktop / AMD Ryzen AI Max+ 395 (gfx1151, 128 GB unified):
|
| 213 |
+
|
| 214 |
+
<div style="overflow:hidden; border-radius:0;">
|
| 215 |
+
<table style="width:100%; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px;">
|
| 216 |
+
<tbody>
|
| 217 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px; width:42%;">DECODE</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;">~30 t/s (Vulkan / Strix Halo, thinking on)</td></tr>
|
| 218 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">MTP DRAFT ACCEPTANCE</td><td style="border:1px solid currentColor; padding:8px 11px; font-weight:700;">~4.15 mean accepted length (n-max 5 / n-min 2)</td></tr>
|
| 219 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">CONTEXT @ LOAD</td><td style="border:1px solid currentColor; padding:8px 11px;">full 262144, f16 KV</td></tr>
|
| 220 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">QUANTIZATION</td><td style="border:1px solid currentColor; padding:8px 11px;">non-imatrix</td></tr>
|
| 221 |
+
</tbody>
|
| 222 |
+
</table>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div style="border:1px solid currentColor; padding:8px 13px; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12px; margin:12px 0; opacity:0.85;">
|
| 226 |
+
<b>NOTE //</b> built on a fork snapshot carrying an upstream fix for a self-speculative-decode bug affecting M-RoPE architectures (Qwen3.6 included) — MTP was silently degrading to plain decode under certain batch shapes on some builds. This quant's measured acceptance (~4.15) reflects the fixed path; older ROCmFPX builds may show materially lower MTP throughput on this model family.
|
| 227 |
+
</div>
|
| 228 |
+
|
| 229 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">05</span> · BUILD (REPRODUCIBLE)</div>
|
| 230 |
+
|
| 231 |
+
Build the fork:
|
| 232 |
+
|
| 233 |
+
```bash
|
| 234 |
+
git clone https://github.com/charlie12345/ROCmFPX
|
| 235 |
+
cd ROCmFPX && git checkout experimental-rocmfpx-branch
|
| 236 |
+
env JOBS=16 scripts/build-strix-rocmfp4-mtp.sh
|
| 237 |
+
```
|
| 238 |
+
|
| 239 |
+
Quantize from the bottlecapai F16 GGUF — ROCmFP4 body, genuine f16 embeddings, Q6_K head, no imatrix:
|
| 240 |
+
|
| 241 |
+
```bash
|
| 242 |
+
# the one build: STRIX preset + f16 embeddings + Q6_K output head
|
| 243 |
+
llama-quantize \
|
| 244 |
+
--token-embedding-type f16 \
|
| 245 |
+
--output-tensor-type q6_K \
|
| 246 |
+
ThinkingCap-Qwen3.6-27B-f16.gguf \
|
| 247 |
+
ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf \
|
| 248 |
+
Q4_0_ROCMFP4_STRIX
|
| 249 |
+
```
|
| 250 |
+
|
| 251 |
+
**Architecture (`qwen35`):** 64 blocks, 5120 hidden, dense (not MoE), **`nextn_predict_layers=1`** MTP head — self-speculative **draft-MTP** survives quantization. **Format:** ROCmFP4 is a 4-bit weight format for AMD using an FP4-derived value codebook plus one (FAST) or two (dual) UE4M3/FP8 scale bytes per 32-weight block; tensor-aware. **This build** (`STRIX-embF16-headQ6`): quality-biased STRIX preset + f16 token embeddings (full precision; a lookup, so ~zero decode cost) + a Q6_K output head. Attention K/V (+ fused QKV) run `q4_0_rocmfp4` (dual-scale); FFN/rest run `q4_0_rocmfp4_fast` (single-scale).
|
| 252 |
+
|
| 253 |
+
> Experimental research build for AMD Strix Halo — hardware-, driver-, model-, and prompt-sensitive, may not reproduce on other GPUs. **Not** native FP4 tensor-core execution. Do not treat these numbers as upstream llama.cpp claims.
|
| 254 |
+
|
| 255 |
+
<div style="font-family:ui-monospace,'SF Mono',Consolas,monospace; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; border-bottom:2px solid currentColor; padding-bottom:5px; margin:26px 0 12px;"><span style="color:#ea580c;">06</span> · LINEAGE & CREDITS</div>
|
| 256 |
+
|
| 257 |
+
<div style="overflow:hidden; border-radius:0;">
|
| 258 |
+
<table style="width:100%; border-collapse:collapse; border-radius:0; font-family:ui-monospace,'SF Mono',Consolas,monospace; font-size:12.5px;">
|
| 259 |
+
<tbody>
|
| 260 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px; width:26%;">BASE MODEL</td><td style="border:1px solid currentColor; padding:8px 11px;"><a href="https://huggingface.co/bottlecapai/ThinkingCap-Qwen3.6-27B">bottlecapai/ThinkingCap-Qwen3.6-27B</a> — efficient-thinking finetune of <a href="https://huggingface.co/Qwen/Qwen3.6-27B">Qwen/Qwen3.6-27B</a> (Apache 2.0). This is a derivative quantization that inherits the Apache 2.0 license.</td></tr>
|
| 261 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">F16 GGUF SOURCE</td><td style="border:1px solid currentColor; padding:8px 11px;"><a href="https://huggingface.co/bottlecapai/ThinkingCap-Qwen3.6-27B-GGUF">bottlecapai/ThinkingCap-Qwen3.6-27B-GGUF</a> · <code>ThinkingCap-Qwen3.6-27B-f16.gguf</code></td></tr>
|
| 262 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">FORMAT + RUNTIME</td><td style="border:1px solid currentColor; padding:8px 11px;"><a href="https://github.com/charlie12345/ROCmFPX">charlie12345/ROCmFPX</a> (based on llama.cpp, MIT)</td></tr>
|
| 263 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">CHAT TEMPLATE</td><td style="border:1px solid currentColor; padding:8px 11px;"><a href="https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates">froggeric/Qwen-Fixed-Chat-Templates</a></td></tr>
|
| 264 |
+
<tr><td style="border:1px solid currentColor; padding:8px 11px;">BENCHMARKS (BASE)</td><td style="border:1px solid currentColor; padding:8px 11px;">GPQA-Diamond 83.8±1.9 · MMLU-Pro 85.4±0.2 · GSM8K 96.5±0.3 · thinking-token reduction ↓45.8% macro avg (bottlecapai reported)</td></tr>
|
| 265 |
+
</tbody>
|
| 266 |
+
</table>
|
| 267 |
+
</div>
|
| 268 |
+
|
| 269 |
+
*Derivative quantization — Apache 2.0, same as the base model.*
|
ThinkingCap-Qwen3.6-27B-ROCmFP4-STRIX-embF16-headQ6.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac375e5bb2161e6b49b41e4a2edddcc5c99a5390331f9dd421061100c6900a09
|
| 3 |
+
size 16881328096
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set template_version = "qwen3.6-froggeric-v20" %}
|
| 2 |
+
{%- set image_count = namespace(value=0) %}
|
| 3 |
+
{%- set video_count = namespace(value=0) %}
|
| 4 |
+
{%- set add_vision_id = add_vision_id if add_vision_id is defined else false %}
|
| 5 |
+
{%- set enable_thinking = enable_thinking if enable_thinking is defined else true %}
|
| 6 |
+
{%- set auto_disable_thinking_with_tools = auto_disable_thinking_with_tools if auto_disable_thinking_with_tools is defined else false %}
|
| 7 |
+
{%- set _preserve_thinking = preserve_thinking if preserve_thinking is defined else false %}
|
| 8 |
+
{%- set max_tool_arg_chars = max_tool_arg_chars if max_tool_arg_chars is defined else 0 %}
|
| 9 |
+
{%- set max_tool_response_chars = max_tool_response_chars if max_tool_response_chars is defined else 0 %}
|
| 10 |
+
{%- set _has_tools = (tools is defined and tools and tools is iterable and tools is not mapping) %}
|
| 11 |
+
{%- set ns_state = namespace(thinking=enable_thinking) %}
|
| 12 |
+
{%- if auto_disable_thinking_with_tools and _has_tools %}
|
| 13 |
+
{%- set ns_state.thinking = false %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 16 |
+
{%- if content is string %}
|
| 17 |
+
{{- content }}
|
| 18 |
+
{%- elif content is iterable and content is not mapping %}
|
| 19 |
+
{%- for item in content %}
|
| 20 |
+
{%- if item is mapping %}
|
| 21 |
+
{%- if item.type == 'image' or 'image' in item or 'image_url' in item %}
|
| 22 |
+
{%- if is_system_content %}
|
| 23 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 24 |
+
{%- endif %}
|
| 25 |
+
{%- if do_vision_count %}
|
| 26 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 27 |
+
{%- endif %}
|
| 28 |
+
{%- if add_vision_id %}
|
| 29 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 32 |
+
{%- elif item.type == 'video' or 'video' in item %}
|
| 33 |
+
{%- if is_system_content %}
|
| 34 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 35 |
+
{%- endif %}
|
| 36 |
+
{%- if do_vision_count %}
|
| 37 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 38 |
+
{%- endif %}
|
| 39 |
+
{%- if add_vision_id %}
|
| 40 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 43 |
+
{%- elif 'text' in item %}
|
| 44 |
+
{{- item.text }}
|
| 45 |
+
{%- else %}
|
| 46 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- else %}
|
| 49 |
+
{{- item | string }}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{%- elif content is none or content is undefined %}
|
| 53 |
+
{{- '' }}
|
| 54 |
+
{%- else %}
|
| 55 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- endmacro %}
|
| 58 |
+
{%- if not messages %}
|
| 59 |
+
{{- raise_exception('No messages provided.') }}
|
| 60 |
+
{%- endif %}
|
| 61 |
+
{%- set _first_role = messages[0].role %}
|
| 62 |
+
{%- if _first_role == 'system' or _first_role == 'developer' %}
|
| 63 |
+
{%- set _sys_msg = messages[0] %}
|
| 64 |
+
{%- set _msgs = messages[1:] %}
|
| 65 |
+
{%- else %}
|
| 66 |
+
{%- set _sys_msg = none %}
|
| 67 |
+
{%- set _msgs = messages %}
|
| 68 |
+
{%- endif %}
|
| 69 |
+
{%- set _sc = '' %}
|
| 70 |
+
{%- if _sys_msg is not none %}
|
| 71 |
+
{%- set _sc = render_content(_sys_msg.content, false, true) | trim %}
|
| 72 |
+
{%- if '<|think_off|>' in _sc %}
|
| 73 |
+
{%- set ns_state.thinking = false %}
|
| 74 |
+
{%- set _sc = _sc.split('<|think_off|>') | join('') | trim %}
|
| 75 |
+
{%- elif '<|think_on|>' in _sc %}
|
| 76 |
+
{%- set ns_state.thinking = true %}
|
| 77 |
+
{%- set _sc = _sc.split('<|think_on|>') | join('') | trim %}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
{%- endif %}
|
| 80 |
+
{%- if _has_tools %}
|
| 81 |
+
{{- '<|im_start|>system\n' }}
|
| 82 |
+
{{- '# Tools\n\nYou have access to the following functions:\n\n<tools>' }}
|
| 83 |
+
{%- for tool in tools %}
|
| 84 |
+
{{- '\n' }}
|
| 85 |
+
{{- tool | tojson }}
|
| 86 |
+
{%- endfor %}
|
| 87 |
+
{{- '\n</tools>' }}
|
| 88 |
+
{%- set tool_instructions %}
|
| 89 |
+
If you choose to call a function ONLY reply in the following format with NO suffix:
|
| 90 |
+
|
| 91 |
+
<think>
|
| 92 |
+
Brief explanation of tool call
|
| 93 |
+
</think>
|
| 94 |
+
<tool_call>
|
| 95 |
+
<function=example_function_name>
|
| 96 |
+
<parameter=example_parameter_1>
|
| 97 |
+
value_1
|
| 98 |
+
</parameter>
|
| 99 |
+
<parameter=example_parameter_2>
|
| 100 |
+
This is the value for the second parameter
|
| 101 |
+
that can span
|
| 102 |
+
multiple lines
|
| 103 |
+
</parameter>
|
| 104 |
+
</function>
|
| 105 |
+
</tool_call>
|
| 106 |
+
|
| 107 |
+
<IMPORTANT>
|
| 108 |
+
Reminder:
|
| 109 |
+
- You can use the <think></think> block to plan your next tool call OR to synthesize data and formulate your final response to the user.
|
| 110 |
+
- ALL explanation and reasoning MUST be placed strictly inside the <think></think> block.
|
| 111 |
+
- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags.
|
| 112 |
+
- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY after closing </think>. Do NOT output any conversational text before the tool call.
|
| 113 |
+
- The <tool_call> and <function> tags MUST be at the very beginning of a new line, with NO spaces or indentation before them.
|
| 114 |
+
- To call multiple functions, output a separate, completely closed <tool_call></tool_call> block for EACH function. Do NOT nest <tool_call> blocks.
|
| 115 |
+
- If you have gathered all necessary data and do not need to call a tool, answer the question like normal and provide your final response to the user IMMEDIATELY after closing </think>.
|
| 116 |
+
</IMPORTANT>
|
| 117 |
+
{%- endset %}
|
| 118 |
+
{{- '\n\n' ~ tool_instructions | trim }}
|
| 119 |
+
{%- if _sc %}
|
| 120 |
+
{{- '\n\n' + _sc }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{{- '<|im_end|>\n' }}
|
| 123 |
+
{%- else %}
|
| 124 |
+
{%- if _sc %}
|
| 125 |
+
{{- '<|im_start|>system\n' + _sc + '<|im_end|>\n' }}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{%- set _last_idx = _msgs | length - 1 %}
|
| 129 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=_last_idx) %}
|
| 130 |
+
{%- for message in _msgs[::-1] %}
|
| 131 |
+
{%- set index = (_msgs | length - 1) - loop.index0 %}
|
| 132 |
+
{%- if ns.multi_step_tool and message.role == 'user' %}
|
| 133 |
+
{%- set _rc = render_content(message.content, false) | trim %}
|
| 134 |
+
{%- if not (_rc.startswith('<tool_response>') and _rc.endswith('</tool_response>')) %}
|
| 135 |
+
{%- set ns.multi_step_tool = false %}
|
| 136 |
+
{%- set ns.last_query_index = index %}
|
| 137 |
+
{%- endif %}
|
| 138 |
+
{%- endif %}
|
| 139 |
+
{%- endfor %}
|
| 140 |
+
{%- if ns.multi_step_tool %}
|
| 141 |
+
{%- if _last_idx > 50 %}
|
| 142 |
+
{%- set ns.last_query_index = _last_idx %}
|
| 143 |
+
{%- else %}
|
| 144 |
+
{%- set ns.last_query_index = 0 %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{%- endif %}
|
| 147 |
+
{%- set ns2 = namespace(prev_role='', consecutive_failures=0) %}
|
| 148 |
+
{%- for message in _msgs %}
|
| 149 |
+
{%- set is_system = (message.role == "system" or message.role == "developer") %}
|
| 150 |
+
{%- set content = render_content(message.content, true, is_system) | trim %}
|
| 151 |
+
{%- if '<|think_off|>' in content %}
|
| 152 |
+
{%- set ns_state.thinking = false %}
|
| 153 |
+
{%- set content = content.split('<|think_off|>') | join('') | trim %}
|
| 154 |
+
{%- elif '<|think_on|>' in content %}
|
| 155 |
+
{%- set ns_state.thinking = true %}
|
| 156 |
+
{%- set content = content.split('<|think_on|>') | join('') | trim %}
|
| 157 |
+
{%- endif %}
|
| 158 |
+
{%- if is_system %}
|
| 159 |
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 160 |
+
{%- elif message.role == 'user' %}
|
| 161 |
+
{%- set ns2.consecutive_failures = 0 %}
|
| 162 |
+
{{- '<|im_start|>user\n' + content + '<|im_end|>\n' }}
|
| 163 |
+
{%- elif message.role == 'assistant' %}
|
| 164 |
+
{%- set reasoning_content = '' %}
|
| 165 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 166 |
+
{%- if message.reasoning_content is string %}
|
| 167 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 168 |
+
{%- else %}
|
| 169 |
+
{%- set reasoning_content = message.reasoning_content | string %}
|
| 170 |
+
{%- endif %}
|
| 171 |
+
{%- else %}
|
| 172 |
+
{%- set _think_end = '' %}
|
| 173 |
+
{%- if '</think>' in content %}
|
| 174 |
+
{%- set _think_end = '</think>' %}
|
| 175 |
+
{%- elif '</thinking>' in content %}
|
| 176 |
+
{%- set _think_end = '</thinking>' %}
|
| 177 |
+
{%- elif '</ think>' in content %}
|
| 178 |
+
{%- set _think_end = '</ think>' %}
|
| 179 |
+
{%- elif '</think >' in content %}
|
| 180 |
+
{%- set _think_end = '</think >' %}
|
| 181 |
+
{%- endif %}
|
| 182 |
+
{%- if _think_end %}
|
| 183 |
+
{%- if _think_end == '</thinking>' %}
|
| 184 |
+
{%- set _think_start = '<thinking>' %}
|
| 185 |
+
{%- else %}
|
| 186 |
+
{%- set _think_start = '<think>' %}
|
| 187 |
+
{%- endif %}
|
| 188 |
+
{%- set reasoning_content = content.split(_think_end)[0].rstrip('\n') %}
|
| 189 |
+
{%- if _think_start in reasoning_content %}
|
| 190 |
+
{%- set reasoning_content = reasoning_content.split(_think_start)[-1].lstrip('\n') %}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- set content = content.split(_think_end)[-1].lstrip('\n') %}
|
| 193 |
+
{%- endif %}
|
| 194 |
+
{%- endif %}
|
| 195 |
+
{%- set reasoning_content = reasoning_content | trim %}
|
| 196 |
+
{%- if (_preserve_thinking or loop.index0 > ns.last_query_index) and reasoning_content %}
|
| 197 |
+
{{- '<|im_start|>assistant\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 198 |
+
{%- else %}
|
| 199 |
+
{{- '<|im_start|>assistant\n' + content }}
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- if message.tool_calls is defined and message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 202 |
+
{%- for tool_call in message.tool_calls %}
|
| 203 |
+
{%- if tool_call.function is defined and tool_call.function is not none %}
|
| 204 |
+
{%- set tc = tool_call.function %}
|
| 205 |
+
{%- else %}
|
| 206 |
+
{%- set tc = tool_call %}
|
| 207 |
+
{%- endif %}
|
| 208 |
+
{%- if loop.first %}
|
| 209 |
+
{%- if content | trim %}
|
| 210 |
+
{{- '\n\n<tool_call>\n<function=' + tc.name + '>\n' }}
|
| 211 |
+
{%- else %}
|
| 212 |
+
{{- '<tool_call>\n<function=' + tc.name + '>\n' }}
|
| 213 |
+
{%- endif %}
|
| 214 |
+
{%- else %}
|
| 215 |
+
{{- '\n\n<tool_call>\n<function=' + tc.name + '>\n' }}
|
| 216 |
+
{%- endif %}
|
| 217 |
+
{%- if tc.arguments is defined and tc.arguments is not none %}
|
| 218 |
+
{%- if tc.arguments is mapping %}
|
| 219 |
+
{%- for args_name, args_value in tc.arguments.items() %}
|
| 220 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 221 |
+
{%- if args_value is mapping or (args_value is sequence and args_value is not string) %}
|
| 222 |
+
{%- set _av = args_value | tojson %}
|
| 223 |
+
{%- else %}
|
| 224 |
+
{%- set _av = args_value | string %}
|
| 225 |
+
{%- endif %}
|
| 226 |
+
{%- if max_tool_arg_chars > 0 and _av | length > max_tool_arg_chars %}
|
| 227 |
+
{{- _av[:max_tool_arg_chars] + '\n[TRUNCATED — original length ' ~ (_av | length | string) ~ ' chars]' }}
|
| 228 |
+
{%- else %}
|
| 229 |
+
{{- _av }}
|
| 230 |
+
{%- endif %}
|
| 231 |
+
{{- '\n</parameter>\n' }}
|
| 232 |
+
{%- endfor %}
|
| 233 |
+
{%- elif tc.arguments is string and tc.arguments %}
|
| 234 |
+
{{- tc.arguments }}
|
| 235 |
+
{%- endif %}
|
| 236 |
+
{%- endif %}
|
| 237 |
+
{%- if loop.last %}
|
| 238 |
+
{{- '</function>\n</tool_call>\n' }}
|
| 239 |
+
{%- else %}
|
| 240 |
+
{{- '</function>\n</tool_call>' }}
|
| 241 |
+
{%- endif %}
|
| 242 |
+
{%- endfor %}
|
| 243 |
+
{%- endif %}
|
| 244 |
+
{{- '<|im_end|>\n' }}
|
| 245 |
+
{%- elif message.role == 'tool' %}
|
| 246 |
+
{%- set _content_lower = content | lower %}
|
| 247 |
+
{%- if content | length < 500 and '$ ' not in content and 'took ' not in _content_lower and ('"error":' in _content_lower or 'error:' in _content_lower or 'exception:' in _content_lower or 'traceback' in _content_lower or 'command not found' in _content_lower or 'invalid syntax' in _content_lower or 'failed to' in _content_lower) %}
|
| 248 |
+
{%- set ns2.consecutive_failures = ns2.consecutive_failures + 1 %}
|
| 249 |
+
{%- else %}
|
| 250 |
+
{%- set ns2.consecutive_failures = 0 %}
|
| 251 |
+
{%- endif %}
|
| 252 |
+
{%- if ns2.prev_role != 'tool' %}
|
| 253 |
+
{{- '<|im_start|>user' }}
|
| 254 |
+
{%- endif %}
|
| 255 |
+
{%- if max_tool_response_chars > 0 and content | length > max_tool_response_chars %}
|
| 256 |
+
{%- set content = content[:max_tool_response_chars] + '\n[TRUNCATED — original length ' ~ (content | length | string) ~ ' chars]' %}
|
| 257 |
+
{%- endif %}
|
| 258 |
+
{{- '\n<tool_response>\n' + content }}
|
| 259 |
+
{%- if ns2.consecutive_failures >= 2 %}
|
| 260 |
+
{{- '\n\n⚠️ SYSTEM WARNING: ' ~ ns2.consecutive_failures ~ ' consecutive tool errors detected. Your previous approach is incorrect. You MUST use a fundamentally different approach or corrected arguments.' }}
|
| 261 |
+
{%- elif ns2.consecutive_failures == 1 %}
|
| 262 |
+
{{- '\n\n⚠️ SYSTEM WARNING: The previous tool call returned an error. Diagnose the failure and retry with completely corrected arguments.' }}
|
| 263 |
+
{%- endif %}
|
| 264 |
+
{{- '\n</tool_response>' }}
|
| 265 |
+
{%- if loop.last %}
|
| 266 |
+
{{- '<|im_end|>\n' }}
|
| 267 |
+
{%- else %}
|
| 268 |
+
{%- set _next_role = _msgs[loop.index0 + 1].role %}
|
| 269 |
+
{%- if _next_role != 'tool' %}
|
| 270 |
+
{{- '<|im_end|>\n' }}
|
| 271 |
+
{%- endif %}
|
| 272 |
+
{%- endif %}
|
| 273 |
+
{%- else %}
|
| 274 |
+
{{- '<|im_start|>user\n[' + message.role + ']: ' + content + '<|im_end|>\n' }}
|
| 275 |
+
{%- endif %}
|
| 276 |
+
{%- set ns2.prev_role = message.role %}
|
| 277 |
+
{%- endfor %}
|
| 278 |
+
{%- if add_generation_prompt %}
|
| 279 |
+
{{- '<|im_start|>assistant\n' }}
|
| 280 |
+
{%- if not ns_state.thinking %}
|
| 281 |
+
{{- '<think>\n</think>\n' }}
|
| 282 |
+
{%- elif ns2.consecutive_failures >= 2 %}
|
| 283 |
+
{{- '<think>\n</think>\n' }}
|
| 284 |
+
{%- else %}
|
| 285 |
+
{{- '<think>\n' }}
|
| 286 |
+
{%- endif %}
|
| 287 |
+
{%- endif %}
|
mmproj-F32.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81a714ac5e8e15687371fc95a180953a29b732962f6616f791063ff127559412
|
| 3 |
+
size 931145888
|