[PR #9463] [MERGED] server/internal/client/ollama: hold DiskCache on Registry #12972

Closed
opened 2026-04-13 00:14:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9463
Author: @bmizerany
Created: 3/2/2025
Status: Merged
Merged: 3/3/2025
Merged by: @bmizerany

Base: mainHead: bmizrerany/registryholdscache


📝 Commits (1)

  • 763eb5a server/internal/client/ollama: hold DiskCache on Registry

📊 Changes

8 files changed (+132 additions, -105 deletions)

View changed files

📝 server/internal/client/ollama/registry.go (+49 -16)
📝 server/internal/client/ollama/registry_test.go (+52 -50)
📝 server/internal/client/ollama/trace.go (+3 -0)
📝 server/internal/cmd/opp/opp.go (+21 -18)
📝 server/internal/registry/server.go (+1 -3)
📝 server/internal/registry/server_test.go (+3 -3)
📝 server/routes.go (+2 -8)
📝 server/routes_test.go (+1 -7)

📄 Description

Previously, using a Registry required a DiskCache to be passed in for use in various methods. This was a bit cumbersome, as the DiskCache is required for most operations, and the DefaultCache is used in most of those cases. This change makes the DiskCache an optional field on the Registry struct.

This also changes DefaultCache to initialize on first use. This is to not burden clients with the cost of creating a new cache per use, or having to hold onto a cache for the lifetime of the Registry.

Also, slip in some minor docs updates for Trace.


🔄 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/9463 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 3/2/2025 **Status:** ✅ Merged **Merged:** 3/3/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizrerany/registryholdscache` --- ### 📝 Commits (1) - [`763eb5a`](https://github.com/ollama/ollama/commit/763eb5afe78ee9b393ab91f206b1867daf8d5f8f) server/internal/client/ollama: hold DiskCache on Registry ### 📊 Changes **8 files changed** (+132 additions, -105 deletions) <details> <summary>View changed files</summary> 📝 `server/internal/client/ollama/registry.go` (+49 -16) 📝 `server/internal/client/ollama/registry_test.go` (+52 -50) 📝 `server/internal/client/ollama/trace.go` (+3 -0) 📝 `server/internal/cmd/opp/opp.go` (+21 -18) 📝 `server/internal/registry/server.go` (+1 -3) 📝 `server/internal/registry/server_test.go` (+3 -3) 📝 `server/routes.go` (+2 -8) 📝 `server/routes_test.go` (+1 -7) </details> ### 📄 Description Previously, using a Registry required a DiskCache to be passed in for use in various methods. This was a bit cumbersome, as the DiskCache is required for most operations, and the DefaultCache is used in most of those cases. This change makes the DiskCache an optional field on the Registry struct. This also changes DefaultCache to initialize on first use. This is to not burden clients with the cost of creating a new cache per use, or having to hold onto a cache for the lifetime of the Registry. Also, slip in some minor docs updates for Trace. --- <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-13 00:14:13 -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#12972