feat(sdk): pass YAML models config to LlamaCpp in createStore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
50ce17bbfa
commit
33d42a2a04
@ -351,21 +351,26 @@ export async function createStore(options: StoreOptions): Promise<QMDStore> {
|
||||
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,
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user