Skip to content

Local, full Windows search replacement, clipboard manager, and launcher: files, apps, settings and semantic media search with Google's EmbeddingGemma 2.

Warm embeddings on search open, select chat models, and relaunch updates

ampersandru6676406a1145
diff --git a/native/docs/LOCALIZATION.md b/native/docs/LOCALIZATION.md
index f33da1f..bd924bd 100644
--- a/native/docs/LOCALIZATION.md
+++ b/native/docs/LOCALIZATION.md
@@ -6,7 +6,7 @@ Languages: English, Spanish, Brazilian Portuguese, French, German, Italian, Russ
## Coverage and boundaries
-All 13 catalogs contain the same 706 messages. This expanded pass covers application navigation, settings labels and help, hardware, scheduling, model/server controls, source/index options including RAW, search/clipboard/AI controls, About/update controls, confirmation dialogs, tray menu and app-owned status summaries. A source audit rejects unmarked literal labels in common UI controls. Catalog tests enforce key parity, non-empty values and preserved formatting placeholders.
+All 13 catalogs contain the same 709 messages. This expanded pass covers application navigation, settings labels and help, hardware, scheduling, model/server controls, source/index options including RAW, search/clipboard/AI controls, About/update controls, confirmation dialogs, tray menu and app-owned status summaries. A source audit rejects unmarked literal labels in common UI controls. Catalog tests enforce key parity, non-empty values and preserved formatting placeholders.
Filenames, model IDs, microphone/device names, saved-search names, user content, AI answers, GitHub release text, raw diagnostic logs and messages supplied by external servers are retained verbatim. Windows file dialogs use the OS language; the installer currently uses English. These are separate from application setting labels. Translations are machine-assisted and still need native-speaker terminology review; Hindi complex-script shaping also needs native review.
diff --git a/native/docs/SEARCH-WARMUP-TEST.md b/native/docs/SEARCH-WARMUP-TEST.md
new file mode 100644
index 0000000..0d06ee4
--- /dev/null
+++ b/native/docs/SEARCH-WARMUP-TEST.md
@@ -0,0 +1,10 @@
+# Search warm-up and model picker test build
+
+This is an unpublished follow-up to Beta 6 on PR 16; no new GitHub beta is created.
+
+- Models and AI → Embedding Model → Remote: enable Warm embedding model when search opens and Save. Hybrid and Semantic search opening sends a tiny real embedding request before typing; File/Folder Names does not. Remote warm-up is off by default. Local model startup retains the existing resource/game checks.
+- Chat's model label is now a dropdown. Discovered models are cached per server URL; selecting a model applies to subsequent turns in the current conversation without saving unrelated settings. Settings still defines the default model.
+- The updater explicitly requests relaunch after silent installation. An isolated Inno installer test verified both opt-in relaunch and no-launch behavior without touching the installed application.
+- Visual image searches no longer gain exact OCR word bonuses or prefilled OCR keyword hits. Explicit screenshot/text queries retain text matching. Singular/plural photo/picture/image prefixes are consistently ignored by keyword tokenization; raw model embeddings are unchanged.
+
+Rank Calibration is a search-time adjustment between text/image/audio channels. It does not classify photographs versus infographics and needs no index rebuild. Compare the exact same query with calibration off/on in All files, Semantic or Hybrid, using mixed Full-indexed content. Try: dogs playing on grass; a dog barking; dog vaccination instructions; someone repairing a bicycle; a car engine running. Record the first five results, their media types and scores. Photo-only queries may show little change because their candidates share one channel. Compare photo of dog / photos of dogs separately to test OCR promotion rather than calibration.
diff --git a/native/locales/de.json b/native/locales/de.json
index 9ee2a2e..a3c6d91 100644
--- a/native/locales/de.json
+++ b/native/locales/de.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj nicht erkannt (Vision nicht verfügbar)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Warnung: weniger als 768 Dimensionen; Die Abrufqualität kann beeinträchtigt sein",
"Context {context} tokens": "Kontext {context}-Token",
- "English speech-to-text": "Englische Speech-to-Text"
+ "English speech-to-text": "Englische Speech-to-Text",
+ "Warm embedding model when search opens": "Warmes Einbettungsmodell, wenn die Suche geöffnet wird",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Sendet eine kleine Einbettungsanfrage, wenn die Hybrid- oder semantische Suche geöffnet wird, bevor Sie etwas eingeben. Der Remote-Server benötigt möglicherweise einige Sekunden, um sein Modell zu laden.",
+ "Warming embedding model…": "Wärmendes Einbettmodell…"
}
diff --git a/native/locales/en.json b/native/locales/en.json
index c7c28d7..cdc4243 100644
--- a/native/locales/en.json
+++ b/native/locales/en.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj not detected (vision unavailable)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Warning: fewer than 768 dimensions; retrieval quality may be reduced",
"Context {context} tokens": "Context {context} tokens",
- "English speech-to-text": "English speech-to-text"
+ "English speech-to-text": "English speech-to-text",
+ "Warm embedding model when search opens": "Warm embedding model when search opens",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.",
+ "Warming embedding model…": "Warming embedding model…"
}
diff --git a/native/locales/es.json b/native/locales/es.json
index 8093189..6d19c7e 100644
--- a/native/locales/es.json
+++ b/native/locales/es.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj no detectado (visión no disponible)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Advertencia: menos de 768 dimensiones; la calidad de recuperación puede verse reducida",
"Context {context} tokens": "Contexto tokens {context}",
- "English speech-to-text": "Inglés de voz a texto"
+ "English speech-to-text": "Inglés de voz a texto",
+ "Warm embedding model when search opens": "Modelo de incrustación cálida cuando se abre la búsqueda",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Envía una pequeña solicitud de incrustación cuando se abre la búsqueda híbrida o semántica, antes de escribir. Es posible que el servidor remoto necesite unos segundos para cargar su modelo.",
+ "Warming embedding model…": "Modelo de incrustación de calentamiento…"
}
diff --git a/native/locales/fr.json b/native/locales/fr.json
index 5c6cb6b..caf2ddc 100644
--- a/native/locales/fr.json
+++ b/native/locales/fr.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj non détecté (vision indisponible)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Attention : moins de 768 dimensions ; la qualité de la récupération peut être réduite",
"Context {context} tokens": "Contexte des jetons {context}",
- "English speech-to-text": "synthèse vocale en anglais"
+ "English speech-to-text": "synthèse vocale en anglais",
+ "Warm embedding model when search opens": "Modèle d'intégration chaleureux à l'ouverture de la recherche",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Envoie une petite demande d'intégration lorsque la recherche hybride ou sémantique s'ouvre, avant de taper. Le serveur distant peut avoir besoin de quelques secondes pour charger son modèle.",
+ "Warming embedding model…": "Modèle d’intégration chauffant…"
}
diff --git a/native/locales/hi.json b/native/locales/hi.json
index 1779b68..4852bfa 100644
--- a/native/locales/hi.json
+++ b/native/locales/hi.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj का पता नहीं चला (दृष्टि अनुपलब्ध)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "चेतावनी: 768 से कम आयाम; पुनर्प्राप्ति गुणवत्ता कम हो सकती है",
"Context {context} tokens": "प्रसंग {context} टोकन",
- "English speech-to-text": "अंग्रेजी भाषण-से-पाठ"
+ "English speech-to-text": "अंग्रेजी भाषण-से-पाठ",
+ "Warm embedding model when search opens": "खोज खुलने पर वार्म एंबेडिंग मॉडल",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "आपके टाइप करने से पहले जब हाइब्रिड या सिमेंटिक खोज खुलती है तो एक छोटा एम्बेडिंग अनुरोध भेजता है। दूरस्थ सर्वर को अपना मॉडल लोड करने में कुछ सेकंड की आवश्यकता हो सकती है।",
+ "Warming embedding model…": "वार्मिंग एम्बेडिंग मॉडल…"
}
diff --git a/native/locales/it.json b/native/locales/it.json
index 18b1e04..b73d62b 100644
--- a/native/locales/it.json
+++ b/native/locales/it.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj non rilevato (visione non disponibile)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Attenzione: meno di 768 dimensioni; la qualità del recupero potrebbe essere ridotta",
"Context {context} tokens": "Token {context} di contesto",
- "English speech-to-text": "Discorso in testo inglese"
+ "English speech-to-text": "Discorso in testo inglese",
+ "Warm embedding model when search opens": "Modello di incorporamento a caldo all'apertura della ricerca",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Invia una piccola richiesta di incorporamento all'apertura della ricerca ibrida o semantica, prima della digitazione. Il server remoto potrebbe richiedere alcuni secondi per caricare il proprio modello.",
+ "Warming embedding model…": "Modello di incorporamento del riscaldamento…"
}
diff --git a/native/locales/ja.json b/native/locales/ja.json
index e306098..aa99a90 100644
--- a/native/locales/ja.json
+++ b/native/locales/ja.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj が検出されない (視覚が利用できない)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "警告: 次元は 768 未満です。検索品質が低下する可能性があります",
"Context {context} tokens": "コンテキスト {context} トークン",
- "English speech-to-text": "英語の音声合成"
+ "English speech-to-text": "英語の音声合成",
+ "Warm embedding model when search opens": "検索を開いたときのウォームエンベディングモデル",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "ハイブリッド検索またはセマンティック検索が開いたときに、入力する前に小さな埋め込みリクエストを送信します。リモート サーバーがモデルをロードするのに数秒かかる場合があります。",
+ "Warming embedding model…": "埋め込みモデルを温めています…"
}
diff --git a/native/locales/ko.json b/native/locales/ko.json
index bf11ff7..dd2aeae 100644
--- a/native/locales/ko.json
+++ b/native/locales/ko.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj가 감지되지 않음(비전을 사용할 수 없음)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "경고: 차원이 768개 미만입니다. 검색 품질이 저하될 수 있습니다.",
"Context {context} tokens": "컨텍스트 {context} 토큰",
- "English speech-to-text": "영어 음성을 텍스트로"
+ "English speech-to-text": "영어 음성을 텍스트로",
+ "Warm embedding model when search opens": "검색이 열릴 때 웜 임베딩 모델",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "하이브리드 또는 의미 체계 검색이 열리면 입력하기 전에 작은 포함 요청을 보냅니다. 원격 서버가 해당 모델을 로드하는 데 몇 초가 필요할 수 있습니다.",
+ "Warming embedding model…": "온난화 임베딩 모델…"
}
diff --git a/native/locales/pt-BR.json b/native/locales/pt-BR.json
index b4b97f7..eeaee2e 100644
--- a/native/locales/pt-BR.json
+++ b/native/locales/pt-BR.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj não detectado (visão indisponível)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Aviso: menos de 768 dimensões; a qualidade da recuperação pode ser reduzida",
"Context {context} tokens": "Tokens {context} de contexto",
- "English speech-to-text": "Fala para texto em inglês"
+ "English speech-to-text": "Fala para texto em inglês",
+ "Warm embedding model when search opens": "Modelo de incorporação quente quando a pesquisa é aberta",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Envia uma pequena solicitação de incorporação quando a pesquisa híbrida ou semântica é aberta, antes de você digitar. O servidor remoto pode precisar de alguns segundos para carregar seu modelo.",
+ "Warming embedding model…": "Modelo de incorporação de aquecimento…"
}
diff --git a/native/locales/ru.json b/native/locales/ru.json
index f6412ce..0e5cbf0 100644
--- a/native/locales/ru.json
+++ b/native/locales/ru.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj не обнаружен (видение недоступно)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Внимание: менее 768 размеров; качество поиска может ухудшиться",
"Context {context} tokens": "Контекстные токены {context}",
- "English speech-to-text": "Преобразование речи в текст на английском языке"
+ "English speech-to-text": "Преобразование речи в текст на английском языке",
+ "Warm embedding model when search opens": "Теплая модель встраивания при открытии поиска",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Отправляет небольшой запрос на внедрение, когда открывается гибридный или семантический поиск, прежде чем вы вводите текст. Удаленному серверу может потребоваться несколько секунд для загрузки модели.",
+ "Warming embedding model…": "Потепление модели встраивания…"
}
diff --git a/native/locales/vi.json b/native/locales/vi.json
index cf94fe8..913f383 100644
--- a/native/locales/vi.json
+++ b/native/locales/vi.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "mmproj không được phát hiện (không có tầm nhìn)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "Cảnh báo: ít hơn 768 kích thước; chất lượng truy xuất có thể bị giảm",
"Context {context} tokens": "Mã thông báo bối cảnh {context}",
- "English speech-to-text": "Chuyển giọng nói thành văn bản tiếng Anh"
+ "English speech-to-text": "Chuyển giọng nói thành văn bản tiếng Anh",
+ "Warm embedding model when search opens": "Mô hình nhúng ấm khi tìm kiếm mở ra",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "Gửi một yêu cầu nhúng nhỏ khi tìm kiếm Kết hợp hoặc Ngữ nghĩa mở ra, trước khi bạn nhập. Máy chủ từ xa có thể cần vài giây để tải mô hình của nó.",
+ "Warming embedding model…": "Mô hình nhúng nóng lên…"
}
diff --git a/native/locales/zh-CN.json b/native/locales/zh-CN.json
index c8b60ce..7ded4de 100644
--- a/native/locales/zh-CN.json
+++ b/native/locales/zh-CN.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "未检测到 mmproj(视野不可用)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "警告:尺寸小于 768;检索质量可能会降低",
"Context {context} tokens": "上下文 {context} 代币",
- "English speech-to-text": "英语语音转文本"
+ "English speech-to-text": "英语语音转文本",
+ "Warm embedding model when search opens": "搜索打开时的热嵌入模型",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "当混合或语义搜索打开时,在您键入之前发送一个小的嵌入请求。远程服务器可能需要几秒钟来加载其模型。",
+ "Warming embedding model…": "变暖的嵌入模型..."
}
diff --git a/native/locales/zh-TW.json b/native/locales/zh-TW.json
index d0813e0..09532c3 100644
--- a/native/locales/zh-TW.json
+++ b/native/locales/zh-TW.json
@@ -704,5 +704,8 @@
"mmproj not detected (vision unavailable)": "未檢測到 mmproj(視野不可用)",
"Warning: fewer than 768 dimensions; retrieval quality may be reduced": "警告:尺寸小於 768;檢索品質可能會降低",
"Context {context} tokens": "上下文 {context} 代幣",
- "English speech-to-text": "英語語音轉文本"
+ "English speech-to-text": "英語語音轉文本",
+ "Warm embedding model when search opens": "Warm embedding model when search opens",
+ "Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model.": "當混合或語義搜尋打開時,在您鍵入之前發送一個小的嵌入請求。遠端伺服器可能需要幾秒鐘來載入其模型。",
+ "Warming embedding model…": "Warming embedding model…"
}
diff --git a/native/src/app.rs b/native/src/app.rs
index d7c0cc6..1073086 100644
--- a/native/src/app.rs
+++ b/native/src/app.rs
@@ -149,6 +149,8 @@ pub struct App {
child_theme_key: String,
search_visible: bool,
model_warm_attempted: bool,
+ model_warm_busy: bool,
+ ai_session_model: String,
model_warm_error: Option<String>,
last_search_mode: String,
popup_panel_height: u32,
@@ -298,6 +300,8 @@ impl App {
let window_state = crate::config::WindowState::load(&home);
let read_aloud = s.tts_enabled && s.tts_auto;
let response_length = s.llm_response.clone();
+ let ai_session_model = s.llm_model.clone();
+ let llm_models = load_chat_models(&home, &s.llm_url);
let mut app = Self {
home,
collapsed: s.sidebar_collapsed,
@@ -410,6 +414,8 @@ impl App {
child_theme_key: String::new(),
search_visible: !(std::env::args().any(|a| a == "--startup") && saved_start_hidden),
model_warm_attempted: false,
+ model_warm_busy: false,
+ ai_session_model,
model_warm_error: None,
last_search_mode: String::new(),
popup_panel_height: 0,
@@ -423,7 +429,7 @@ impl App {
ai_busy: false,
ai_job: 0,
ai_cancel: Arc::new(AtomicBool::new(false)),
- llm_models: vec![],
+ llm_models,
llm_models_busy: false,
llm_hotkey_capture: false,
clipboard_clear_confirm: false,
@@ -879,6 +885,9 @@ impl App {
if !self.save() {
return;
}
+ if self.ai_session_model == previous.llm_model {
+ self.ai_session_model = self.s.llm_model.clone();
+ }
if previous.llm_url != self.s.llm_url || previous.llm_key != self.s.llm_key {
self.stop_ai();
self.ai_messages.clear();
@@ -969,6 +978,7 @@ impl App {
}
}
if index == 2 {
+ cache_chat_models(&self.home, &self.s.llm_url, &catalog.models);
self.llm_models = catalog.models.clone();
self.llm_models_busy = false;
if self.s.llm_context_auto {
@@ -1250,6 +1260,7 @@ impl App {
match result {
Ok(models) => {
if url == self.s.llm_url {
+ cache_chat_models(&self.home, &url, &models);
self.llm_models = models;
}
self.status = format!("{} LLM models available", self.llm_models.len());
@@ -1287,6 +1298,7 @@ impl App {
self.changed();
}
Event::ModelReady(result) => {
+ self.model_warm_busy = false;
self.model_warm_error = result.err();
self.dirty = true;
}
@@ -1678,22 +1690,26 @@ impl App {
self.model_warm_error = None;
}
if self.model_warm_attempted
- || self.s.remote_embeddings()
+ || self.model_warm_busy
+ || !self.s.warm_on_search_open(&self.mode)
|| self.engine.models.search_hold(&self.s).is_some()
|| self.engine.models.loading.load(Ordering::Acquire)
|| self.index_clearing
{
return;
}
- if !Path::new(&self.s.server).is_file() || !Path::new(&self.s.model).is_file() {
+ if !self.s.remote_embeddings()
+ && (!Path::new(&self.s.server).is_file() || !Path::new(&self.s.model).is_file())
+ {
return;
}
self.model_warm_attempted = true;
+ self.model_warm_busy = true;
let models = self.engine.models.clone();
let s = self.s.clone();
let tx = self.engine.tx.clone();
std::thread::spawn(move || {
- let result = models.start(&s, false).map_err(|e| e.to_string());
+ let result = models.warm_search(&s).map_err(|e| e.to_string());
let _ = tx.send(Event::ModelReady(result));
});
}
@@ -2082,7 +2098,7 @@ impl App {
right: if self.tool == "Search" {
127
} else if self.tool == "AI" {
- 124
+ 127
} else {
8
},
@@ -2176,32 +2192,29 @@ impl App {
}
}
if self.tool == "AI" && !recording {
- let full = format!("AI: {}", self.saved_settings.llm_model);
- let short = if full.chars().count() > 20 {
- format!("{}…", full.chars().take(19).collect::<String>())
- } else {
- full.clone()
- };
let label_rect = egui::Rect::from_min_max(
egui::pos2(
- (response.rect.right() - 116.0).max(response.rect.left()),
+ (response.rect.right() - 125.0).max(response.rect.left()),
response.rect.top(),
),
response.rect.right_bottom() - egui::vec2(8.0, 0.0),
);
- ui.painter().with_clip_rect(label_rect).text(
- label_rect.right_center(),
- egui::Align2::RIGHT_CENTER,
- short,
- egui::FontId::proportional(11.0),
- ui.visuals().text_color(),
- );
- ui.interact(
- label_rect,
- egui::Id::new("ai-model-label"),
- egui::Sense::hover(),
- )
- .on_hover_text(full);
+ let models = chat_model_choices(&self.ai_session_model, &self.llm_models);
+ ui.scope_builder(egui::UiBuilder::new().max_rect(label_rect), |ui| {
+ egui::ComboBox::from_id_salt("chat-model-picker")
+ .truncate()
+ .width(label_rect.width())
+ .selected_text(format!("{}: {}", t("AI"), self.ai_session_model))
+ .show_ui(ui, |ui| {
+ for model in models {
+ ui.selectable_value(
+ &mut self.ai_session_model,
+ model.clone(),
+ model,
+ );
+ }
+ });
+ });
}
if self.select_query && !recording {
self.select_query = false;
@@ -3783,12 +3796,17 @@ impl App {
self.page == 0
&& self.tool == "Search"
&& self.mode != "Names"
- && (self.searching || self.engine.models.loading.load(Ordering::Acquire))
+ && (self.searching
+ || self.model_warm_busy
+ || self.engine.models.loading.load(Ordering::Acquire))
}
fn footer_text(&self) -> String {
if self.page != 0 {
return t(&self.status).to_owned();
}
+ if self.model_warm_busy {
+ return t("Warming embedding model…").to_owned();
+ }
if self.dictation_busy {
return "Transcribing…".into();
}
@@ -4183,6 +4201,14 @@ impl App {
});
}
fn remote_server_ui(&mut self, ui: &mut egui::Ui, index: usize) {
+ if index == 0 {
+ ui.checkbox(
+ &mut self.s.remote_warm_on_open,
+ t("Warm embedding model when search opens"),
+ );
+ ui.weak(t("Sends a small embedding request when Hybrid or Semantic search opens, before you type. The remote server may need a few seconds to load its model."));
+ }
+
let signature = self.remote_signature(index);
if self.remote_servers[index].signature != signature {
self.remote_servers[index] = RemoteState {
@@ -4931,6 +4957,14 @@ impl App {
self.clipboard_texture = None;
self.clipboard_preview_id = -1;
self.tool = tool.into();
+ if tool == "AI"
+ && self.llm_models.is_empty()
+ && !self.llm_models_busy
+ && !self.saved_settings.llm_url.is_empty()
+ {
+ self.llm_models_busy = true;
+ self.refresh_remote(2, false);
+ }
// Empty tools can have different compact heights even when emptiness stays true.
self.popup_size_state = None;
self.large_preview = false;
@@ -4968,6 +5002,7 @@ impl App {
self.markdown = egui_commonmark::CommonMarkCache::default();
self.ai_question = self.query.trim().into();
let mut selected_settings = self.saved_settings.clone();
+ selected_settings.llm_model = self.ai_session_model.clone();
selected_settings.llm_response = self.response_length.clone();
match crate::ai::prepare(&selected_settings, &self.ai_messages, &self.ai_question) {
Ok(mut messages) => {
@@ -7565,6 +7600,32 @@ impl eframe::App for App {
self.mcp = None;
}
}
+fn cache_chat_models(home: &Path, url: &str, models: &[String]) {
+ let value = serde_json::json!({"url":url,"models":models});
+ let _ = std::fs::write(
+ home.join("llm-model-catalog.json"),
+ serde_json::to_vec(&value).unwrap(),
+ );
+}
+fn load_chat_models(home: &Path, url: &str) -> Vec<String> {
+ let value = std::fs::read(home.join("llm-model-catalog.json"))
+ .ok()
+ .and_then(|data| serde_json::from_slice::<serde_json::Value>(&data).ok());
+ value
+ .filter(|v| v["url"].as_str() == Some(url))
+ .and_then(|v| serde_json::from_value(v["models"].clone()).ok())
+ .unwrap_or_default()
+}
+fn chat_model_choices(current: &str, discovered: &[String]) -> Vec<String> {
+ let mut models = Vec::new();
+ for value in std::iter::once(current).chain(discovered.iter().map(String::as_str)) {
+ if !value.is_empty() && !models.iter().any(|item| item == value) {
+ models.push(value.to_owned());
+ }
+ }
+ models
+}
+
fn dialog_window<'a>(ctx: &egui::Context, title: &'a str, width: f32) -> egui::Window<'a> {
let bounds = ctx.content_rect().shrink(12.0);
let width = width.min((bounds.width() - 24.0).max(120.0));
@@ -8171,3 +8232,34 @@ mod dialog_bounds_tests {
}
}
}
+
+#[cfg(test)]
+mod search_open_tests {
+ use super::*;
+ #[test]
+ fn warmup_is_opt_in_for_remote_and_never_used_for_names() {
+ let mut settings = Settings::default();
+ assert!(settings.warm_on_search_open("Both"));
+ assert!(!settings.warm_on_search_open("Names"));
+ settings.embedding_server = "Remote".into();
+ assert!(!settings.warm_on_search_open("Both"));
+ settings.remote_warm_on_open = true;
+ assert!(settings.warm_on_search_open("Semantic"));
+ assert!(!settings.warm_on_search_open("Names"));
+ }
+ #[test]
+ fn chat_catalog_is_url_scoped_and_selection_is_unique() {
+ let home = tempfile::tempdir().unwrap();
+ let values = vec!["model-a".into(), "model-b".into(), "model-a".into()];
+ cache_chat_models(home.path(), "https://example.test/v1", &values);
+ assert_eq!(
+ load_chat_models(home.path(), "https://example.test/v1"),
+ values
+ );
+ assert!(load_chat_models(home.path(), "https://other.test/v1").is_empty());
+ assert_eq!(
+ chat_model_choices("model-b", &values),
+ vec!["model-b", "model-a"]
+ );
+ }
+}
diff --git a/native/src/config.rs b/native/src/config.rs
index 94b9a17..fdf0cc0 100644
--- a/native/src/config.rs
+++ b/native/src/config.rs
@@ -45,6 +45,7 @@ pub struct Settings {
pub remote_model: String,
pub remote_context: u32,
pub remote_context_auto: bool,
+ pub remote_warm_on_open: bool,
pub remote_url: String,
pub remote_key: String,
pub server: String,
@@ -194,6 +195,7 @@ impl Default for Settings {
remote_model: String::new(),
remote_context: 2048,
remote_context_auto: true,
+ remote_warm_on_open: false,
remote_url: String::new(),
remote_key: String::new(),
server: String::new(),
@@ -566,6 +568,9 @@ fn forbidden_name(name: &str, churn: bool) -> bool {
|| churn && ["windows", "appdata", "temp", "cache", "caches"].contains(&name)
}
impl Settings {
+ pub fn warm_on_search_open(&self, mode: &str) -> bool {
+ mode != "Names" && (!self.remote_embeddings() || self.remote_warm_on_open)
+ }
pub fn remote_embeddings(&self) -> bool {
self.embedding_server == "Remote"
|| (self.embedding_server.is_empty() && !self.remote_url.trim().is_empty())
diff --git a/native/src/engine.rs b/native/src/engine.rs
index 790e4bd..5e234a3 100644
--- a/native/src/engine.rs
+++ b/native/src/engine.rs
@@ -2023,7 +2023,12 @@ impl Engine {
{
hits.extend(crate::db::names(&self.db, q, s, category, scope, excluded)?);
}
- if mode != "Names" && category != "Folders" && crate::config::full_scope(s, scope) {
+ if mode != "Names"
+ && category != "Folders"
+ && crate::config::full_scope(s, scope)
+ && !((category == "Images" || media_intent(&filters.text) == Some("Images"))
+ && !text_query_intent(&filters.text))
+ {
hits.extend(self.keywords(
&filters.text,
s,
@@ -2191,17 +2196,7 @@ impl Engine {
};
conn.execute_batch("BEGIN")?;
crate::db::register_search(&conn, s, cat, scope, excluded, filters)?;
- let text_intent = q.chars().any(|c| c.is_ascii_digit())
- || [
- "error",
- "text",
- "screenshot",
- "invoice",
- "number",
- "declined",
- ]
- .iter()
- .any(|word| q.to_lowercase().contains(word));
+ let text_intent = text_query_intent(q);
let policy = crate::config::SearchPolicy::new(s, cat, scope, excluded);
let mut file_maxima: HashMap<(String, String), f32> = HashMap::new();
let mut pool: Vec<(f32, i64)> = vec![];
@@ -2298,7 +2293,13 @@ impl Engine {
let tokens = q
.split_whitespace()
.map(str::to_lowercase)
- .filter(|t| !["a", "the", "of", "images", "photos", "in", "on"].contains(&t.as_str()))
+ .filter(|t| {
+ ![
+ "a", "the", "of", "image", "images", "photo", "photos", "picture", "pictures",
+ "in", "on",
+ ]
+ .contains(&t.as_str())
+ })
.collect::<Vec<_>>();
let scores: HashMap<i64, f32> = pool.iter().map(|(score, id)| (*id, *score)).collect();
let ids = serde_json::to_string(&pool.iter().map(|(_, id)| *id).collect::<Vec<_>>())?;
@@ -2331,7 +2332,11 @@ impl Engine {
} else {
0.0
}
- + exact * 0.25;
+ + if cat == "Images" && !text_intent {
+ 0.0
+ } else {
+ exact * 0.25
+ };
let media = location["embedding_source"] == "media";
let h = Hit {
path: path.clone(),
@@ -2362,7 +2367,13 @@ impl Engine {
fn search_tokens(q: &str) -> Vec<String> {
q.split_whitespace()
.map(str::to_lowercase)
- .filter(|t| !["a", "the", "of", "images", "photos", "in", "on"].contains(&t.as_str()))
+ .filter(|t| {
+ ![
+ "a", "the", "of", "image", "images", "photo", "photos", "picture", "pictures",
+ "in", "on",
+ ]
+ .contains(&t.as_str())
+ })
.collect()
}
fn finish_hits(hits: &mut Vec<Hit>, intent: Option<&str>) {
@@ -2715,6 +2726,20 @@ mod incremental_tests {
}
}
+fn text_query_intent(query: &str) -> bool {
+ query.chars().any(|c| c.is_ascii_digit())
+ || [
+ "error",
+ "text",
+ "screenshot",
+ "invoice",
+ "number",
+ "declined",
+ ]
+ .iter()
+ .any(|word| query.to_lowercase().contains(word))
+}
+
fn media_intent(query: &str) -> Option<&'static str> {
let query = query.trim().to_lowercase();
let query = query
diff --git a/native/src/models.rs b/native/src/models.rs
index 064f40d..c5f9c33 100644
--- a/native/src/models.rs
+++ b/native/src/models.rs
@@ -148,6 +148,13 @@ impl Models {
let _activity = self.activity();
self.ensure(s, media)
}
+ pub fn warm_search(&self, s: &Settings) -> Result<()> {
+ if s.remote_embeddings() {
+ self.query(s, "VectorDash warm-up").map(|_| ())
+ } else {
+ self.start(s, false)
+ }
+ }
pub fn pid(&self) -> u32 {
self.inner
.try_lock()
@@ -1112,3 +1119,39 @@ mod response_stability_tests {
thread.join().unwrap();
}
}
+
+#[cfg(test)]
+mod warmup_tests {
+ use super::*;
+ #[test]
+ fn remote_warmup_sends_a_real_embedding_request_without_a_search() {
+ let server = tiny_http::Server::http("127.0.0.1:0").unwrap();
+ let mut settings = Settings::default();
+ settings.embedding_server = "Remote".into();
+ settings.remote_url = format!("http://{}/v1", server.server_addr());
+ settings.remote_model = "sleeping-model".into();
+ let worker = std::thread::spawn(move || {
+ let mut request = server
+ .recv_timeout(Duration::from_secs(5))
+ .unwrap()
+ .unwrap();
+ let mut body = String::new();
+ request.as_reader().read_to_string(&mut body).unwrap();
+ assert_eq!(request.url(), "/v1/embeddings");
+ let body: Value = serde_json::from_str(&body).unwrap();
+ assert_eq!(body["model"], "sleeping-model");
+ assert!(body.to_string().contains("warm-up"));
+ request
+ .respond(
+ tiny_http::Response::from_string(r#"{"data":[{"embedding":[1.0,0.0]}]}"#)
+ .with_header(
+ tiny_http::Header::from_bytes("Content-Type", "application/json")
+ .unwrap(),
+ ),
+ )
+ .unwrap();
+ });
+ Models::default().warm_search(&settings).unwrap();
+ worker.join().unwrap();
+ }
+}
diff --git a/native/src/stability_tests.rs b/native/src/stability_tests.rs
index 3146b04..049ca7d 100644
--- a/native/src/stability_tests.rs
+++ b/native/src/stability_tests.rs
@@ -529,3 +529,57 @@ fn burst_statistics_refreshes_are_coalesced_without_repeated_global_counts() {
"burst requests must not each run database-wide statistics queries"
);
}
+
+#[test]
+fn visual_queries_do_not_promote_infographics_for_exact_ocr_words() {
+ let (_home, root, mut settings, engine, _rx) = fixture();
+ let c = engine.db.connect(false).unwrap();
+ for (name, text, similarity) in [
+ ("dog-photo.jpg", "", 0.85_f32),
+ ("infographic.jpg", "dogs dog statistics", 0.75_f32),
+ ] {
+ let path = root.path().join(name);
+ std::fs::write(&path, b"fixture").unwrap();
+ Database::touch_name(&c, &path, "file", 1, 7, "full", &settings.roots[0].path, 1).unwrap();
+ let mut segment = crate::content::Segment::text("image", text.into(), 0, 0);
+ segment.media = vec![1];
+ Database::save_segments(
+ &c,
+ &path.to_string_lossy(),
+ &[segment],
+ &[vec![similarity, (1.0 - similarity * similarity).sqrt()]],
+ "fixture",
+ )
+ .unwrap();
+ }
+ let server = tiny_http::Server::http("127.0.0.1:0").unwrap();
+ settings.embedding_server = "Remote".into();
+ settings.remote_url = format!("http://{}/v1", server.server_addr());
+ let reply = std::thread::spawn(move || {
+ while let Some(request) = server.recv_timeout(Duration::from_secs(2)).unwrap() {
+ request
+ .respond(
+ tiny_http::Response::from_string(r#"{"data":[{"embedding":[1.0,0.0]}]}"#)
+ .with_header(
+ tiny_http::Header::from_bytes("Content-Type", "application/json")
+ .unwrap(),
+ ),
+ )
+ .unwrap();
+ }
+ });
+ for calibrated in [false, true] {
+ settings.rank_calibration = calibrated;
+ for query in ["photos of dogs", "photo of dog"] {
+ let hits = engine
+ .search_inner(query, &settings, "Semantic", "All files", "", "")
+ .unwrap();
+ assert_eq!(hits.len(), 2);
+ assert!(
+ hits[0].path.ends_with("dog-photo.jpg"),
+ "{query} calibration={calibrated}: {hits:?}"
+ );
+ }
+ }
+ reply.join().unwrap();
+}
diff --git a/native/src/updates.rs b/native/src/updates.rs
index ea286eb..12e4237 100644
--- a/native/src/updates.rs
+++ b/native/src/updates.rs
@@ -204,7 +204,7 @@ pub fn download(release: &Release, home: &Path) -> Result<PathBuf> {
}
pub fn install(path: &Path) -> Result<()> {
let mut c = std::process::Command::new(path);
- c.args(["/SP-", "/SILENT", "/NORESTART"]);
+ c.args(["/SP-", "/SILENT", "/NORESTART", "/RELAUNCH=1"]);
crate::content::hidden(&mut c);
c.spawn().context("Cannot launch verified installer")?;
Ok(())
diff --git a/packaging/VectorDash-Rust.iss b/packaging/VectorDash-Rust.iss
index 6ad1d8f..44bf882 100644
--- a/packaging/VectorDash-Rust.iss
+++ b/packaging/VectorDash-Rust.iss
@@ -34,7 +34,13 @@ Name: "{group}\VectorDash"; Filename: "{app}\VectorDash.exe"
Name: "{autodesktop}\VectorDash"; Filename: "{app}\VectorDash.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\VectorDash.exe"; Description: "Open VectorDash"; Flags: nowait postinstall skipifsilent
+Filename: "{app}\VectorDash.exe"; Flags: nowait skipifnotsilent; Check: RelaunchAfterUpdate
[Code]
+function RelaunchAfterUpdate: Boolean;
+begin
+ Result := ExpandConstant('{param:RELAUNCH|0}') = '1';
+end;
+
procedure CurStepChanged(CurStep: TSetupStep);
var OldUninstaller, OldFolder, StartupCommand: String; ResultCode: Integer; HadPreviewStartup: Boolean;
begin