d0c44273db
## Motivation Fixes #1456. Models like DeepSeek V3.2, Qwen3, and GLM-4.7 always run in thinking mode because their chat templates auto-inject `<think>`. Users need a way to disable thinking for models that support both modes. ## Changes **API**: Added `enable_thinking: bool | None` to `ChatCompletionRequest` and `TextGenerationTaskParams`. Passed through the adapter to `tokenizer.apply_chat_template()` as a kwarg (only when explicitly set, so models without the template variable are unaffected). **Dashboard**: Added a thinking toggle button in the chat input area. Visible only when the selected model has both "text" and "thinking" capabilities. ## Why It Works Most thinking model chat templates (DeepSeek, Qwen3, GLM) accept `enable_thinking` as a Jinja template variable. Passing `enable_thinking=False` prevents the template from injecting `<think>`, matching the vLLM convention. ## Test Plan ### Manual Testing - `curl` with `"enable_thinking": false` against a thinking model — no `<think>` in output - Dashboard toggle visible for thinking models, hidden for text-only models ### Automated Testing - basedpyright: 0 errors - ruff: clean - pytest: 188 passed - dashboard build: success --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>