[PR #15217] app/ui: enable thinking toggle for all thinking-capable models #20354

Open
opened 2026-04-16 07:34:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15217
Author: @dhirajlochib
Created: 4/2/2026
Status: 🔄 Open

Base: mainHead: app/ui/thinking-capability-api


📝 Commits (8)

  • 1d0aeea app/ui: enable thinking toggle for all thinking-capable models
  • 5191947 parsers: add CanDisableThinking and thinking_toggle capability
  • 2476b0a server: remove stray disk space check and fix gofmt
  • 97a1110 Merge origin/main into app/ui/thinking-capability-api
  • 697b97f Merge branch 'main' into app/ui/thinking-capability-api
  • 5ec063a parsers: add CanDisableThinking to Gemma4Parser
  • cde925b app/ui: remove unused useHasThinkingCapability import
  • a431c66 server: update test expectations for parser-based tool capabilities

📊 Changes

23 files changed (+157 additions, -10 deletions)

View changed files

📝 app/ui/app/src/components/ChatForm.tsx (+2 -2)
📝 app/ui/app/src/hooks/useModelCapabilities.ts (+10 -0)
📝 harmony/harmonyparser.go (+5 -0)
📝 model/parsers/cogito.go (+4 -0)
📝 model/parsers/deepseek3.go (+4 -0)
📝 model/parsers/functiongemma.go (+1 -0)
📝 model/parsers/gemma4.go (+4 -0)
📝 model/parsers/glm46.go (+4 -0)
📝 model/parsers/glm47.go (+4 -0)
📝 model/parsers/lfm2.go (+4 -0)
📝 model/parsers/ministral.go (+4 -0)
📝 model/parsers/nemotron3nano.go (+1 -0)
📝 model/parsers/olmo3.go (+4 -0)
📝 model/parsers/olmo3_think.go (+4 -0)
📝 model/parsers/parsers.go (+5 -0)
📝 model/parsers/parsers_test.go (+42 -0)
📝 model/parsers/qwen3.go (+4 -0)
📝 model/parsers/qwen35.go (+4 -0)
📝 model/parsers/qwen3coder.go (+4 -0)
📝 model/parsers/qwen3vl.go (+4 -0)

...and 3 more files

📄 Description

Closes #14029

Hardcoding model families in the frontend would drift quickly, so I switched this to a server-driven capability check instead:

  1. Added CanDisableThinking() bool to the Parser interface, so each parser explicitly declares whether it honors the thinkValue parameter.
  2. Introduced a new thinking_toggle capability, emitted by Capabilities() only when the model truly supports enabling or disabling thinking.
  3. Updated the UI to check for thinking_toggle rather than thinking when deciding whether to render the toggle.

Parsers returning true (toggle supported):
qwen3-thinking, qwen3.5, deepseek3, cogito, lfm2-thinking, nemotron-3-nano, glm-4.7

Parsers returning false (thinking always enabled):
qwen3-vl-thinking, olmo3-think, ministral, glm46, harmony

For remote/cloud models such as minimax-m2, kimi-k2-thinking, qwen3-next, etc., this is controlled by the remote registry config. If a model exposes thinking but not thinking_toggle, the UI correctly treats it as thinking-capable but non-toggleable, so no toggle button is shown.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15217 **Author:** [@dhirajlochib](https://github.com/dhirajlochib) **Created:** 4/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `app/ui/thinking-capability-api` --- ### 📝 Commits (8) - [`1d0aeea`](https://github.com/ollama/ollama/commit/1d0aeeaf803e5279b7c5b4f0dabd94fa4d75068f) app/ui: enable thinking toggle for all thinking-capable models - [`5191947`](https://github.com/ollama/ollama/commit/51919477253ad23ec0f47605aba119e5770f52c9) parsers: add CanDisableThinking and thinking_toggle capability - [`2476b0a`](https://github.com/ollama/ollama/commit/2476b0a80cfa338c9bb6fbfaa1fa12a137bf249b) server: remove stray disk space check and fix gofmt - [`97a1110`](https://github.com/ollama/ollama/commit/97a1110e58ddaf75b865fd0294c1801b547bd635) Merge origin/main into app/ui/thinking-capability-api - [`697b97f`](https://github.com/ollama/ollama/commit/697b97f69154b82200a41c677360cc64feadef14) Merge branch 'main' into app/ui/thinking-capability-api - [`5ec063a`](https://github.com/ollama/ollama/commit/5ec063a7881b8abfc5bd912f9e9770cb577507ed) parsers: add CanDisableThinking to Gemma4Parser - [`cde925b`](https://github.com/ollama/ollama/commit/cde925bbd2a9eba630ef1b1394abf1331613094f) app/ui: remove unused useHasThinkingCapability import - [`a431c66`](https://github.com/ollama/ollama/commit/a431c66906d9aac37c295f8df7cc3993c0dc365c) server: update test expectations for parser-based tool capabilities ### 📊 Changes **23 files changed** (+157 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/ChatForm.tsx` (+2 -2) 📝 `app/ui/app/src/hooks/useModelCapabilities.ts` (+10 -0) 📝 `harmony/harmonyparser.go` (+5 -0) 📝 `model/parsers/cogito.go` (+4 -0) 📝 `model/parsers/deepseek3.go` (+4 -0) 📝 `model/parsers/functiongemma.go` (+1 -0) 📝 `model/parsers/gemma4.go` (+4 -0) 📝 `model/parsers/glm46.go` (+4 -0) 📝 `model/parsers/glm47.go` (+4 -0) 📝 `model/parsers/lfm2.go` (+4 -0) 📝 `model/parsers/ministral.go` (+4 -0) 📝 `model/parsers/nemotron3nano.go` (+1 -0) 📝 `model/parsers/olmo3.go` (+4 -0) 📝 `model/parsers/olmo3_think.go` (+4 -0) 📝 `model/parsers/parsers.go` (+5 -0) 📝 `model/parsers/parsers_test.go` (+42 -0) 📝 `model/parsers/qwen3.go` (+4 -0) 📝 `model/parsers/qwen35.go` (+4 -0) 📝 `model/parsers/qwen3coder.go` (+4 -0) 📝 `model/parsers/qwen3vl.go` (+4 -0) _...and 3 more files_ </details> ### 📄 Description Closes #14029 Hardcoding model families in the frontend would drift quickly, so I switched this to a server-driven capability check instead: 1. Added `CanDisableThinking() bool` to the `Parser` interface, so each parser explicitly declares whether it honors the `thinkValue` parameter. 2. Introduced a new `thinking_toggle` capability, emitted by `Capabilities()` only when the model truly supports enabling or disabling thinking. 3. Updated the UI to check for `thinking_toggle` rather than `thinking` when deciding whether to render the toggle. **Parsers returning `true` (toggle supported):** `qwen3-thinking`, `qwen3.5`, `deepseek3`, `cogito`, `lfm2-thinking`, `nemotron-3-nano`, `glm-4.7` **Parsers returning `false` (thinking always enabled):** `qwen3-vl-thinking`, `olmo3-think`, `ministral`, `glm46`, `harmony` For remote/cloud models such as `minimax-m2`, `kimi-k2-thinking`, `qwen3-next`, etc., this is controlled by the remote registry config. If a model exposes `thinking` but not `thinking_toggle`, the UI correctly treats it as thinking-capable but non-toggleable, so no toggle button is shown. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:34:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20354