/** * ONNX Embedding Model * * Uses @huggingface/transformers to run Harrier-OSS-v1-270M for * text embeddings. Produces 640-dimensional normalized vectors suitable * for semantic search. * * Model details: * - onnx-community/harrier-oss-v1-270m-ONNX (q4 quantized) * - ~344MB download, cached in ~/.cache/huggingface/ * - 640-dimensional output vectors * - Pre-pooled sentence_embedding output (no manual pooling needed) * - Already L2-normalized * - Lazy initialization: first call ~5-10s, subsequent ~100ms */ /** * Embedding model using @huggingface/transformers + ONNX Runtime */ export declare class EmbeddingModel { private tokenizer; private model; private isLoaded; /** * Load the ONNX model. * * Downloads the model on first use (~344MB, q4). Subsequent calls * use the cached model from ~/.cache/huggingface/. * * @param _modelPath - Ignored (kept for backward compatibility). The model * is always downloaded from HuggingFace Hub. */ load(_modelPath?: string): Promise; /** * Check if the model is loaded */ isReady(): boolean; /** * Get the embedding dimension */ getDimension(): number; /** * Embed a single text * * @param text - Text to embed * @param options - Options. isQuery is accepted for forward compatibility but * does not change behavior (Harrier needs no instruction prefix). * @returns 640-dimensional normalized embedding vector */ embed(text: string, options?: { isQuery?: boolean; }): Promise; /** * Embed multiple texts in batch * * @param texts - Texts to embed * @returns Array of 640-dimensional embedding vectors */ embedBatch(texts: string[]): Promise; /** * Dispose of the model resources */ dispose(): Promise; } /** * Create a dummy embedding for testing * * Useful when ONNX model is not available. * * @param seed - Seed for reproducible random embeddings * @returns Random embedding with current model dimensions */ export declare function createDummyEmbedding(seed?: number): number[]; /** * Create deterministic embedding from text hash * * This creates a consistent (but not semantically meaningful) embedding * based on the text content. Useful for testing without loading the model. * * @param text - Text to create embedding for * @returns Deterministic embedding with current model dimensions */ export declare function createHashBasedEmbedding(text: string): number[]; //# sourceMappingURL=onnx.d.ts.map