Embeddings Overview
Embeddings power the semantic (vector) search component of Lucerna’s hybrid search. When embeddingFunction is not set, the indexer auto-selects:
CloudflareEmbeddings— ifCLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENare set in the environmentNomicCodeEmbeddings— otherwise, runs a local code-optimised model via ONNX (no API key required)
Options
Section titled “Options”| Option | Description |
|---|---|
| Local models | NomicCodeEmbeddings, BGESmallEmbeddings, HFEmbeddings — run locally via ONNX |
| Cloudflare | CloudflareEmbeddings — remote, uses Workers AI |
| Custom | Implement EmbeddingFunction to use any provider |
false | Disable semantic search entirely — BM25 only, no model download |
Disable semantic search
Section titled “Disable semantic search”const indexer = new CodeIndexer({ projectRoot: '.', embeddingFunction: false,});