Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please don’t clutter the user home directory #228

Open
klmr opened this issue Jul 27, 2023 · 9 comments
Open

Please don’t clutter the user home directory #228

klmr opened this issue Jul 27, 2023 · 9 comments
Labels
feature request New feature or request

Comments

@klmr
Copy link

klmr commented Jul 27, 2023

Currently Ollama is writing into a directory in the user home, ~/.ollama.

However, the user home directory should be under the user’s control, and applications may only write into it if explicitly instructed to do so by the user. Settings etc. belong in OS-specific locations; in particular, under ~/Library on macOS, under %AppData% or %LocalAppData% on Windows and, by convention, in directories following the XDG basedir specification on Linux.

@lukeman
Copy link

lukeman commented Jul 28, 2023

For now I'm symlinking ~/.ollama to another spot in macOS, but agree it would make sense to utilize ~/Library, %AppData% and the like while letting folks choose if they'd like to store things (particularly model blobs/manifests) in a user-defined spot.

A few related tickets, albeit these are more focused on just the model blobs:

@klmr
Copy link
Author

klmr commented Oct 27, 2023

If I understand correctly, #897 does not implement this feature request, since it only changes the path of the model files, but the path ~/.ollama remains in use for other purposes (see https://github.com/search?q=repo%3Ajmorganca%2Follama%20%22.ollama%22&type=code), notably for the server authentication, logs and readline history.

(There’s another, minor, issue that this solution still requires explicitly setting an environment variable instead of using the appropriate location by default: ideally ~/.ollama should only ever be used as a fallback [if it exists and the correct location doesn’t] for backwards compatibility.)

@BruceMacD BruceMacD reopened this Oct 27, 2023
@BruceMacD BruceMacD removed their assignment Oct 27, 2023
@miku
Copy link

miku commented Nov 7, 2023

I'd like to add that there is a quasi-standard called XDG, which helps to keep $HOME clean and to organize applications files.

E.g. the model files could live under $XDG_DATA_HOME/ollama/models - which would mostly be $HOME/.local/share/ollama/models.

This would reduce surprises, at least for those familiar with XDG.

@luckydonald
Copy link

luckydonald commented Jan 15, 2024

I mean a user being able to set OLLAMA_HOME would be sufficient.
And align perfectly with OLLAMA_MODELS of #897.

I personally like the location in the user dir; a lot of other linuxy tools do that as well.
And for the models, I share them with multiple users of the computers (they are huge) so I symlinked the models folder to a shared location anyway.

@mozlima
Copy link

mozlima commented Jan 15, 2024

Maybe:

os.UserConfigDir

os.UserCacheDir

@noahgitsham
Copy link
Contributor

Made #4382 to address this, but don't know much about macOS to debug the failing test. Any help would be greatly appreciated.

@abitrolly
Copy link
Contributor

This is the second most voted issue.

Will a config file placed in ~/.config/ollama/ dir solve the problem?

#4821 moves model path configuration into unified location. The next step would be to add config file to read values for these variables.

@leg7
Copy link

leg7 commented Nov 5, 2024

Any updates on this?

@philocalyst
Copy link

philocalyst commented Jan 13, 2025

Don't know if this deserves its own separate issue, but when utilizing the OLLAMA_HOME env variable, all data is moved and accessed as expected, but keys are ignored if in the OLLAMA_HOME assigned-directory, and ollama produces a directory containing duplicates to read from.
ishare-1736742156-ghostty
ishare-1736742108-ghostty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.