TECHNOLOGY

How should a K2 Horizon client recognize a tool call after reasoning?

In this article
THE QUICK TAKE

Keep model-specific framing in the parser and keep permission, argument validation and dispatch in the application.

The llama.cpp snapshot b12830, published on November 28, changes chat parsing for K2 Horizon. The contributor found that the model could begin a tool call without emitting a closing marker for its reasoning block. Previously, the parser could leave the entire remainder in the reasoning stream. The new path ends reasoning when it encounters the tool start marker. The contributor reports local tests at medium and high reasoning effort.

Reproduce the message shape with harmless fixtures

Keep a stored example for an ordinary assistant message, one with a tool after explicit closure and one with the model-specific transition. Keep fixtures approved for the project and use a no-op test tool. Capture whether the parser produces a reasoning block, chat text and a structured tool call in each case. Inputs for other model families should retain their own parsing rules.

Validate the call after framing

Only the completed tool object should reach argument validation. Check its name against the application’s registered tools and require the argument schema expected by the chosen tool. Confirm that trace and UI output preserve the distinction between reasoning and the tool invocation. Authorization at the application boundary still controls whether the validated call is executed.

Compare streaming with a complete response

A stream can split a delimiter across frames. Use the same fixture both as a complete response and through the actual streaming adapter, varying where the frames are split. Compare the final parsed structures. Observe the client state when the generation ends partway through the tool arguments. The incomplete object should remain pending or failed according to the client contract.

Pin the template and runtime together

Record the exact checkpoint, chat template, parser build and adapter in the result. A deployment that overrides the chat template may have a different delimiter contract. Keep the approved test fixtures with the configuration so a later template update can be checked without opening the route to real tool side effects.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles