[PR #9746] [MERGED] server/internal/client: use chunksums for concurrent blob verification #44299

Closed
opened 2026-04-24 23:48:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9746
Author: @bmizerany
Created: 3/13/2025
Status: Merged
Merged: 3/14/2025
Merged by: @bmizerany

Base: mainHead: bmizerany/chunksums


📝 Commits (1)

  • 0ad94c4 server/internal/client: use chunksums for concurrent blob verification

📊 Changes

8 files changed (+433 additions, -283 deletions)

View changed files

📝 server/internal/cache/blob/cache.go (+22 -32)
server/internal/cache/blob/chunked.go (+66 -0)
📝 server/internal/cache/blob/digest.go (+4 -0)
📝 server/internal/chunks/chunks.go (+10 -7)
📝 server/internal/client/ollama/registry.go (+198 -154)
📝 server/internal/client/ollama/registry_test.go (+3 -1)
📝 server/internal/registry/server.go (+98 -69)
📝 server/internal/registry/server_test.go (+32 -20)

📄 Description

Replace large-chunk blob downloads with parallel small-chunk verification to solve timeout and performance issues. Registry users experienced progressively slowing download speeds as large-chunk transfers aged, often timing out completely.

The previous approach downloaded blobs in a few large chunks but required a separate, single-threaded pass to read the entire blob back from disk for verification after download completion.

This change uses the new chunksums API to fetch many smaller chunk+digest pairs, allowing concurrent downloads and immediate verification as each chunk arrives. Chunks are written directly to their final positions, eliminating the entire separate verification pass.

The result is more reliable downloads that maintain speed throughout the transfer process and significantly faster overall completion, especially over unstable connections or with large blobs.


🔄 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/9746 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 3/13/2025 **Status:** ✅ Merged **Merged:** 3/14/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/chunksums` --- ### 📝 Commits (1) - [`0ad94c4`](https://github.com/ollama/ollama/commit/0ad94c4b8ef837020bd58cac06118bb10489b315) server/internal/client: use chunksums for concurrent blob verification ### 📊 Changes **8 files changed** (+433 additions, -283 deletions) <details> <summary>View changed files</summary> 📝 `server/internal/cache/blob/cache.go` (+22 -32) ➕ `server/internal/cache/blob/chunked.go` (+66 -0) 📝 `server/internal/cache/blob/digest.go` (+4 -0) 📝 `server/internal/chunks/chunks.go` (+10 -7) 📝 `server/internal/client/ollama/registry.go` (+198 -154) 📝 `server/internal/client/ollama/registry_test.go` (+3 -1) 📝 `server/internal/registry/server.go` (+98 -69) 📝 `server/internal/registry/server_test.go` (+32 -20) </details> ### 📄 Description Replace large-chunk blob downloads with parallel small-chunk verification to solve timeout and performance issues. Registry users experienced progressively slowing download speeds as large-chunk transfers aged, often timing out completely. The previous approach downloaded blobs in a few large chunks but required a separate, single-threaded pass to read the entire blob back from disk for verification after download completion. This change uses the new chunksums API to fetch many smaller chunk+digest pairs, allowing concurrent downloads and immediate verification as each chunk arrives. Chunks are written directly to their final positions, eliminating the entire separate verification pass. The result is more reliable downloads that maintain speed throughout the transfer process and significantly faster overall completion, especially over unstable connections or with large blobs. --- <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-24 23:48:06 -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#44299