[PR #23931] [CLOSED] feat: convert Ollama reasoning (thinking) to <think> tags for generic OpenAI clients #50491

Closed
opened 2026-04-30 03:13:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23931
Author: @pvyswiss
Created: 4/21/2026
Status: Closed

Base: mainHead: feat/ollama-reasoning-as-think-tags


📝 Commits (1)

  • 447e5a5 feat: convert Ollama reasoning to tags for generic OpenAI clients

📊 Changes

1 file changed (+17 additions, -0 deletions)

View changed files

📝 backend/open_webui/utils/response.py (+17 -0)

📄 Description

Summary

Fixes #23923 (Ref: #23917 Bug 4)

  • Convert Ollama's message.thinking field to <think> tags in the standard content field
  • Generic OpenAI SDKs don't understand reasoning_content and silently drop reasoning tokens
  • Open WebUI's browser middleware already renders <think> tags as collapsible blocks -- fully backward-compatible

🔄 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/open-webui/open-webui/pull/23931 **Author:** [@pvyswiss](https://github.com/pvyswiss) **Created:** 4/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/ollama-reasoning-as-think-tags` --- ### 📝 Commits (1) - [`447e5a5`](https://github.com/open-webui/open-webui/commit/447e5a59284d4e4fc17e630dd1d0627e44944bd0) feat: convert Ollama reasoning to <think> tags for generic OpenAI clients ### 📊 Changes **1 file changed** (+17 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/response.py` (+17 -0) </details> ### 📄 Description ## Summary Fixes #23923 (Ref: #23917 Bug 4) - Convert Ollama's `message.thinking` field to `<think>` tags in the standard `content` field - Generic OpenAI SDKs don't understand `reasoning_content` and silently drop reasoning tokens - Open WebUI's browser middleware already renders `<think>` tags as collapsible blocks -- fully backward-compatible --- <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-30 03:13:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#50491