[PR #15421] env: expose user-visible OLLAMA_NUM_THREADS override #25687

Open
opened 2026-04-19 18:21:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15421
Author: @shalinib-ibm
Created: 4/8/2026
Status: 🔄 Open

Base: mainHead: set_num_threads


📝 Commits (1)

  • 367038f env: expose user-visible OLLAMA_NUM_THREADS override

📊 Changes

2 files changed (+9 additions, -0 deletions)

View changed files

📝 discover/gpu.go (+6 -0)
📝 envconfig/config.go (+3 -0)

📄 Description

This commit introduces the OLLAMA_NUM_THREADS environment variable to allow users to manually override the default inference thread count. This is particularly useful for performance tuning on architectures where automatic CPU detection may not be optimal.

This PR resolves merge conflicts from the original patch in #13122.


🔄 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/15421 **Author:** [@shalinib-ibm](https://github.com/shalinib-ibm) **Created:** 4/8/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `set_num_threads` --- ### 📝 Commits (1) - [`367038f`](https://github.com/ollama/ollama/commit/367038fc1b9c172effca2a9b9dfb1ba81879df5a) env: expose user-visible OLLAMA_NUM_THREADS override ### 📊 Changes **2 files changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `discover/gpu.go` (+6 -0) 📝 `envconfig/config.go` (+3 -0) </details> ### 📄 Description This commit introduces the OLLAMA_NUM_THREADS environment variable to allow users to manually override the default inference thread count. This is particularly useful for performance tuning on architectures where automatic CPU detection may not be optimal. This PR resolves merge conflicts from the original patch in #13122. --- <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 18:21:26 -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#25687