---
title: "The 4 Things Qwen-3’s Chat Template Teaches Us"
description: "Qwen-3's Jinja chat template differs from Qwen-2.5 and QwQ in four ways."
url: "https://swe.quest/articles/the-4-things-qwen-3-s-chat-template-teaches-us-670fadf25c8ae311"
canonical: "https://huggingface.co/blog/qwen-3-chat-template-deep-dive"
source: "Hugging Face"
published: "2025-04-30"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 4
tags: ["llms","ai-agents"]
---

# The 4 Things Qwen-3’s Chat Template Teaches Us

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-04-30, 4 min read, Deep dive. Original: [https://huggingface.co/blog/qwen-3-chat-template-deep-dive](https://huggingface.co/blog/qwen-3-chat-template-deep-dive)

## Summary

Qwen-3's Jinja chat template differs from Qwen-2.5 and QwQ in four ways. An enable\_thinking flag prefills an empty \<think\>\</think\> block so reasoning can be skipped, where QwQ forces it on every turn. A rolling checkpoint keeps \<think\> blocks only for assistant turns after the latest non-tool user message, which preserves the active plan across multi-step tool calls and prunes stale reasoning. The template also serializes tool-call arguments only when they aren't already strings, avoiding double-escaping, and drops the default system prompt.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)

## Prerequisites

- LLM chat formats ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Jinja templates
- tool calling

## Keywords

Qwen-3, QwQ, Qwen-2.5, Jinja, chat template, @huggingface/jinja, Hugging Face

## Related posts

- [Tool Use, Unified](https://swe.quest/articles/tool-use-unified-117f148d6f2c2374.md): Hugging Face · 2024-08-12 · Medium · 11 min read · LLMs, AI agents, Python, API design
  Hugging Face Transformers extends Jinja chat templates to cover tool use, giving a single portable API for passing tools to Mistral, Cohere, NousResearch and Llama models.
- [Chat Templates: An End to the Silent Performance Killer](https://swe.quest/articles/chat-templates-an-end-to-the-silent-performance-killer-56e4408eee347f2d.md): Hugging Face · 2023-10-03 · Medium · 9 min read · LLMs, Python, Inference & serving, Model training
  Chat models are trained with incompatible formats for flattening role/content message lists into a single string, and feeding a model a different format than it was trained on causes severe but silent performance degradation.
- [Beyond the Chatbot: Event-Driven Agents in Action](https://swe.quest/articles/beyond-the-chatbot-event-driven-agents-in-action-fe3eb0d5f18a275b.md): Docker · 2025-07-28 · Medium · 9 min read · AI agents, Event-driven architecture, TypeScript, LLMs, Containers
  A GitHub webhook-triggered agent workflow automatically detects "I finished the tutorial" pull requests on Docker's sample repos, generates an encouraging comment, and closes them without any chat interface.
- [Building an AI-powered ChatBot using Vercel, OpenAI, and Postgres](https://swe.quest/articles/building-an-ai-powered-chatbot-using-vercel-openai-and-postgres-4fd423473384581f.md): Neon · 2023-03-09 · Medium · 13 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs, Serverless
  A ChatGPT-style documentation assistant (Ask Neon) is built by storing OpenAI text-embedding-ada-002 vectors in Postgres with pgvector, retrieving context by cosine distance, and feeding it to text-davinci-003 from a Vercel Edge Function.
- [How to be AI-fancy](https://swe.quest/articles/how-to-be-ai-fancy-1617ad0989d06ba6.md): Neon · 2024-11-04 · Medium · 6 min read · LLMs, Product engineering, PostgreSQL, TypeScript
  Neon added three LLM-backed features to its SQL editor: natural-language SQL generation, automatic naming of history queries, and one-click error fixing.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
