[PR #14946] [MERGED] pull/push: refine safetensors #40808

Closed
opened 2026-04-23 01:37:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14946
Author: @dhiltgen
Created: 3/18/2026
Status: Merged
Merged: 4/8/2026
Merged by: @dhiltgen

Base: mainHead: pull


📝 Commits (4)

📊 Changes

4 files changed (+591 additions, -67 deletions)

View changed files

📝 x/imagegen/transfer/download.go (+85 -18)
📝 x/imagegen/transfer/transfer.go (+15 -1)
📝 x/imagegen/transfer/transfer_test.go (+386 -0)
📝 x/imagegen/transfer/upload.go (+105 -48)

📄 Description

  • Body drain in resolve() — drain response body before close so Go's HTTP client can reuse TCP connections instead of opening a new one per blob (1,075 extra TCP+TLS handshakes eliminated)
  • Skip speed recording for tiny blobs (<100KB) — prevents HTTP-overhead-dominated transfer times from poisoning the median, which the stall detector uses to cancel "too slow" downloads
  • Resume support for large blobs (>=64MB) — on failure, preserves partial .tmp files; on retry, re-hashes existing datak and sends Range header to download only remaining bytes; gracefully falls back to full download if server returns 200 instead of 206; SHA256 verification catches corrupt partials

🔄 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/14946 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 3/18/2026 **Status:** ✅ Merged **Merged:** 4/8/2026 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `pull` --- ### 📝 Commits (4) - [`86963f6`](https://github.com/ollama/ollama/commit/86963f6740681e19f8c4fd73b8cbe7c22e0e37cd) pull: refine safetensors pull - [`08ca648`](https://github.com/ollama/ollama/commit/08ca64833e79bf8ae0376c183712c91ef16730bb) harden push - [`2861772`](https://github.com/ollama/ollama/commit/28617723af35c16b4fdeab09fb5743f09d23504f) review comments - [`a48248d`](https://github.com/ollama/ollama/commit/a48248d1a79e58ee13af50e44b2d64b457d52b2e) review comments ### 📊 Changes **4 files changed** (+591 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `x/imagegen/transfer/download.go` (+85 -18) 📝 `x/imagegen/transfer/transfer.go` (+15 -1) 📝 `x/imagegen/transfer/transfer_test.go` (+386 -0) 📝 `x/imagegen/transfer/upload.go` (+105 -48) </details> ### 📄 Description - Body drain in resolve() — drain response body before close so Go's HTTP client can reuse TCP connections instead of opening a new one per blob (1,075 extra TCP+TLS handshakes eliminated) - Skip speed recording for tiny blobs (<100KB) — prevents HTTP-overhead-dominated transfer times from poisoning the median, which the stall detector uses to cancel "too slow" downloads - Resume support for large blobs (>=64MB) — on failure, preserves partial .tmp files; on retry, re-hashes existing datak and sends Range header to download only remaining bytes; gracefully falls back to full download if server returns 200 instead of 206; SHA256 verification catches corrupt partials --- <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 01:37:25 -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#40808