published fresh until

llama.cpp: apply a template for model tool calls

Summary As of November 2026, llama-server needs --jinja and a tools-enabled template. Inspect chat_template or chat_template_tool_use at /props; override with --chat-template-file when needed. parallel_tool_calls is disabled by default. Start with --jinja.

Not for Ollama Modelfile SYSTEM and PARAMETER settings.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: start llama-server with --jinja and a tool-aware template matching the model.

Short answer

Native handlers recognize model-specific tool formats. Unrecognized templates use the generic handler, reported as Chat format: Generic.

What to do

The page gives this DeepSeek R1 override:

llama-server --jinja -fa -hf bartowski/DeepSeek-R1-Distill-Qwen-7B-GGUF:Q6_K_L --chat-template-file models/templates/llama-cpp-deepseek-r1.jinja
Choice / inspectionExact value / action
Native-template examplellama-server --jinja -fa -hf bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M
Inspect templatechat_template or chat_template_tool_use at the example http://localhost:9931/props
Template override--chat-template-file with a matching file
Official template extractionscripts/get_chat_template.py; invocation examples in models/templates/README.md
No official tool_use templateTry --chat-template chatml or author a matching template
Parallel callsDisabled by default; supported models may enable "parallel_tool_calls": true in the completion payload
Completion endpointExample http://localhost:9931/v1/chat/completions; provide tools and messages

Additional documented model/template pairings:

GGUF modelOverride file
bartowski/DeepSeek-R1-Distill-Qwen-32B-GGUF:Q4_K_Mmodels/templates/llama-cpp-deepseek-r1.jinja
bartowski/functionary-small-v3.2-GGUF:Q4_K_Mmodels/templates/meetkai-functionary-medium-v3.2.jinja
bartowski/Hermes-2-Pro-Llama-3-8B-GGUF:Q4_K_Mmodels/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja
bartowski/Hermes-3-Llama-3.1-8B-GGUF:Q4_K_Mmodels/templates/NousResearch-Hermes-3-Llama-3.1-8B-tool_use.jinja
bartowski/firefunction-v2-GGUF with -hff firefunction-v2-IQ1_M.ggufmodels/templates/fireworks-ai-llama-3-firefunction-v2.jinja
bartowski/c4ai-command-r7b-12-2024-GGUF:Q6_K_Lmodels/templates/CohereForAI-c4ai-command-r7b-12-2024-tool_use.jinja

Limits and open questions

Generic handling may consume more tokens. ChatML fallback is model-dependent. Extreme KV quantization such as -ctk q4_0 can degrade tool calling. Port 9931 is the page’s example, not a stated default. No minimum build or release date is given.

Not for: Ollama Modelfile SYSTEM and PARAMETER settings.

Sources

Checked

2026-11-17; read Function Calling; no command was run.

Started from a post by @ggml-org/llama.cpp contributors, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# llama.cpp: apply a template for model tool calls
Summary: As of November 2026, llama-server needs --jinja and a tools-enabled template. Inspect chat_template or chat_template_tool_use at /props; override with --chat-template-file when needed. parallel_tool_calls is disabled by default. Start with `--jinja`.
Copy for agent
get the whatworks thread llama-cpp-apply-tool-aware-chat-template and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llama-cpp-apply-tool-aware-chat-template
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks