/** * Targeted prewarm — pulls profile.prewarm tiers into VRAM at server startup * so the first real Claude call doesn't eat cold-load latency. * * Behavior is profile policy, not magic: * - dev-rtx5080: prewarm = ["instant"] * - dev-rtx5080-llama: prewarm = ["instant"] * - m5-max: prewarm = [] (cold-load on unified memory is ~free) * * Each prewarm attempt logs a {kind: "prewarm", ...} NDJSON event with * model, success/failure, elapsed_ms, and residency. That keeps benchmarks * able to distinguish cold from warm and keeps adoption data clean. * * Failures are logged but never thrown — server startup must not depend on * Ollama being reachable. If the model is missing or Ollama is down, the * server still comes up; the user sees the prewarm failure in the log. */ import { type Tier } from "./tiers.js"; import type { RunContext } from "./runContext.js"; import type { Logger } from "./observability.js"; /** Per-tier prewarm timeout: max(floor, 2× the tier's runtime timeout). */ declare function prewarmTimeoutForTier(ctx: RunContext, tier: Tier): number; /** Exported for tests. */ export { prewarmTimeoutForTier }; /** True while a runPrewarm pass is active. Safe to call from anywhere. */ export declare function isPrewarmInProgress(): boolean; /** * If prewarm is still running, emit one `prewarm:in_progress_request` event * tagged with the tool name. Callers use this from the tool wrap in * createServer so tool code itself doesn't need to know about prewarm. * Never throws; log failures are swallowed by the logger itself. */ export declare function notePrewarmInProgressRequest(logger: Logger, tool: string): void; /** * Run prewarm for the given tiers. Each tier issues a minimal generate * (`prompt: "ok", num_predict: 1`) with `keep_alive: -1` so the model * stays resident afterwards. * * Returns the count of successful prewarms; never throws. */ export declare function runPrewarm(ctx: RunContext, tiers: Tier[]): Promise; //# sourceMappingURL=prewarm.d.ts.map