[PR #11291] server: add option to preserve think tags in chat #13499

Open
opened 2026-04-13 00:28:57 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11291

State: open
Merged: No


This commit introduces a preserve_think_block option to the chat API. When set to true, the server will not strip tags from the assistant's response content.

This is useful for agentic workflows and multi-turn reasoning where preserving the full model output, including thought processes, is required.

This also fixes a bug where the thinking parser was not active unless the think true parameter was explicitly set, causing think tags to be leaked to the user unexpectedly.

Fixes #11279

**Original Pull Request:** https://github.com/ollama/ollama/pull/11291 **State:** open **Merged:** No --- This commit introduces a preserve_think_block option to the chat API. When set to true, the server will not strip <think> tags from the assistant's response content. This is useful for agentic workflows and multi-turn reasoning where preserving the full model output, including thought processes, is required. This also fixes a bug where the thinking parser was not active unless the think true parameter was explicitly set, causing think tags to be leaked to the user unexpectedly. Fixes #11279
GiteaMirror added the pull-request label 2026-04-13 00:28:57 -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#13499