[PR #3960] [CLOSED] server: add dynamic configuration for download variables #37211

Closed
opened 2026-04-22 21:55:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3960
Author: @jzila
Created: 4/26/2024
Status: Closed

Base: mainHead: fix-downloads


📝 Commits (3)

  • bc19952 server: add dynamic configuration for download variables
  • 5db1a35 util: load the size of env vars dynamically when parsing an int
  • 83431b9 images: remove extraneous return

📊 Changes

3 files changed (+43 additions, -13 deletions)

View changed files

📝 server/download.go (+6 -8)
📝 server/images.go (+10 -5)
server/util.go (+27 -0)

📄 Description

Issue

I've found that downloads can be unreliable for large models, either due to errors during the download or during processing the digest.

Workaround

Add some environment variables to the server to allow runtime configuration of the number of parallel downloads and how big the chunks can be.

Follow-up

Ideally the server would be configured to respect the ?partNumber query parameters that the returned x-amz-mp-parts-count header implies should be supported. I'd also like it to support x-amz-checksum-mode=ENABLED (currently returns a 501 NOT IMPLEMENTED), so that each part number returns an expected digest in the response headers for GET and HEAD. This would enable us to split the digest by parts, so that if a part download fails, we don't need to retrieve the full model each time.

It seems that the current implementation is done via github.com/distribution/distribution, which delegates its Range handling to http.ServeContent, and as such does not support the partNumber functionality implied by the CloudFlare response headers. So any such support would have to fork github.com/distribution/distribution. CloudFlare also does not appear to support these headers.


🔄 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/3960 **Author:** [@jzila](https://github.com/jzila) **Created:** 4/26/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-downloads` --- ### 📝 Commits (3) - [`bc19952`](https://github.com/ollama/ollama/commit/bc199527aef01e86276c6df3e90c6fd8c46772b5) server: add dynamic configuration for download variables - [`5db1a35`](https://github.com/ollama/ollama/commit/5db1a356a296e482efff8bc480ee4a2e823cbd6c) util: load the size of env vars dynamically when parsing an int - [`83431b9`](https://github.com/ollama/ollama/commit/83431b9c983e22db630cb4caaef75c07d50e5080) images: remove extraneous return ### 📊 Changes **3 files changed** (+43 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `server/download.go` (+6 -8) 📝 `server/images.go` (+10 -5) ➕ `server/util.go` (+27 -0) </details> ### 📄 Description ## Issue I've found that downloads can be unreliable for large models, either due to errors during the download or during processing the digest. ## Workaround Add some environment variables to the server to allow runtime configuration of the number of parallel downloads and how big the chunks can be. ## Follow-up Ideally the server would be configured to respect the `?partNumber` query parameters that the returned `x-amz-mp-parts-count` header implies should be supported. I'd also like it to support `x-amz-checksum-mode=ENABLED` (currently returns a `501 NOT IMPLEMENTED`), so that each part number returns an expected digest in the response headers for `GET` and `HEAD`. This would enable us to split the digest by parts, so that if a part download fails, we don't need to retrieve the full model each time. It seems that the current implementation is done via [github.com/distribution/distribution](github.com/distribution/distribution), which delegates its `Range` handling to `http.ServeContent`, and as such does not support the `partNumber` functionality implied by the CloudFlare response headers. So any such support would have to fork github.com/distribution/distribution. CloudFlare also does not appear to support these headers. --- <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-22 21:55:51 -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#37211