import { Metrics } from './metrics.ts'; import { type Device, type RuntimeOptions } from './runtime.ts'; import { type ModelSource } from './source.ts'; export interface EmbedOptions extends RuntimeOptions { /** Quantization variant. Default q8 — a good size/quality point for embedders. */ dtype?: string; /** 'auto' (default) uses WebGPU when available, else WASM/CPU. */ device?: Device; onProgress?: (p: unknown) => void; } /** Embedding model wrapper (feature-extraction) with batching + similarity. */ export declare class NexusEmbedder { private extractor; readonly device: string; readonly modelId: string; readonly metrics: Metrics; private constructor(); /** * Load an embedding model from an explicit source: * * NexusEmbedder.load({ hub: 'Xenova/bge-small-en-v1.5' }) * NexusEmbedder.load({ base: '/models/', id: 'BAAI/bge-small-en-v1.5' }) * NexusEmbedder.load({ archive: fileFromInput }) */ static load(source: ModelSource, opts?: EmbedOptions): Promise; /** Embed one text into a normalized vector. */ embed(text: string): Promise; /** Embed many texts; returns one normalized vector per text. */ embedBatch(texts: string[]): Promise; dispose(): Promise; } /** Cosine similarity of two normalized vectors (= dot product). */ export declare function similarity(a: Float32Array, b: Float32Array): number;