
Encodes each String into a dense Embedding by loading any HuggingFace encoder directly in-process with AutoModel and AutoTokenizer, pooled by CLS or mean and optionally L2-normalised. No cloud API. Suited to retrieval, clustering, similarity, and RAG encoding.
Read a corpus from text files, embed each document in-process, and ship the vectors over HTTP into an index.
OCR a page image, embed the recognised text with a self-hosted checkpoint, and forward the vector for retrieval.
model is loaded directly with AutoModel + AutoTokenizer, so it must be a transformers-loadable encoder repo. The embedding dimension is fixed by the checkpoint, so switching model produces vectors of a different width that an existing index will reject.pooling must match the checkpoint's model card: `cls` for BGE / XLM-RoBERTa dense heads (the default, correct for `BAAI/bge-m3`), `mean` for sentence-transformers / E5 / GTE / MiniLM models. The wrong pooling silently degrades vector quality rather than erroring.query_prefix should carry the checkpoint's retrieval instruction on the query side only (BGE's `Represent this sentence...`, or E5's `query: `) and stay empty on the passage side; mismatching the two sides degrades retrieval quality.String short-circuits to a zero-length Embedding without invoking the model. Feeding that into a similarity stage breaks the math, so filter empty inputs upstream. Every input emits exactly one output.normalize produces unit-length vectors so cosine similarity equals the inner product; keep it consistent across the index and the queries.model is hot-swappable at runtime and triggers a model reload (and a GPU memory reclaim on CUDA) on the next call, producing a one-call latency spike. device, pooling, normalize and query_prefix are read once at startup and require a redeploy.device requesting CUDA resolves to CPU when no compatible accelerator is visible at startup; smaller checkpoints run acceptably on CPU.Automated release