Cloudflare Embeddings
CloudflareEmbeddings uses Cloudflare Workers AI (@cf/baai/bge-m3, 1024 dimensions). Requires a Cloudflare account with Workers AI enabled.
import { CodeIndexer, CloudflareEmbeddings } from '@upstart.gg/lucerna';
const indexer = new CodeIndexer({ projectRoot: '.', embeddingFunction: new CloudflareEmbeddings( process.env.CLOUDFLARE_ACCOUNT_ID, process.env.CLOUDFLARE_API_TOKEN, ),});Or set environment variables and let auto-detection handle it:
export CLOUDFLARE_ACCOUNT_ID=your-account-idexport CLOUDFLARE_API_TOKEN=your-api-tokenlucerna index .Properties
Section titled “Properties”| Property | Value |
|---|---|
| Model | @cf/baai/bge-m3 |
| Dimensions | 1024 |
| Languages | Multilingual |
| Oversized texts | Split and averaged (not truncated) |
| Batching | Automatic with retry (3 retries, 30s timeout) |