[PR #4382] Allow XDG user directories #22014

Open
opened 2026-04-19 16:02:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4382
Author: @noahgitsham
Created: 5/12/2024
Status: 🔄 Open

Base: mainHead: xdg-base-dir


📝 Commits (1)

  • e1f3834 Allow XDG user directories

📊 Changes

4 files changed (+39 additions, -3 deletions)

View changed files

📝 auth/auth.go (+8 -0)
📝 cmd/cmd.go (+13 -2)
📝 readline/history.go (+11 -1)
📝 server/modelpath.go (+7 -0)

📄 Description

Addresses #228. This is my first time writing go, please feel free to correct any bad code. *

This change defaults to using the XDG Base Directory Specification for the history file and private key files which are currently generated in the .ollama directory.
It will still use .ollama if it exists (hence shouldn't break current setups), but allows use of $XDG_DATA_HOME/ollama instead.

I am unsure if/where these should be moved to, do they also belong in XDG_DATA_HOME?

I'm also unsure if I need to add/change anything here, I'm assuming my changes don't even affect windows, so no?

I simply searched the repo for ".ollama" to find stuff to change, please let me know if I missed anything.
I have only tested and designed this to work on Linux, let me know if this doesn't work for macOS.

*A styleguide and/or contributing document would be great #2231


🔄 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/4382 **Author:** [@noahgitsham](https://github.com/noahgitsham) **Created:** 5/12/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `xdg-base-dir` --- ### 📝 Commits (1) - [`e1f3834`](https://github.com/ollama/ollama/commit/e1f383437ec96e27e27f124e4b9b73ebcb0a03f4) Allow XDG user directories ### 📊 Changes **4 files changed** (+39 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `auth/auth.go` (+8 -0) 📝 `cmd/cmd.go` (+13 -2) 📝 `readline/history.go` (+11 -1) 📝 `server/modelpath.go` (+7 -0) </details> ### 📄 Description Addresses #228. This is my first time writing go, please feel free to correct any bad code. * This change defaults to using the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) for the history file and private key files which are currently generated in the `.ollama` directory. It will still use `.ollama` if it exists (hence shouldn't break current setups), but allows use of `$XDG_DATA_HOME/ollama` instead. I am unsure if/where these should be moved to, do they also belong in XDG_DATA_HOME? - https://github.com/ollama/ollama/blob/4ec7445a6f678b6efc773bb9fa886d7c9b075577/app/store/store_linux.go#L15 - https://github.com/ollama/ollama/blob/4ec7445a6f678b6efc773bb9fa886d7c9b075577/macapp/src/index.ts#L27 I'm also unsure if I need to add/change anything here, I'm assuming my changes don't even affect windows, so no? - https://github.com/ollama/ollama/blob/4ec7445a6f678b6efc773bb9fa886d7c9b075577/app/ollama.iss#L122 I simply searched the repo for ".ollama" to find stuff to change, please let me know if I missed anything. I have only tested and designed this to work on Linux, let me know if this doesn't work for macOS. *A styleguide and/or contributing document would be great #2231 --- <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:02:00 -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#22014