
Encodes each String into a dense Embedding with a bound BGE sentence-transformers checkpoint, with an optional retrieval query prefix and L2 normalisation. Suited to text retrieval, clustering, similarity, and RAG query/passage encoding.
Read a corpus from text files, embed each document, and ship the vectors over HTTP into an index.
OCR a page image, embed the recognised text, and forward the vector for retrieval.
query_prefix should be set to the BGE retrieval instruction only for query-side text and left empty for passages; mismatching the two sides degrades retrieval quality.String short-circuits to a zero-length Embedding. Feeding that into a similarity stage breaks the math, so filter empty inputs upstream.normalize produces unit-length vectors so cosine similarity equals the inner product; keep it consistent across the index and the queries.device requesting CUDA resolves to CPU when no compatible accelerator is visible at startup; the smaller BGE variants run acceptably on CPU.Automated release