Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ function getConfigDir(): string {
if (process.env.QMD_CONFIG_DIR) {
return process.env.QMD_CONFIG_DIR;
}
// Respect XDG_CONFIG_HOME per XDG Base Directory Specification
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
if (xdgConfigHome) {
return join(xdgConfigHome, "qmd");
}
return join(homedir(), ".config", "qmd");
}

Expand Down
6 changes: 5 additions & 1 deletion src/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ export const DEFAULT_RERANK_MODEL_URI = DEFAULT_RERANK_MODEL;
export const DEFAULT_GENERATE_MODEL_URI = DEFAULT_GENERATE_MODEL;

// Local model cache directory
const MODEL_CACHE_DIR = join(homedir(), ".cache", "qmd", "models");
// Respect XDG_CACHE_HOME per XDG Base Directory Specification
const xdgCacheHome = process.env.XDG_CACHE_HOME;
const MODEL_CACHE_DIR = xdgCacheHome
? join(xdgCacheHome, "qmd", "models")
: join(homedir(), ".cache", "qmd", "models");
export const DEFAULT_MODEL_CACHE_DIR = MODEL_CACHE_DIR;

export type PullResult = {
Expand Down