feat: add release notes to install script and smart embedding model detection
Install script improvements: - Show release notes after --update completes - Detect installed version from backend/cmd/server/main.go - Fetch releases from GitHub API and display changes between versions - Graceful fallback when jq not installed (shows link only) Embedding model detection: - Add EMBEDDING_MODEL_PATTERNS for detecting embedding models - Add embeddingModels and hasEmbeddingModel derived properties - KnowledgeTab shows embedding model status conditionally - MemoryTab shows model installation status with three states
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
DEFAULT_EMBEDDING_MODEL
|
||||
} from '$lib/memory';
|
||||
import type { StoredDocument } from '$lib/storage/db';
|
||||
import { toastState } from '$lib/stores';
|
||||
import { toastState, modelsState } from '$lib/stores';
|
||||
|
||||
let documents = $state<StoredDocument[]>([]);
|
||||
let stats = $state({ documentCount: 0, chunkCount: 0, totalTokens: 0 });
|
||||
@@ -258,9 +258,18 @@
|
||||
Documents are split into chunks and converted to embeddings. When you ask a question,
|
||||
relevant chunks are found by similarity search and included in the AI's context.
|
||||
</p>
|
||||
<p class="mt-2 text-sm text-theme-muted">
|
||||
<strong class="text-theme-secondary">Note:</strong> Requires an embedding model to be installed
|
||||
in Ollama (e.g., <code class="rounded bg-theme-tertiary px-1">ollama pull nomic-embed-text</code>).
|
||||
</p>
|
||||
{#if !modelsState.hasEmbeddingModel}
|
||||
<p class="mt-2 text-sm text-amber-400">
|
||||
<strong>No embedding model found.</strong> Install one to use the knowledge base:
|
||||
<code class="ml-1 rounded bg-theme-tertiary px-1 text-theme-muted">ollama pull nomic-embed-text</code>
|
||||
</p>
|
||||
{:else}
|
||||
<p class="mt-2 text-sm text-emerald-400">
|
||||
Embedding model available: {modelsState.embeddingModels[0]?.name}
|
||||
{#if modelsState.embeddingModels.length > 1}
|
||||
<span class="text-theme-muted">(+{modelsState.embeddingModels.length - 1} more)</span>
|
||||
{/if}
|
||||
</p>
|
||||
{/if}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -75,9 +75,25 @@
|
||||
<option value={model}>{model}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<p class="mt-2 text-xs text-theme-muted">
|
||||
Note: The model must be installed in Ollama. Run <code class="bg-theme-tertiary px-1 rounded">ollama pull {settingsState.embeddingModel}</code> if not installed.
|
||||
</p>
|
||||
{#if !modelsState.hasEmbeddingModel}
|
||||
<p class="mt-2 text-xs text-amber-400">
|
||||
No embedding model installed. Run <code class="bg-theme-tertiary px-1 rounded text-theme-muted">ollama pull {settingsState.embeddingModel}</code> to enable semantic search.
|
||||
</p>
|
||||
{:else}
|
||||
{@const selectedInstalled = modelsState.embeddingModels.some(m => m.name.includes(settingsState.embeddingModel.split(':')[0]))}
|
||||
{#if !selectedInstalled}
|
||||
<p class="mt-2 text-xs text-amber-400">
|
||||
Selected model not installed. Run <code class="bg-theme-tertiary px-1 rounded text-theme-muted">ollama pull {settingsState.embeddingModel}</code> or select an installed model.
|
||||
</p>
|
||||
<p class="mt-1 text-xs text-theme-muted">
|
||||
Installed: {modelsState.embeddingModels.map(m => m.name).join(', ')}
|
||||
</p>
|
||||
{:else}
|
||||
<p class="mt-2 text-xs text-emerald-400">
|
||||
Model installed and ready.
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- Auto-Compact Toggle -->
|
||||
|
||||
Reference in New Issue
Block a user