You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(server): derive the thinking_mode chat-template kwarg when the template supports it #775
Some chat templates gate reasoning on a thinking_mode string variable rather than the boolean enable_thinking. mlxcel already derives an enable_thinking default from the template (src/server/chat_template.rs:147-169) and has generic template-kwarg plumbing (src/server/chat_template_kwargs.rs), but it never sets thinking_mode, so such templates silently fall back to the non-thinking branch even when thinking is requested.
Semantics
When thinking is enabled for a request (explicitly or by default) AND the raw chat template text references the identifier thinking_mode, inject thinking_mode: "enabled" into the template kwargs, unless the client already supplied a thinking_mode kwarg. Inject nothing when thinking is disabled (templates default the variable themselves).
Implementation plan
Template-reference check: a substring scan of the template source for thinking_mode, in the same style as the existing enable_thinking detection in chat_template.rs.
Inject during kwarg resolution in chat_template_kwargs.rs, with client-provided values winning.
Tests: a template gated on thinking_mode renders the thinking branch when enabled; a client override is respected; templates without the identifier are untouched.
Acceptance criteria
Unit tests pass; rendering for existing templates (qwen3 family, gemma family) is unchanged.
Activity
feat(server): derive thinking_mode chat-template kwarg from template (#…
fix(server): define tools only when the request sends them (#1598)
feat(server): derive thinking_mode chat-template kwarg from template (l…