ReadonlydimensionsOptional ReadonlymaxMaximum tokens per request (optional)
Optional ReadonlymodelThe specific model identifier (e.g., 'text-embedding-3-small', 'BAAI/bge-small-en-v1.5'). Used for cache invalidation: changing the model always triggers a full re-embed, regardless of provider name. Same model via different providers (OpenAI vs Azure vs GitHub Models) produces identical vectors — no invalidation in that case.
ReadonlynameProvider name (e.g., 'github-models', 'openai')
Optional ReadonlypreferredSuggested batch size for this provider (used as default when batchSize is not explicitly configured)
Convert text to embedding vector
OptionalembedBatch convert (optional, for performance)
OptionalembedStream embeddings one-by-one as they arrive (optional, for large batches)
OptionalgetCompute quality metrics for an already-generated set of embeddings
OptionalhealthCheck if provider is available (e.g., valid API key)
OptionalprePre-load the model before the main pipeline loop begins. Implement this on local/ONNX-based providers to surface loading progress. API-backed providers can omit it — the first embed() call is already fast.
OptionalonProgress: (loaded: number, total: number) => void
Embedding vector dimensions