/** * v1.7.5: model-metadata overrides — user-controlled, survives `npm update`. * * Reads / writes `~/.config/obsidian-brain/model-overrides.json` (XDG- * compliant; see user-config.ts). Each override is a partial patch on top * of the resolved metadata for a model id — set just `maxTokens`, just * `queryPrefix`, or any combination. Omitted fields keep the underlying * (cache → seed → HF → ...) value. * * File shape (v1): * { * "$version": 1, * "models": { * "MongoDB/mdbr-leaf-ir": { "maxTokens": 1024 }, * "intfloat/e5-mistral-7b-instruct": { * "queryPrefix": "Custom: ", * "documentPrefix": "" * } * } * } * * Bad shape / missing file → empty map + stderr warning. Resolver falls * through to the next layer; we never crash. Validation rejects entries * with non-positive maxTokens, non-string prefixes, etc. — the user * gets a stderr line per bad entry but the rest of the file still loads. * * Override CHANGES are picked up on next process boot. The CLI * `models override ` writes to this file AND clears the in-process * cache so a long-running server picks them up via `_resetOverridesCache()`. */ export interface ModelOverride { maxTokens?: number; queryPrefix?: string | null; documentPrefix?: string | null; } /** Reset in-process cache (tests + CLI write-then-read flow). */ export declare function _resetOverridesCache(): void; /** * Load overrides from disk once per process. Subsequent calls return the * cached map. Empty map on any load failure. */ export declare function loadOverrides(): Map; /** * Write or update a single override entry; merges with any existing * fields for that model id (so calling with `{maxTokens: 1024}` doesn't * wipe a previously-set queryPrefix). Resets the in-process cache so * subsequent `loadOverrides()` calls in the same process pick up the * change. */ export declare function saveOverride(modelId: string, patch: ModelOverride): void; /** * Remove an override (or one of its fields). Returns true if the entry * existed and was modified, false if no-op. */ export declare function removeOverride(modelId: string, field?: keyof ModelOverride): boolean;