import type { LLMProvider } from '../contracts/llm.js'; import type { EmbedProvider } from '../contracts/embed.js'; import type { Config } from '../config/config.js'; export interface ProviderSet { llm: { compaction: LLMProvider; extraction: LLMProvider; /** Contradiction judge (FEAT-456). `getProviders` ALWAYS sets it: the * SAME INSTANCE as `extraction` when no override is configured * (identity — shared rate-limit bucket, byte-identical pre-override * behavior), or a distinct provider built from * `consolidation.contradictionDetection.{provider,model}`. Optional in * the TYPE only so hand-built test ProviderSets stay valid — consumers * fall back with `judge ?? extraction`, which is exactly the * pre-override behavior. */ judge?: LLMProvider; /** Per-pass extraction provider override (FEAT-534). `getProviders` * ALWAYS sets it, mirroring `judge` above exactly: the SAME INSTANCE as * `extraction` when no `distill.extractionPassB` override is configured * (identity — shared rate-limit bucket, byte-identical pre-override * behavior), or a distinct provider built from * `distill.extractionPassB.{provider,model}`. Optional in the TYPE only * so hand-built test ProviderSets stay valid — consumers fall back with * `extractionPassB ?? extraction`, exactly the pre-override behavior. * Only meaningful when `distill.extractionPasses: 2` — pipeline.ts * ignores it entirely on single-pass. */ extractionPassB?: LLMProvider; /** LLM atom-triage tier (FEAT-533). `getProviders` ALWAYS sets it, * mirroring `judge`/`extractionPassB` above exactly: the SAME INSTANCE * as `extraction` when no `distill.atomTriage.{provider,model}` * override is configured (identity — shared rate-limit bucket, * byte-identical pre-override behavior), or a distinct provider built * from that override. Optional in the TYPE only so hand-built test * ProviderSets stay valid — consumers fall back with * `atomTriage ?? extraction`, exactly the pre-override behavior. Only * meaningful when `distill.atomTriage.mode !== 'off'` — embedAndIndex * never calls it on the shipped default. */ atomTriage?: LLMProvider; /** Batched dup-judge over pending consolidation proposals (FEAT-549). * `getProviders` ALWAYS sets it, mirroring `judge`/`extractionPassB`/ * `atomTriage` above exactly: the SAME INSTANCE as `extraction` when no * `consolidation.dupJudge.{provider,model}` override is configured * (identity — shared rate-limit bucket, byte-identical pre-override * behavior), or a distinct provider built from that override. Optional * in the TYPE only so hand-built test ProviderSets stay valid — * consumers fall back with `dupJudge ?? extraction`, exactly the * pre-override behavior. Only meaningful when * `consolidation.dupJudge.mode !== 'off'` — `runConsolidation` never * calls it on the shipped default. */ dupJudge?: LLMProvider; /** Ingest gatekeeper (FEAT-548). `getProviders` ALWAYS sets it, mirroring * `judge`/`extractionPassB`/`atomTriage`/`dupJudge` above exactly: the * SAME INSTANCE as `extraction` when no `distill.gatekeeper.{provider, * model}` override is configured (identity — shared rate-limit bucket, * byte-identical pre-override behavior), or a distinct provider built * from that override. Optional in the TYPE only so hand-built test * ProviderSets stay valid — consumers fall back with * `gatekeeper ?? extraction`, exactly the pre-override behavior. Only * meaningful when `distill.gatekeeper.mode !== 'off'` — runPipeline * never calls it on the shipped default. */ gatekeeper?: LLMProvider; }; embed: EmbedProvider; } export declare function buildLLMProvider(providerName: Config['llm']['compaction']['provider'], model: string, config: Config, /** Ollama-only per-instance tuning (clerk seats); ignored by every other * provider — see OllamaLLMConfig.numCtxCap. */ opts?: { numCtxCap?: number; }): LLMProvider; /** * ADR-018 S2 (was deferred; forced by the 2026-07-16 prod embed outage): * default the ONNX weight cache to a STABLE per-install location * (`/models/onnx/`) instead of the library's own default, which * lives INSIDE the release directory's node_modules — release rotation * (`reinstall` keeps only the newest 2) silently discards it, and the next * boot re-downloads ~337MB or, offline, dies. `:memory:` (throwaway test * state) keeps the library default — no stable install dir exists to * anchor to. Exported for direct unit coverage (#363 review follow-up: * this conditional carried the fix's release-rotation rationale with no * regression guard). */ export declare function resolveOnnxCacheDir(config: Pick & { onnxEmbed?: { cacheDir?: string; }; }): string | undefined; /** * Factory: given config, return {llm: {compaction, extraction}, embed} instances. * * Provider selection driven by: * config.llm.compaction.provider + config.llm.compaction.model * config.llm.extraction.provider + config.llm.extraction.model * config.embedding.provider + config.embedding.model */ export declare function getProviders(config: Config): ProviderSet;