[GH-ISSUE #730] On Windows, support configurable paths for storage #46849

Closed
opened 2026-04-28 00:52:29 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @clebio on GitHub (Oct 8, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/730

Originally assigned to: @BruceMacD on GitHub.

As a user of ollama on Windows, I would like to be able to store models and other large files on a secondary drive of my choosing.

I built from source and ran the server, then tried pulling models and realized I would run out of disk space. On my gaming rig, my C drive (where $HOME is) is fairly constrained and I store most things on a larger D.

I was able to work around this limitation with the following diff, but ideally this would be a command-line opt. I defer to y'all maintainers as to how you'd refactor this. Thanks for the awesome work!

diff --git a/server/modelpath.go b/server/modelpath.go
index c6798a0..df48afc 100644
--- a/server/modelpath.go
+++ b/server/modelpath.go
@@ -123,10 +123,7 @@ func GetManifestPath() (string, error) {
 }

 func GetBlobsPath(digest string) (string, error) {
-       home, err := os.UserHomeDir()
-       if err != nil {
-               return "", err
-       }
+       home := "/d/ollama-data"

        if runtime.GOOS == "windows" {
                digest = strings.ReplaceAll(digest, ":", "-")
Originally created by @clebio on GitHub (Oct 8, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/730 Originally assigned to: @BruceMacD on GitHub. As a user of ollama on Windows, I would like to be able to store models and other large files on a secondary drive of my choosing. I built from source and ran the server, then tried pulling models and realized I would run out of disk space. On my gaming rig, my C drive (where `$HOME` is) is fairly constrained and I store most things on a larger D. I was able to work around this limitation with the following diff, but ideally this would be a command-line opt. I defer to y'all maintainers as to how you'd refactor this. Thanks for the awesome work! ```diff diff --git a/server/modelpath.go b/server/modelpath.go index c6798a0..df48afc 100644 --- a/server/modelpath.go +++ b/server/modelpath.go @@ -123,10 +123,7 @@ func GetManifestPath() (string, error) { } func GetBlobsPath(digest string) (string, error) { - home, err := os.UserHomeDir() - if err != nil { - return "", err - } + home := "/d/ollama-data" if runtime.GOOS == "windows" { digest = strings.ReplaceAll(digest, ":", "-") ```
Author
Owner

@mjtechguy commented on GitHub (Oct 10, 2023):

+1

<!-- gh-comment-id:1754270250 --> @mjtechguy commented on GitHub (Oct 10, 2023): +1
Author
Owner

@BruceMacD commented on GitHub (Oct 30, 2023):

Great feedback, this scenario was one of my targets for #897, it is now possible in the most recent release.

<!-- gh-comment-id:1785491235 --> @BruceMacD commented on GitHub (Oct 30, 2023): Great feedback, this scenario was one of my targets for #897, it is now possible in the most recent release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46849