|
|
@@ -77,7 +77,7 @@ import {
|
|
|
type ReindexResult,
|
|
|
type ChunkStrategy,
|
|
|
} from "../store.js";
|
|
|
-import { disposeDefaultLlamaCpp, getDefaultLlamaCpp, withLLMSession, pullModels, DEFAULT_EMBED_MODEL_URI, DEFAULT_GENERATE_MODEL_URI, DEFAULT_RERANK_MODEL_URI, DEFAULT_MODEL_CACHE_DIR } from "../llm.js";
|
|
|
+import { disposeDefaultLlamaCpp, getDefaultLlamaCpp, setDefaultLlamaCpp, LlamaCpp, withLLMSession, pullModels, DEFAULT_EMBED_MODEL_URI, DEFAULT_GENERATE_MODEL_URI, DEFAULT_RERANK_MODEL_URI, DEFAULT_MODEL_CACHE_DIR } from "../llm.js";
|
|
|
import {
|
|
|
formatSearchResults,
|
|
|
formatDocuments,
|
|
|
@@ -118,6 +118,13 @@ function getStore(): ReturnType<typeof createStore> {
|
|
|
try {
|
|
|
const config = loadConfig();
|
|
|
syncConfigToDb(store.db, config);
|
|
|
+ if (config.models) {
|
|
|
+ setDefaultLlamaCpp(new LlamaCpp({
|
|
|
+ embedModel: config.models.embed,
|
|
|
+ generateModel: config.models.generate,
|
|
|
+ rerankModel: config.models.rerank,
|
|
|
+ }));
|
|
|
+ }
|
|
|
} catch {
|
|
|
// Config may not exist yet — that's fine, DB works without it
|
|
|
}
|