Skip to content

Embeddings Overview

Embeddings power the semantic (vector) search component of Lucerna’s hybrid search. When embeddingFunction is not set, the indexer auto-selects:

  1. CloudflareEmbeddings — if CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN are set in the environment
  2. NomicCodeEmbeddings — otherwise, runs a local code-optimised model via ONNX (no API key required)
OptionDescription
Local modelsNomicCodeEmbeddings, BGESmallEmbeddings, HFEmbeddings — run locally via ONNX
CloudflareCloudflareEmbeddings — remote, uses Workers AI
CustomImplement EmbeddingFunction to use any provider
falseDisable semantic search entirely — BM25 only, no model download
const indexer = new CodeIndexer({
projectRoot: '.',
embeddingFunction: false,
});