[PR #4521] [CLOSED] implement tunable registry defaults for registry and update mirrors #22053

Closed
opened 2026-04-19 16:03:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4521
Author: @ghost
Created: 5/19/2024
Status: Closed

Base: mainHead: main


📝 Commits (2)

  • 45ff215 implement tunable registry defaults for mirror registries
  • 6204941 refactor and fix setFromEnvString

📊 Changes

7 files changed (+91 additions, -32 deletions)

View changed files

📝 app/lifecycle/updater.go (+2 -2)
📝 server/modelpath.go (+8 -13)
📝 server/modelpath_test.go (+7 -6)
types/defaults/environment_variables.go (+43 -0)
types/defaults/registries.go (+15 -0)
types/defaults/updates.go (+9 -0)
📝 types/model/name.go (+7 -11)

📄 Description

What is the problem this change solves?

In large environments with many cloud instances are running ollama serve, accidentally pushing code to run ollama pull llama3 can result in 100's of cloud instances are trying to download from ollama.ai.

The correct change for production should have been ollama pull https://registry.prod.someside.tld/library/llama3. The registry mirror at registry.prod.someside.tld is necessary to reduce bandwidth costs for high volume data, like an AI model or container image.

Mistakes like this can go unnoticed by novices building scalable infrastructure for their developers, until they get the resulting bill.

Also registry owners often have to implement rate limiting to keep bandwidth costs down. Hitting a rate limit in a production environment often results in an outage. Further making convenient mirroring options desirable.

What are the changes being made?

  • Created a new package called defaults to hold tunable values.
  • Moved variables related to endpoints to a single package called github.com/ollama/ollama/types/defaults
  • Exposes control to admins via environment variables.

Are there any tasks remaining?

I need some guidance on how testing should work for these changes.


🔄 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/4521 **Author:** [@ghost](https://github.com/ghost) **Created:** 5/19/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`45ff215`](https://github.com/ollama/ollama/commit/45ff215e2cd676add344a7cbf5ffc21500097f11) implement tunable registry defaults for mirror registries - [`6204941`](https://github.com/ollama/ollama/commit/6204941d069c46264c6b73736d65b071dbcbae32) refactor and fix setFromEnvString ### 📊 Changes **7 files changed** (+91 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `app/lifecycle/updater.go` (+2 -2) 📝 `server/modelpath.go` (+8 -13) 📝 `server/modelpath_test.go` (+7 -6) ➕ `types/defaults/environment_variables.go` (+43 -0) ➕ `types/defaults/registries.go` (+15 -0) ➕ `types/defaults/updates.go` (+9 -0) 📝 `types/model/name.go` (+7 -11) </details> ### 📄 Description # What is the problem this change solves? In large environments with many cloud instances are running `ollama serve`, accidentally pushing code to run `ollama pull llama3` can result in 100's of cloud instances are trying to download from `ollama.ai`. The correct change for production should have been `ollama pull https://registry.prod.someside.tld/library/llama3`. The registry mirror at `registry.prod.someside.tld` is necessary to reduce bandwidth costs for high volume data, like an AI model or container image. Mistakes like this can go unnoticed by novices building scalable infrastructure for their developers, until they get the resulting bill. Also registry owners often have to implement rate limiting to keep bandwidth costs down. Hitting a rate limit in a production environment often results in an outage. Further making convenient mirroring options desirable. # What are the changes being made? - Created a new package called `defaults` to hold tunable values. - Moved variables related to endpoints to a single package called `github.com/ollama/ollama/types/defaults` - Exposes control to admins via environment variables. # Are there any tasks remaining? I need some guidance on how testing should work for these changes. --- <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-19 16:03:36 -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#22053