[PR #12729] Add Multi-Model Pull and Multi-Path Storage Support #13928

Open
opened 2026-04-13 00:40:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12729
Author: @A-Akhil
Created: 10/22/2025
Status: 🔄 Open

Base: mainHead: multi-model-feature


📝 Commits (4)

  • 9aaeb43 cmd: update PullHandler to support pulling multiple models
  • 5435e48 cmd: add parallel download support for models
  • 934e035 refactor: enhance model path handling with multi-path support and validation
  • e8443c4 cmd: ensure parallel flag existence check in PullHandler

📊 Changes

7 files changed (+336 additions, -116 deletions)

View changed files

📝 cmd/cmd.go (+80 -53)
📝 envconfig/config.go (+88 -5)
📝 go.mod (+19 -18)
📝 server/images.go (+2 -2)
📝 server/layer.go (+4 -3)
📝 server/manifest.go (+50 -34)
📝 server/modelpath.go (+93 -1)

📄 Description

This PR reintroduces the previously developed feature from #10896, enabling:

1. Multi-Model Pull

# Sequential pull
ollama pull gemma3:4b gemma3:1b  

# Parallel pull
ollama pull gemma3:4b gemma3:1b --parallel

2. Multi-Path Model Storage

  • The OLLAMA_MODELS environment variable can now accept multiple paths for model discovery and storage.
  • Supports colon-separated paths on Unix/Linux/macOS and semicolon-separated paths on Windows.
  • First path is used for new downloads; all paths are considered for model discovery.
  • Addresses issue [#7997](https://github.com/ollama/ollama/issues/7997)
  • Example usage:
# Unix/macOS
export OLLAMA_MODELS="/home/user/models:/mnt/shared/models:/opt/ollama/models"

# Windows
set OLLAMA_MODELS="C:\Users\user\models;D:\shared\models;E:\ollama\models"

Key Points

  • Backward compatible: single-path setups continue to work.
  • Read operations search across all configured paths; write operations use the primary path.
  • Fully tested for multi-model pull and multi-path storage across platforms.

Note

This PR reintroduces the feature from #10896. The original PR was force-pushed and closed after merging all commits into main. This new feature branch restores the original changes for review and integration.


🔄 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/12729 **Author:** [@A-Akhil](https://github.com/A-Akhil) **Created:** 10/22/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `multi-model-feature` --- ### 📝 Commits (4) - [`9aaeb43`](https://github.com/ollama/ollama/commit/9aaeb43f403d11e8878e226b037770709d1dc5ad) cmd: update PullHandler to support pulling multiple models - [`5435e48`](https://github.com/ollama/ollama/commit/5435e487f32e854f440fcda33fdd95b739028629) cmd: add parallel download support for models - [`934e035`](https://github.com/ollama/ollama/commit/934e03522247423ea3d6c07860de5060d0163bbe) refactor: enhance model path handling with multi-path support and validation - [`e8443c4`](https://github.com/ollama/ollama/commit/e8443c41be4501878fd1404fe048c3153d23a234) cmd: ensure parallel flag existence check in PullHandler ### 📊 Changes **7 files changed** (+336 additions, -116 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+80 -53) 📝 `envconfig/config.go` (+88 -5) 📝 `go.mod` (+19 -18) 📝 `server/images.go` (+2 -2) 📝 `server/layer.go` (+4 -3) 📝 `server/manifest.go` (+50 -34) 📝 `server/modelpath.go` (+93 -1) </details> ### 📄 Description This PR reintroduces the previously developed feature from #10896, enabling: ### 1. Multi-Model Pull * Pull multiple models in a single command, either sequentially or in parallel. * Addresses issue [[#10890](https://github.com/ollama/ollama/issues/10890)](https://github.com/ollama/ollama/issues/10890) * Example usage: ```bash # Sequential pull ollama pull gemma3:4b gemma3:1b # Parallel pull ollama pull gemma3:4b gemma3:1b --parallel ``` ### 2. Multi-Path Model Storage * The `OLLAMA_MODELS` environment variable can now accept multiple paths for model discovery and storage. * Supports colon-separated paths on Unix/Linux/macOS and semicolon-separated paths on Windows. * First path is used for new downloads; all paths are considered for model discovery. * Addresses issue [[#7997](https://github.com/ollama/ollama/issues/7997)](https://github.com/ollama/ollama/issues/7997) * Example usage: ```bash # Unix/macOS export OLLAMA_MODELS="/home/user/models:/mnt/shared/models:/opt/ollama/models" # Windows set OLLAMA_MODELS="C:\Users\user\models;D:\shared\models;E:\ollama\models" ``` ### Key Points * Backward compatible: single-path setups continue to work. * Read operations search across all configured paths; write operations use the primary path. * Fully tested for multi-model pull and multi-path storage across platforms. ### Note This PR reintroduces the feature from #10896. The original PR was force-pushed and closed after merging all commits into `main`. This new feature branch restores the original changes for review and integration. --- <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:40:30 -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#13928