Skip to content

useEmbeddingModelCheck

useEmbeddingModelCheck(__namedParameters): boolean

Defined in: features/model/hooks/use-embedding-model-check.ts:48

Two responsibilities:

  1. Verify the selected embedding model is actually installed on its provider. We ask the background worker every 5s (and immediately on selection change) via the MESSAGE_KEYS.PROVIDER.CHECK_EMBEDDING_MODEL round-trip.
  2. If the check fails and the user hasn’t already been moved automatically, pick the best available alternative (prefer Ollama-hosted, then anything in our recommended set, then anything matching the “embed/embedding” name heuristic) and switch the selection there. The auto-switch fires once per selectedModel cycle so a user who manually re-selects the missing model is respected.

Also normalizes selectedModel on mount — if Dexie-era legacy names still leak through, they get rewritten on first read.

UseEmbeddingModelCheckOptions

boolean