/** * Shared pipeline cache for local Transformers.js engines. * * Both the text-generation engine (`local-engine.ts`) and the embedding engine * (`local-embedding-engine.ts`) need to lazily load a pipeline per HuggingFace * model id, cache it, and deduplicate concurrent loads of the same model. This * helper captures that shared behavior and bounds the cache with an LRU so a * long-running process that touches many models cannot grow memory without * limit (loaded models are large). * * @module provider/local */ /** A loaded pipeline cache with concurrency-safe, deduplicated loading. */ export interface PipelineCache { /** Load (or return cached) pipeline for the given model id. */ load(cacheKey: string, modelInfo: M): Promise

; /** Whether a pipeline for the given model id is currently loaded. */ has(cacheKey: string): boolean; } /** * Create a bounded, dedup-aware pipeline cache. * * @param loadFn Loads the underlying pipeline for a model. Only invoked on a * cold cache miss; concurrent loads of the same key share a single promise. */ export declare function createPipelineCache(loadFn: (modelInfo: M) => Promise

): PipelineCache; //# sourceMappingURL=pipeline-cache.d.ts.map