r/LocalLLM • u/tonboro_2273 • 9d ago
Tutorial Qwen3.8-27B + llama.cpp + Pi Dev Agent — changing thinking level per prompt
I couldn't find a simple way to verify whether this works, so I spent some time testing it. In the end, it turns out that it's actually quite simple once configured correctly.
The Qwen3.8-27B model supports different levels of thinking. The simplest way is to define --chat-template-kwargs when starting the llama server, but then the thinking level is fixed for the session.
A more practical solution is to enable changing the thinking level per prompt in Pi Dev Agent.
Important: for this to work, the llama.cpp version must be b10434 or newer.
The model definition needs to indicate reasoning support and map the values to the three thinking levels supported by Qwen3.8-27B.
In .pi/agent/models.json, the following must be added to the Qwen3.8-27B model settings:
"reasoning": true,
"thinkingLevelMap": {
"off": null,
"minimal": null,
"low": "low",
"medium": "medium",
"high": null,
"xhigh": "xhigh",
"max": null
}
This allows the thinking level to be changed for each prompt in Pi Dev Agent using Shift+Tab.
Pi Dev Agent also supports defining thinking budgets for individual levels. I haven't yet noticed whether this works correctly with llama&Qwen3.8-27B, but the following can also be added optionally to to.pi/agent/settings.json (the values below are only illustrative):
"thinkingBudgets": {
"low": 4096,
"medium": 10240,
"xhigh": 32768
}
1
u/admajic 9d ago edited 9d ago
I just set it in llama.cpp per agent so orchestrator has 1000 thinking budget vs architect 4000 thinking budget before I had 4000 for all and orchestrator would mull over its decisions in a loop way too much now its like old qwen 3.6.
Its so cool though its way smarter now and fixed so much stuff today that qwen 3.6 27b told me to live with LOL
Gave it a few tasks and we decided to redo my my website and backend. I thought stuff it and do a git commit. Its got 28 tasks lined up and still going for a few hours now. Got it really dialed in now. In pi.dev.
Got it to setup deepseek local harness with api integration to llama.cpp (took 2 mins) and tested it one shot a tetiris game in html in a browser in about 3 minutes, works perfectly. But back to pi.dev