Fix chat template: render tool_calls history and add <think> handling

#4

Thanks for the 1.2B-Thinking model. Visible small-model reasoning that still tool calls correctly is genuinely useful to work with.

The shipped template is byte-identical to the 1.2B-Instruct template and has two independently testable gaps.

First, a past assistant tool_calls turn renders empty because the message loop emits content only. Agent clients therefore lose the model's action history.

Second, the template has no <think> handling. An assistant thinking field is not replayed into history, and llama.cpp does not enable its LFM reasoning extraction path because that path checks the template source for <think>. On the tested default route, raw reasoning appeared inside content and no reasoning_content field was present.

This proposal ports the LFM2.5-8B-A1B tool-call macros and its <think> handling. The render regression proves the empty-turn defect and native LFM tool-call rendering independently from the live reasoning test. On the live fixed route, reasoning arrived separated in reasoning_content, the leak from content was gone, and structured tool calls still parsed.

There is one policy question for Liquid: should thinking or reasoning_content be replayed into tool-loop history, and should keep_past_thinking govern only older completed turns or all assistant turns? The included implementation mirrors the current 8B template, but that policy belongs to Liquid. We are happy to split the history and extraction changes or follow a different reasoning-history convention.

GGUF users receive the fix through a re-converted GGUF or a runtime template override, which is how we verified it live.

Evidence and the two separate reproductions:
https://github.com/graphometer/droplet/tree/main/public/evidence

Disclosure: prepared with heavy AI assistance; every claim above comes from recorded runs that can be inspected. Not affiliated with, endorsed by, or connected to Liquid AI.

Cannot merge
This branch has merge conflicts in the following files:
  • chat_template.jinja

Sign up or log in to comment