[PR #12044] llm/server: add option to ignore free memory size checks (#5700) #39569

Open
opened 2026-04-23 00:29:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12044
Author: @mjbogusz
Created: 8/23/2025
Status: 🔄 Open

Base: mainHead: 5700-server-envconfig-add-ignorememsize


📝 Commits (1)

  • 4cea875 llm/server: add option to ignore free memory size checks (#5700)

📊 Changes

2 files changed (+6 additions, -1 deletions)

View changed files

📝 envconfig/config.go (+3 -0)
📝 llm/server.go (+3 -1)

📄 Description

This PR adds an environment option to ignore free memory size checks: OLLAMA_IGNORE_MEMSIZE - it still prints the warning but allows the program to continue (and crash if the allocation fails down the line).

This is a workaround for #5700 and other cases, where high cache usage would make the naive check model_size > (vram_size + sys_free_mem + sys_free_swap) raise a false positive; fully detecting and taking into account e.g. ZFS cache usage would require much bigger changes that are potentially out of scope for this project.

If e.g. other variable name is preferred I'll be happy to adjust it.
Additionally, as I haven't worked with Golang before, all suggestions on improving the code are very welcome - though hopefully the changes are trivial enough to not require too many revisions.


🔄 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/12044 **Author:** [@mjbogusz](https://github.com/mjbogusz) **Created:** 8/23/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `5700-server-envconfig-add-ignorememsize` --- ### 📝 Commits (1) - [`4cea875`](https://github.com/ollama/ollama/commit/4cea875588ff0823d51156a011a16522af4b9e32) llm/server: add option to ignore free memory size checks (#5700) ### 📊 Changes **2 files changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `envconfig/config.go` (+3 -0) 📝 `llm/server.go` (+3 -1) </details> ### 📄 Description This PR adds an environment option to ignore free memory size checks: `OLLAMA_IGNORE_MEMSIZE` - it still prints the warning but allows the program to continue (and crash if the allocation fails down the line). This is a workaround for #5700 and other cases, where high cache usage would make the naive check `model_size > (vram_size + sys_free_mem + sys_free_swap)` raise a false positive; fully detecting and taking into account e.g. ZFS cache usage would require much bigger changes that are potentially out of scope for this project. If e.g. other variable name is preferred I'll be happy to adjust it. Additionally, as I haven't worked with Golang before, all suggestions on improving the code are very welcome - though hopefully the changes are trivial enough to not require too many revisions. --- <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-23 00:29:23 -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#39569