cd /news/large-language-models/ternary-bonsai-2-usage-tips · home topics large-language-models article
[ARTICLE · art-134658] src=dotnetperls.com ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

Ternary Bonsai 2 Usage Tips

A user improved the agentic coding performance of Ternary Bonsai 2, a Qwen 3.8 27B-based model, when run locally through llama-cpp by switching its thinking setting from "xhigh" to medium via the chat-template-kwargs argument and enabling self-speculation with the spec-default argument. The user reported that the medium thinking setting curbed excessively long reasoning-token generation, while speculative decoding based on previously generated tokens helped because the model repeatedly outputs similar code blocks while thinking. The user called Ternary Bonsai 2 probably the most powerful model they have run locally, with the fewest quantization-related errors.

read1 min views1 publishedSep 19, 2026

I spent some time using llama-cpp with Ternary Bonsai 2. Over the last couple days I had determined that this model, based on Qwen 3.8 27B, has potential for agentic coding, so I decided to try to improve its performance a bit.

I changed the thinking to medium from "xhigh" as it tended to generate reasoning tokens way too long. This can be done with the chat-template-kwargs argument in llama-cpp.

Next, I added self-speculation (with the spec-default argument) to llama-cpp. This enables speculative decoding based on tokens previously generated. For coding, as in Pi Code, this really helps Qwen (and Ternary Bonsai 2) as it repeatedly outputs similar code blocks while thinking.

With these 2 changes, I improved performance of agentic coding and it was somewhat less frustrating. Ternary Bonsai 2 is probably the most powerful model I have been able to run locally, with the fewest quantization related errors.

── more in #large-language-models 4 stories · sorted by recency
── more on @ternary bonsai 2 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/ternary-bonsai-2-usa…] indexed:0 read:1min 2026-09-19 ·