Skip to content

thinking: note thinking models and add a profile switch - #62

Merged
DevelopmentCats merged 1 commit into
mainfrom
devcats/thinking-default-notice
Nov 9, 2026
Merged

DevelopmentCats merged 1 commit into
mainfrom
devcats/thinking-default-notice

Conversation

@DevelopmentCats

Copy link
Copy Markdown
Collaborator

Closes #24

Thinking models now say so before they are pulled. A profile can also turn thinking off by default.

What changed

  • Catalogue: model-type files take a thinking block with kwarg, default, why and an optional detect (template checks the chat template for the kwarg, always skips the check). A file needs engines, thinking, or both. Entries cover:
    • qwen3, qwen3_moe, qwen3_5, qwen3_5_moe
    • glm4_moe, glm4_moe_lite, glm_moe_dsa, glm4v_moe
    • smollm3
    • deepseek_v3 (off by default)
    • deepseek_v4 (detect: always, because the tokenizer mode starts the thinking block)
  • Engine: a chat_template_kwargs_flag capability, set to --default-chat-template-kwargs in vllm.json. No Go code names an engine or model.
  • inspect prints thinking: on by default … or off by default ….
  • new --thinking on|off writes the kwarg through the engine flag and records THINKING= in the profile. A bad value is refused before anything is resolved.
  • list shows [thinking], and status gets a thinking line. Both are in the JSON output too.
  • model-types list and show print the thinking entry.
  • Panel: Add model shows a Thinking control for thinking models. ?thinking= on pull returns 400 on a bad value and 409 when the profile already exists.
  • Docs: model-types, profiles, models, providers, panel and the catalogue READMEs are updated. There is also a CHANGELOG entry.

Existing profiles have no THINKING key until they are re-created. Always-thinking models with no switch (R1, QwQ, Kimi-K2-Thinking) are not flagged.

Checks

  • go test -race ./...: all pass except internal/detect TestProbeReportsThisMachine, which fails on a 16 GB workspace and also fails on main.
  • go vet ./..., gofmt -l . and the recipediff vet and tests pass.
  • prettier --check passes.
  • Smoke tests: inspect Qwen/Qwen3-0.6B and inspect zai-org/GLM-4.5-Air both report thinking: on by default.
  • Not run on the Sparks.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved thinking-setting bugs can cause a panic on null kwargs, mishandle repeated kwargs flags, and show controls or state that do not match the selected or active profile.

6 open issues
What changed in this PR

This PR addresses #24 by making reasoning-related latency visible before a model is pulled and adding a default thinking setting for new profiles.

Changes:

  • Adds catalogue-driven thinking detection and an engine capability for setting chat-template defaults.
  • Exposes thinking information through CLI commands, profile metadata, JSON output, and the panel’s Add model flow.
  • Adds validation and regression tests, updates documentation, and records the feature in the changelog.
File Description
internal/​web/​static/​models.js Renders thinking controls and submits the selected setting.
internal/​web/​static/​models.html Adds the Thinking control markup.
internal/​web/​static/​app.css Styles the thinking notice.
internal/​web/​server_internal_test.go Tests invalid settings and existing-profile conflicts.
internal/​web/​models.go Exposes switch availability and handles thinking requests.
internal/​vllm/​validate.go Removes quotation marks in a parser comment; no behavior change.
internal/​resolve/​thinking.go Detects thinking support and applies profile overrides.
internal/​resolve/​thinking_internal_test.go Tests detection, overrides, validation, and argument persistence.
internal/​resolve/​resolve.go Integrates thinking into inspection and profile preparation.
internal/​profile/​profile.go Reads and writes THINKING metadata.
internal/​profile/​profile_test.go Tests thinking metadata persistence.
internal/​modeltype/​modeltype.go Defines and validates catalogue thinking entries.
internal/​modeltype/​modeltype_internal_test.go Tests thinking schema and shipped entries.
internal/​hf/​hf.go Reads chat templates from template files or tokenizer configuration.
internal/​hf/​hf_internal_test.go Tests chat-template retrieval fallbacks.
internal/​engine/​engine.go Adds and validates the chat-template kwargs capability.
internal/​engine/​engine_test.go Tests capability flag validation.
internal/​cli/​search.go Displays thinking defaults during inspection.
internal/​cli/​run_test.go Tests CLI reporting and invalid thinking values.
internal/​cli/​profiles.go Adds new --thinking and list/status reporting.
internal/​cli/​modeltypescmd.go Displays thinking rules and handles thinking-only entries.
internal/​cli/​editset.go Recognizes THINKING as a standard profile key.
docs/​reference/​cli/​new.md Documents the new CLI flag.
docs/​providers.md Documents the engine kwargs capability.
docs/​profiles.md Explains thinking metadata and manual profile updates.
docs/​panel.md Describes the panel’s Thinking control.
docs/​models.md Explains thinking latency and disabling it.
docs/​model-types.md Documents thinking schema, detection, and overrides.
CHANGELOG.md Announces thinking detection and profile controls.
catalogue/​model-types/​smollm3.json Adds SmolLM3 thinking metadata.
catalogue/​model-types/​README.md Introduces thinking-only catalogue entries.
catalogue/​model-types/​qwen3.json Adds Qwen3 thinking metadata.
catalogue/​model-types/​qwen3_moe.json Adds Qwen3 MoE thinking metadata.
catalogue/​model-types/​qwen3_5.json Adds Qwen3.5 thinking metadata.
catalogue/​model-types/​qwen3_5_moe.json Adds Qwen3.5 MoE thinking metadata.
catalogue/​model-types/​glm4v_moe.json Adds GLM-4.5V thinking metadata.
catalogue/​model-types/​glm4_moe.json Adds GLM-4.5–4.7 thinking metadata.
catalogue/​model-types/​glm4_moe_lite.json Adds GLM-4.7-Flash thinking metadata.
catalogue/​model-types/​glm_moe_dsa.json Adds GLM-5 thinking metadata.
catalogue/​model-types/​deepseek_v4.json Adds always-detected, default-on thinking metadata.
catalogue/​model-types/​deepseek_v3.json Adds template-detected, default-off thinking metadata.
catalogue/​engines/​vllm.json Declares vLLM’s default chat-template kwargs flag.
catalogue/​engines/​README.md Documents the new engine capability.

Review effort: Balanced

Comment thread internal/cli/profiles.go
Comment on lines +448 to +449
if p, err := profile.Load(cfg.Dirs, r.Profile); err == nil {
r.Thinking = p.Thinking()
Comment on lines +345 to +349
if flag != "" {
arch, _ := hf.Config(ctx, cfgRepo)
p.Thinking = detectThinking(ctx, arch.ModelType, repo, cfgRepo)
p.noteThinking(flag)
}
Comment on lines +69 to +73
var m map[string]any
if json.Unmarshal([]byte(val), &m) == nil {
if b, isBool := m[kwarg].(bool); isBool {
def = b
}
Comment on lines +99 to +101
if err := json.Unmarshal([]byte(val), &kwargs); err != nil {
return "", fmt.Errorf("%s %s is not a JSON object", flag, val)
}
Comment on lines +406 to +407
const offer = d.thinking_switch && !d.existing_profile;
el.thinkingSelect.hidden = !offer;
Comment on lines +402 to +410
const def = d.thinking.default ? "on" : "off";
el.thinkingNote.textContent = d.thinking.default
? `Thinking model: replies begin after a reasoning pass. ${d.thinking.why}`
: `This model can reason before it answers, but does not unless asked. ${d.thinking.why}`;
const offer = d.thinking_switch && !d.existing_profile;
el.thinkingSelect.hidden = !offer;
if (!offer) return;
for (const [value, label] of [
["", `Model default (${def})`],
@DevelopmentCats
DevelopmentCats merged commit 66019cb into main Nov 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing tells the user a model thinks by default, which reads as the server being slow

2 participants