Repository navigation
Description
Area
[Engine] (speed, kernels, models, the server and API)
Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
Inkling 2's own chat template takes a reasoning effort from 0 to 0.99, with names mapped in its effort_map (minimal 0.1, low 0.2, medium 0.7, high 0.9, xhigh/max 0.99), and writes it as Thinking effort level: X. Before the template sees a level, though, serve/frontend.py translates it through the Qwen EFFORT table (line 157). Only after that does inkling_template_kwargs (serve/server.py:500) pass it on. For Inkling this changes the meaning of two names and blocks numbers:
Client sends (reasoning_effort, reasoning.effort or chat_template_kwargs.reasoning_effort) |
Inkling's template gets |
|---|---|
| nothing | 0.9 (inkling_template_kwargs default "high") |
minimal |
0, thinking off (expected 0.1) |
low |
0.2 |
medium |
0.7 |
high |
0.99 (expected 0.9) |
xhigh / max |
0.99 |
a number, e.g. 0.95 or 1.5 |
HTTP 400 unknown reasoning effort 0.95: use none, low, medium or high |
Effects:
- A client that asks for
highgets the maximum level. 0.9 is only reachable by sending no level at all. minimalturns thinking off instead of setting the lowest level, and 0.1 cannot be reached. This is the level asked about in [Engine] Inkling 2 mini how to reduce thinking to avoid thinking loop?? #348.inkling_template_kwargsaccepts numbers (isinstance(effort, (int, float))) and the template accepts 0..0.99, buteffort_kwargsrefuses them before they get that far. The 400 message also lists onlynone, low, medium or high, althoughxhighandmaxare accepted.
Expected: for Inkling, level names pass through to its template unchanged and numbers in 0..0.99 are accepted, the way Hy4-Flash already gets its own table (use_family("hy4")). none/off/false would still turn thinking off.
Smallest steps or command that reproduce it
Render through the server's own code (from terminal/, with the Inkling pack's tokenizer folder):
import re
from serve import frontend
from serve.server import inkling_template_kwargs
t = frontend.ChatTemplate("<pack>/tokenizer/chat_template.jinja")
for given in (None, "minimal", "low", "medium", "high", "xhigh"):
kw = frontend.effort_kwargs(given)
kw = {**kw, "enable_thinking": kw.get("enable_thinking") is not False} # as server.py builds it
out = t.render([{"role": "user", "content": "hi"}], tools=None, **inkling_template_kwargs(kw))
print(given, re.search(r"Thinking effort level: ([0-9.]+)", out).group(1))Output:
None 0.9
minimal 0
low 0.2
medium 0.7
high 0.99
xhigh 0.99
Live, against a running Inkling server:
{"chat_template_kwargs": {"reasoning_effort": 1.5}}→ HTTP 400 with the message above (the same for0.95)."minimal"→ no thinking in the reply (0reasoning_contentchars)."xhigh"on the same prompt → thinking present.
Reproduction status
Reproduced locally
PolyStrata version
v0.2.20-poly.5 (commit d62dfac), Windows x64 release build, run from source
Graphics card, memory and system
RTX 4060 Laptop 8 GB · 64 GB RAM · Windows 11
Model, size and settings
Inkling 2 Mini UD-Q4_K_XL · 128K context · pictures on · small-card defaults (--attn-requant q5_k --loop-bf16 --tail-skip 4)
Activity