/** * Pluggable embedder. Same shape as the LLM client: OpenAI-compatible * endpoint by default, with an optional Anthropic bypass if anyone ever * asks (Anthropic doesn't publish an embeddings API today, so for now the * interface is strictly OpenAI-compatible). * * Defaults assume the user's local Ollama has nomic-embed-text, which * produces 768-dim vectors matching the vec0 table declared in migration 1. */ export interface Embedder { /** Human-readable model ID for logging / trace. */ readonly modelName: string; /** Embedding dimension the model produces. */ readonly dimension: number; /** Embed one string; returns a Float32Array of length `dimension`. */ embed(text: string): Promise; /** Embed a batch; should be at least as efficient as N serial calls. */ embedBatch(texts: string[]): Promise; } export interface EmbedderConfig { apiUrl?: string; apiKey?: string; model?: string; dimension?: number; timeout?: number; } export declare class OpenAICompatibleEmbedder implements Embedder { readonly modelName: string; readonly dimension: number; private apiUrl; private apiKey; private timeout; constructor(config?: EmbedderConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } export declare class EmbedderError extends Error { statusCode: number; details?: string | undefined; constructor(message: string, statusCode: number, details?: string | undefined); } /** Serialize a Float32Array for sqlite-vec's vec_f32() SQL function. */ export declare function vecToJson(v: Float32Array): string; export declare function getEmbedder(): Embedder; /** Test-only: reset the cached embedder (forces env re-read on next getEmbedder()). */ export declare function resetEmbedder(): void;