AIAny
Chatbot2026
Icon for item

Qwen Sharp Chat Templates

Provides a drop-in Jinja chat template for Qwen 3.5/3.6/3.8 that reduces reasoning-token waste, enforces a concise terseness system prompt, and preserves in-chat reasoning and tool-call rendering across turns. Terseness is on by default but switchable per request; no model weights are changed.

Introduction

Why this matters

Large chat models can waste tokens on internal "thinking" or polite preamble, lose in-turn reasoning across multi-turn sessions, or mis-handle structured tool-call payloads. That behavior increases cost, causes agentic stalls in coding agents, and breaks deterministic tool integration. Qwen Sharp Chat Templates attack those practical pain points at the prompt layer so you get faster, more predictable multi-turn behavior without retraining models.

What Sets It Apart
  • Targeted fixes to Qwen templates: builds on froggeric's fixed Qwen chat template suite and rebases upstream v22.3 changes while adding a force-appended terseness system prompt and small fast-mode bugfixes — this means you get upstream bug repairs (reasoning parsing, error escalation, tool-arg serialization) plus Sharp's behavior tweaks.
  • Token-efficient terseness: appends a compact instruction that removes preamble, filler, and needless restatements while preserving essential caveats and steps — practical result is fewer thinking tokens and denser answers, improving time-to-first-useful-token in coding and knowledge tasks.
  • Thinking retention and agent safety: enables retention of prior internal reasoning to avoid amnesia and cache invalidation that cause agent loops; gates think-related tool-call rules when thinking is disabled so fast (thinking-off) mode does not request unrenderable blocks.
  • Request-level control: the terseness block and reasoning effort are controllable per-request via chat_template_kwargs (e.g., terse=false or reasoning_effort values), so you can A/B or opt out without changing embedded model metadata.
Who It's For and Trade-offs

Great fit if you run Qwen-family models locally or in self-hosted runtimes (llama.cpp, MLX/oMLX, transformers, vLLM) and need predictable multi-turn reasoning, tighter token budgets, or safer tool integrations for coding agents. It’s especially useful when you want prompt-layer behavioral fixes without touching model weights.

Look elsewhere if you need a model-level change: this template does not alter model parameters or provide per-model fine-tuning. Also expect variance by model size — terseness wording may need tuning for very small models (e.g., 4B) and older runtimes might prefer the embedded tokenizer_config copy over a .jinja file, so verify applied sources with the provided checks.

Practical decision note

Applying Sharp is a low-risk, reversible prompt-layer intervention: drop the chat_template.jinja into your model folder or pass it per-run to try it. It fixes several real-world failure modes (tool serialization, empty-think poisoning, escalation tiers) while adding an opt-out concise-system block that materially reduces wasted thinking tokens in many workloads.

Information

  • Websitehuggingface.co
  • AuthorsSaga Ishtardottir, froggeric
  • Published date2026/08/10

Categories

More Items

GitHub
Chatbot2026

Self-hosted sales CRM that runs native AI agents (RAG per tenant) to handle WhatsApp conversations, qualify leads, trigger automations and move deals through configurable pipelines. Multi-tenant with LGPD-minded controls and a one-command VPS installer for full data ownership.

GitHub
AI Deploy2026

Turns a PC, Mac, or Linux machine into a private AI server with one-command installers: local LLM inference, a ChatGPT-style web UI, voice, agents, RAG, workflows, image generation, hardware-aware model selection, and optional cloud/hybrid modes.

GitHub

Runs a self-hosted meeting bot and transcription API that joins Google Meet, Teams and Zoom and streams speaker-attributed transcripts in real time. Compiles meetings into a git-backed Markdown workspace and runs sandboxed agents on your infrastructure; Apache-2.0 and air-gap capable.