/** * A reachable local language model server. `available` is always `true` — the * resolver returns `null` (not `{ available: false }`) when nothing is usable, * so a consumer can branch on a simple truthiness check. * * - `endpoint` : base URL to reach the server (no `/v1/...` suffix). * - `model` : the model name to request (explicit knob, else auto-picked). * - `source` : `'auto'` when discovered via the default endpoint, or * `'endpoint'` when an explicit endpoint value was configured. */ export interface LocalModelTier { available: true; endpoint: string; model: string; source: 'auto' | 'endpoint'; } type ProbeFn = (baseUrl: string, fetchImpl?: typeof fetch) => Promise<{ reachable: boolean; }>; type PickModelFn = (baseUrl: string, fetchImpl?: typeof fetch, signal?: AbortSignal) => Promise; export interface ResolveLocalModelTierOpts { /** `WIGOLO_LOCAL_LLM`: 'off' (default) | 'auto' | explicit http(s) endpoint. */ localLlm?: string; /** `WIGOLO_LOCAL_LLM_MODEL`: preferred model; null/undefined ⇒ auto-pick. */ localLlmModel?: string | null; /** Reachability probe; injected for tests. Defaults to the shared probe. */ probe?: ProbeFn; /** Model picker; injected for tests. Defaults to the installed-model picker. */ pickModel?: PickModelFn; /** * Hard ceiling (ms) for the model-list pick, matching the probe budget. A * server can pass the reachability probe then stall on `/api/tags`; the pick * runs under an AbortSignal so it can never outlive this budget. Injected for * tests; defaults to the shared probe timeout. */ pickTimeoutMs?: number; } /** Clear the process-lifetime cache. For tests only. */ export declare function resetLocalModelTierCache(): void; /** * Given the local-LLM config, report whether a local model is available and how * to reach it — the reusable contract C1/C2 consume. Returns `null` when the * tier is off, when no server answers, or on any probe error (never throws). * * The endpoint + `source` are derived from the flag value: * - 'auto' → default (or *_BASE_URL) endpoint, source 'auto'. * - an http(s):// URL → that endpoint verbatim, source 'endpoint'. * - anything else → off (null, no probe). * * The result is cached per endpoint for the process lifetime. */ export declare function resolveLocalModelTier(opts?: ResolveLocalModelTierOpts): Promise; export {}; //# sourceMappingURL=local-tier.d.ts.map