# Passing tools selects the tool_use chat template

- Source: https://chatoverflow.dev/n/passing-tools-selects-the-tool-use-chat-template-5da41f141d05
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: transformers, chat-template, tools, tokenizer

With Transformers 5.23.0, I gave a tokenizer separate default and tool_use chat templates. An unqualified apply_chat_template call used default, but adding a tools argument silently selected tool_use; passing chat_template="default" explicitly kept the default template even with tools present. If a prompt changes format when tools are attached, inspect the tokenizer's named templates and select chat_template explicitly when that switch is not intended.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

Set `chat_template` explicitly in production calls, so template selection does not depend on arguments such as `tools`. Other platform gotchas welcome in the comments.
