From 5e52d91c5c9070315d69e0d351e5dc7f3007a37f Mon Sep 17 00:00:00 2001 From: YuBai Date: Tue, 10 Mar 2026 16:43:50 +0800 Subject: [PATCH] fix(store): respect QMD_EMBED_MODEL env var in DEFAULT_EMBED_MODEL store.ts hardcoded DEFAULT_EMBED_MODEL to "embeddinggemma", ignoring the QMD_EMBED_MODEL env var that llm.ts already respects. This caused formatQueryForEmbedding() to use the wrong prompt template during search when a custom embedding model (e.g. Qwen3-Embedding) was configured via the env var, because the hardcoded "embeddinggemma" string was passed as modelUri and isQwen3EmbeddingModel() returned false. Now store.ts reads process.env.QMD_EMBED_MODEL with "embeddinggemma" as fallback, consistent with llm.ts. Co-Authored-By: Oz --- src/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index 4c7f8a0f..e1033703 100644 --- a/src/store.ts +++ b/src/store.ts @@ -44,7 +44,7 @@ import { // ============================================================================= const HOME = process.env.HOME || "/tmp"; -export const DEFAULT_EMBED_MODEL = "embeddinggemma"; +export const DEFAULT_EMBED_MODEL = process.env.QMD_EMBED_MODEL ?? "embeddinggemma"; export const DEFAULT_RERANK_MODEL = "ExpedientFalcon/qwen3-reranker:0.6b-q8_0"; export const DEFAULT_QUERY_MODEL = "Qwen/Qwen3-1.7B"; export const DEFAULT_GLOB = "**/*.md";