[PR #15856] Add --private flag to ollama push #77624

Open
opened 2026-05-05 10:17:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15856
Author: @anujbharambe
Created: 4/28/2026
Status: 🔄 Open

Base: mainHead: add-private-push-flag


📝 Commits (1)

  • c7557eb Add --private flag to ollama push

📊 Changes

10 files changed (+144 additions, -2 deletions)

View changed files

📝 api/types.go (+1 -0)
📝 cmd/cmd.go (+7 -1)
📝 cmd/cmd_test.go (+40 -0)
📝 server/images.go (+8 -0)
📝 server/internal/client/ollama/registry.go (+7 -0)
📝 server/internal/client/ollama/registry_test.go (+15 -0)
📝 server/routes.go (+1 -0)
📝 x/imagegen/transfer/transfer.go (+1 -0)
📝 x/imagegen/transfer/transfer_test.go (+53 -0)
📝 x/imagegen/transfer/upload.go (+11 -1)

📄 Description

Summary

Closes #8077 — cc @BruceMacD

Adds a --private boolean flag to ollama push that tells the registry to create the repository as private when first initialized during push.

ollama push username/my-model:latest --private

The visibility signal is communicated via a ?private=1 query parameter on the manifest PUT request to the registry, threaded through all push paths.


Changes

  • api/types.go: Add Private field to PushRequest
  • cmd/cmd.go: Register --private flag, extract and pass to request
  • server/routes.go: Pass Private to registryOptions
  • server/images.go: Append ?private=1 on standard push path; pass to UploadOptions on fast transfer path
  • x/imagegen/transfer/: Thread Private through UploadOptionsuploaderpushManifest
  • server/internal/client/ollama/registry.go: Add Private to PushParams, append to manifest commit URL
  • Tests added in cmd/cmd_test.go, registry_test.go, and transfer_test.go

🔄 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/15856 **Author:** [@anujbharambe](https://github.com/anujbharambe) **Created:** 4/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `add-private-push-flag` --- ### 📝 Commits (1) - [`c7557eb`](https://github.com/ollama/ollama/commit/c7557eba03e655362114cd3ae9a5f735ef7d496d) Add --private flag to ollama push ### 📊 Changes **10 files changed** (+144 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -0) 📝 `cmd/cmd.go` (+7 -1) 📝 `cmd/cmd_test.go` (+40 -0) 📝 `server/images.go` (+8 -0) 📝 `server/internal/client/ollama/registry.go` (+7 -0) 📝 `server/internal/client/ollama/registry_test.go` (+15 -0) 📝 `server/routes.go` (+1 -0) 📝 `x/imagegen/transfer/transfer.go` (+1 -0) 📝 `x/imagegen/transfer/transfer_test.go` (+53 -0) 📝 `x/imagegen/transfer/upload.go` (+11 -1) </details> ### 📄 Description ## Summary Closes #8077 — cc @BruceMacD Adds a `--private` boolean flag to `ollama push` that tells the registry to create the repository as private when first initialized during push. ``` ollama push username/my-model:latest --private ``` The visibility signal is communicated via a `?private=1` query parameter on the manifest PUT request to the registry, threaded through all push paths. --- ## Changes * **`api/types.go`**: Add `Private` field to `PushRequest` * **`cmd/cmd.go`**: Register `--private` flag, extract and pass to request * **`server/routes.go`**: Pass `Private` to `registryOptions` * **`server/images.go`**: Append `?private=1` on standard push path; pass to `UploadOptions` on fast transfer path * **`x/imagegen/transfer/`**: Thread `Private` through `UploadOptions` → `uploader` → `pushManifest` * **`server/internal/client/ollama/registry.go`**: Add `Private` to `PushParams`, append to manifest commit URL * **Tests added** in `cmd/cmd_test.go`, `registry_test.go`, and `transfer_test.go` --- <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-05-05 10:17:54 -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#77624