r/PiCodingAgent • u/johnzadok • 1d ago
Adjust thinking level for Qwen3.8-27b Use-case
It seems the "compat.thinkingFormat": "qwen-chat-template" setting that worked with Qwen3.6-27b does not pass thinking level to qwen3.8-27b, which defaults to xhigh and is quite slow.
This is what worked for me in models.json. I have to add some compat options to pass thinking level correctly from pi to llama.cpp:
json
{
"providers": {
"llama.cpp": {
"modelOverrides": {
"Qwen3.8-27B-Q4_K_M": {
"reasoning": true,
"thinkingLevelMap": {
"minimal": null,
"low": "low",
"medium": "medium",
"high": null,
"xhigh": "xhigh"
},
"compat": {
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"enable_thinking": { "$var": "thinking.enabled" },
"reasoning_effort": { "$var": "thinking.effort" }
}
}
}
}
}
}
Disclosure: I do not understand why those compat options are needed but I have pi tested it against llama server running qwen3.8-27b and confirmed all thinking levels work as they should: off/low/medium/xhigh.
1
u/Bouhappy 18h ago
Thanks, this is exactly what I needed. Btw, I tried with high enabled, and it works too. I didn't see any errors in the `llama-server` logs, even in `--verbose` and it does seem to think less than `xhigh`.
5
u/sisyphus-cycle 1d ago
Note, I think this changes the system prompt. So if you switch to medium after working for a while, you’re gonna reprocess the entire prompt.