[PR #14648] [MERGED] openai: split mixed thinking stream chunks via ToChunks #14763

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14648
Author: @ParthSareen
Created: 3/5/2026
Status: Merged
Merged: 3/11/2026
Merged by: @ParthSareen

Base: mainHead: parth-oai-split-thinking-content-tc


📝 Commits (4)

  • 61a4a64 openai: split mixed thinking stream chunks via ToChunks
  • 1af771a openai: refine split chunk logprobs handling
  • 9da405e openai: simplify split chunk construction
  • e47286b add guard and warn for chunk size 0

📊 Changes

4 files changed (+627 additions, -14 deletions)

View changed files

📝 middleware/openai.go (+20 -12)
📝 middleware/openai_test.go (+293 -0)
📝 openai/openai.go (+31 -2)
📝 openai/openai_test.go (+283 -0)

📄 Description

We can potentially mix thinking with content or tool calls. While there is no canonical way of doing this, the generally accepted way is to have them emitted as separate chunks.


🔄 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/14648 **Author:** [@ParthSareen](https://github.com/ParthSareen) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@ParthSareen](https://github.com/ParthSareen) **Base:** `main` ← **Head:** `parth-oai-split-thinking-content-tc` --- ### 📝 Commits (4) - [`61a4a64`](https://github.com/ollama/ollama/commit/61a4a646b8f9b7b4af0f3f0294ad64d036d9d411) openai: split mixed thinking stream chunks via ToChunks - [`1af771a`](https://github.com/ollama/ollama/commit/1af771ac72e0e6d614d95a34f351ad565a6942f3) openai: refine split chunk logprobs handling - [`9da405e`](https://github.com/ollama/ollama/commit/9da405e219cdfd70a82bccddd61b15d7d57f1e13) openai: simplify split chunk construction - [`e47286b`](https://github.com/ollama/ollama/commit/e47286ba02becd8c08b9fe9ffcc5000c21d90dcb) add guard and warn for chunk size 0 ### 📊 Changes **4 files changed** (+627 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `middleware/openai.go` (+20 -12) 📝 `middleware/openai_test.go` (+293 -0) 📝 `openai/openai.go` (+31 -2) 📝 `openai/openai_test.go` (+283 -0) </details> ### 📄 Description We can potentially mix thinking with content or tool calls. While there is no canonical way of doing this, the generally accepted way is to have them emitted as separate chunks. --- <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-13 01:02:13 -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#14763