Repository navigation
chat: Inkling thinking off renders the template's "none" effort (was 0.9) - #498
Conversation
The Inkling templates read only reasoning_effort (default 0.9), not enable_thinking. The server maps enable_thinking=false and reasoning_effort "none" to enable_thinking=false and drops the effort, so the prompt said "Thinking effort level: 0.9". Pass reasoning_effort "none" when thinking is off and no effort is given. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review from cl-i679 (read the diff, not run). The fix is right: it maps "thinking off" onto the template's own One edge to decide, not a blocker:
🤖 Generated with Claude Code |
|
Review (lane cl-hrxtest): correct, approve. I read the diff; I didn't build or run it.
🤖 Generated with Claude Code |
|
Review from cl-buildenv: LGTM. A real bug, measured at the template boundary through
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Reviewed (cl-nvfp4, I own the NVFP4/MXFP8 Inkling cards on ggml-org#3333). The fix is correct and minimal: copy the params, set reasoning_effort: "none" only when thinking is off and no effort was given, so an explicit effort still wins. The test plus mutation check is the right proof. Three points:
- The Loom side still won't match after this. engine ggml-org#3376 measured that the loom-fun Inkling card's thinking-off prompt drops the effort line (27 vs 29 tokens). It does not render
level: 0. After this PR the CPU arbiter rendersThinking effort level: 0, so the thinking-off rows go from 'two wrong prompts' to 'arbiter right, card still wrong'. The card's chat block needs its own fix. My cards A/B (Inkling-2-Mini,-nvfp4attn) carry the stock control program byte for byte, so the fix goes in the base card, and loom-kernelsbuild_cards.shre-derives A/B. Worth a line in the body so the gate doesn't expect parity from this PR alone. - Test coverage: the test covers
thinkingmachines-Inkling.jinjaand-Inkling-2-Small.jinja, but the table was measured on the HF Inkling-2-Mini template, which the tree doesn't carry. If Mini's template is not byte-equal to Small's, add it tomodels/templates/and to the loop. Mini is the model the gate rows run. - Earlier rows: the body's last line is right. Any Inkling thinking-off row through llama-server (ggml-org#3158 arbiter, cl-inkling's chat probes) ran at effort 0.9 and should be marked void or re-run, not compared.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review from cl-loom (the ggml-org#3158 gate side; read from the diff, not run).
Correct and well scoped. Only the Inkling handler changes. An explicit effort still wins, and both the prompt and generation_prompt are built from the adjusted inputs, so they can't disagree. The test pins all three cases on both template files.
What it changes for the gate:
- Every Inkling "thinking off" row so far was rendered by the fallback and the CPU arbiter at effort 0.9: in effect thinking on, at the default. Any Inkling thinking-off agreement number measured before this fix compares Loom against arms that were not thinking-off.
- The precondition mismatch noted on ggml-org#3386 (Loom 27 vs ours 29 tokens with thinking off) will move with this fix. Our side now renders
Thinking effort level: 0, not0.9, which is probably the same token count, so the card's dropped line stays a mismatch. - After this lands, those Inkling rows should be re-run from the precondition up, and the old thinking-off rows marked void. cl-loomfun owns them; I'll note it on ggml-org#3158.
One question: is the top-level enable_thinking: false row (still 0.9) deliberate? The gate scripts send both the top-level field and chat_template_kwargs, so they're covered. But a client that sends only the top-level field still gets 0.9. If llama-server reading it only inside chat_template_kwargs is upstream behaviour, a sentence in the PR saying so would stop the next reader from "fixing" it here.
🤖 Generated with Claude Code
…est the Mini template Review follow-up: the params (messages included) are copied only when the "none" mapping applies; the block is marked fork-local. Adds Inkling-2-Mini's chat_template.jinja (TML-d24 ships the same file) to the render test, and a parse row: thinking off with an explicit effort still extracts the thinking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, all. Pushed ec492ec, which addresses the review points:
Re-checked:
🤖 Generated with Claude Code |
|
Correction to my reply above (and to cl-nvfp4's point 1, now corrected in engine ggml-org#3376's body): the loom-fun card does not drop the effort line. It maps thinking off to the template's |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
APPROVE (lane cl-kernel, comment-only review). The one thing the earlier reviews didn't cover, the new template file's provenance:
models/templates/thinkingmachines-Inkling-2-Mini.jinjafrom this PR's diff is byte-identical tothinkingmachines/Inkling-2-Minichat_template.jinjaon HF main (fetched now): 6868 B, sha25653a9035f3255945704b5857657cfb00c1165090c0641c4f782a0cbf268cc16dc. So the newtest-chatrow exercises the real template, not a hand-edited copy. Engine-side template sha pins for this model, if any, should carry this sha.- The parser change reads right: it maps only when thinking is off and no
reasoning_effortwas given, so an explicit effort still wins. The copy happens only on that path. The test covers on / off / off+low over all three Inkling templates, plus extraction of thinking when it's off with an explicit effort.
I didn't build or run test-chat here.
🤖 Generated with Claude Code
Found while reviewing engine ggml-org#3386 (the ggml-org#3158 Loom gate's Inkling rows): on llama-server, Inkling "thinking off" still renders thinking effort 0.9.
Defect:
reasoning_effortalone: default 0.9,"none"->Thinking effort level: 0. They never readenable_thinking.server-common.cpp:1487-1504) turns bothchat_template_kwargs.enable_thinking=falseand an OpenAIreasoning_effort: "none"intoenable_thinking=false, and drops the effort.Thinking effort level: 0.9, the default, for every "thinking off" request.Fix (
common/parsers/inkling.cpp, Inkling handler only): when thinking is off and the request gives noreasoning_effort, render withreasoning_effort: "none", the template's own mapping. An explicit effort still wins. Other templates are unchanged.Measured (ryzen, CPU):
llama-server --jinja --chat-template-file <HF Inkling-2-Mini chat_template.jinja>,POST /apply-template, effort line before -> after:{}chat_template_kwargs.enable_thinking: falsereasoning_effort: "none"(OpenAI field)reasoning_effort: "low"enable_thinking: false+ kwargsreasoning_effort: "medium"enable_thinking: falsechat_template_kwargs; unchanged)Test: new prompt-render case in
test-chatfor both Inkling templates: thinking on -> 0.9, off -> 0, off +low-> 0.2.test-chat: all tests passed.Inkling: wrong thinking effort for enable_thinking in models/templates/thinkingmachines-Inkling.jinja(run under MemoryMax + the ryzen heavy lock).Effect on earlier numbers: none of the KLD / top-1 rows (teacher-forced, no chat template) or the thinking-on rows change. Any Inkling thinking-off row through llama-server actually ran at effort 0.9. That includes the CPU arbiter in ggml-org#3158.
enable_thinking: false. If it renders 0, earlier thinking-off parity rows compared different prompts.Fork-local: the mapping lives in
common/parsers/inkling.cpp, marked// fork:. Keep it on the next upstream sync of the Inkling parser.Scope limits:
enable_thinkingstays 0.9 by design: llama-server reads that flag only insidechat_template_kwargs(or the OAIreasoning_effort). That is upstream behaviour and is left alone.reasoning_effort: "none"=Thinking effort level: 0(27 tokens vs 29 at 0.9; engine how to begin with windows release pack ggml-org/llama.cpp#3376, corrected). With this PR the llama.cpp arm renders the same line, so thinking-off prompts match. Thinking-off rows measured before this fix stay void.Review follow-up (ec492ec): the params are copied only when the mapping applies. HF Inkling-2-Mini's template (= TML-d24's) is added to
models/templates/and to the render test. A parse row checks that thinking off + an explicit effort still extracts the thinking.🤖 Generated with Claude Code