[PR #9282] [CLOSED] runner: enable returning more info from runner processing #23450

Closed
opened 2026-04-19 17:00:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9282
Author: @BruceMacD
Created: 2/22/2025
Status: Closed

Base: mainHead: brucemacd/runner-completion


📝 Commits (1)

  • d5eae82 runner: enable returning more info from runner processing

📊 Changes

6 files changed (+376 additions, -228 deletions)

View changed files

📝 llm/server.go (+61 -2)
📝 llm/server_test.go (+149 -0)
📝 runner/common/stop.go (+27 -52)
📝 runner/common/stop_test.go (+68 -88)
📝 runner/llamarunner/runner.go (+35 -43)
📝 runner/ollamarunner/runner.go (+36 -43)

📄 Description

This refactor enables returning additional information from the LLM runner beyond just text. Currently, we only return the raw prediction text, but we need more flexibility to include metadata like logprobs.

The change introduces moves the CompletionResponse struct to the common package and converts the internal response handling from simple strings to these structured objects. All the runner code (both llama and ollama implementations) now works with this structure while maintaining the same text processing logic.

With this foundation in place, my follow-up PR can easily add logprobs to the response during batch processing, when tokens are actually being generated, without needing to restructure the whole pipeline again.


🔄 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/9282 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 2/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `brucemacd/runner-completion` --- ### 📝 Commits (1) - [`d5eae82`](https://github.com/ollama/ollama/commit/d5eae8248dea951b82dca0a9d72b4800f629700f) runner: enable returning more info from runner processing ### 📊 Changes **6 files changed** (+376 additions, -228 deletions) <details> <summary>View changed files</summary> 📝 `llm/server.go` (+61 -2) 📝 `llm/server_test.go` (+149 -0) 📝 `runner/common/stop.go` (+27 -52) 📝 `runner/common/stop_test.go` (+68 -88) 📝 `runner/llamarunner/runner.go` (+35 -43) 📝 `runner/ollamarunner/runner.go` (+36 -43) </details> ### 📄 Description This refactor enables returning additional information from the LLM runner beyond just text. Currently, we only return the raw prediction text, but we need more flexibility to include metadata like logprobs. The change introduces moves the CompletionResponse struct to the common package and converts the internal response handling from simple strings to these structured objects. All the runner code (both llama and ollama implementations) now works with this structure while maintaining the same text processing logic. With this foundation in place, my follow-up PR can easily add logprobs to the response during batch processing, when tokens are actually being generated, without needing to restructure the whole pipeline again. --- <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-19 17:00:31 -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#23450