From 33d42a2a0499530eeda82fc38b81c2b213b3f5c4 Mon Sep 17 00:00:00 2001 From: JohnRichardEnders Date: Fri, 3 Apr 2026 17:14:04 +0200 Subject: [PATCH] feat(sdk): pass YAML models config to LlamaCpp in createStore Co-Authored-By: Claude Opus 4.6 (1M context) --- src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 02ec51b..6772347 100644 --- a/src/index.ts +++ b/src/index.ts @@ -351,21 +351,26 @@ export async function createStore(options: StoreOptions): Promise { const hasYamlConfig = !!options.configPath; // Sync config into SQLite store_collections + let config: CollectionConfig | undefined; if (options.configPath) { // YAML mode: inject config source for write-through, sync to DB setConfigSource({ configPath: options.configPath }); - const config = loadConfig(); + config = loadConfig(); syncConfigToDb(db, config); } else if (options.config) { // Inline config mode: inject config source for mutations, sync to DB setConfigSource({ config: options.config }); - syncConfigToDb(db, options.config); + config = options.config; + syncConfigToDb(db, config); } // else: DB-only mode — no external config, use existing store_collections // Create a per-store LlamaCpp instance — lazy-loads models on first use, // auto-unloads after 5 min inactivity to free VRAM. const llm = new LlamaCpp({ + embedModel: config?.models?.embed, + generateModel: config?.models?.generate, + rerankModel: config?.models?.rerank, inactivityTimeoutMs: 5 * 60 * 1000, disposeModelsOnInactivity: true, });