Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Flags

The laurus crate ships with no default features. Enable embedding support as needed.

Available Flags

FeatureDescriptionKey Dependencies
embeddings-candleLocal BERT embeddings and ColBERT token vectors via Hugging Face Candlecandle-core, candle-nn, candle-transformers, hf-hub, tokenizers
embeddings-openaiOpenAI API embeddingsreqwest
embeddings-multimodalCLIP multimodal embeddings (text + image)image, embeddings-candle
embeddings-allAll embedding features combinedAll of the above

What Each Flag Enables

embeddings-candle

Enables CandleBertEmbedder for running BERT models locally on the CPU, and CandleColbertEmbedder (the candle_colbert schema embedder) for ColBERT token vectors used by late-interaction rescoring. Models are downloaded from Hugging Face Hub on first use.

[dependencies]
laurus = { version = "0.12", features = ["embeddings-candle"] }

embeddings-openai

Enables OpenAIEmbedder for calling the OpenAI Embeddings API. Requires an OPENAI_API_KEY environment variable at runtime.

[dependencies]
laurus = { version = "0.12", features = ["embeddings-openai"] }

embeddings-multimodal

Enables CandleClipEmbedder for CLIP-based text and image embeddings. Implies embeddings-candle.

[dependencies]
laurus = { version = "0.12", features = ["embeddings-multimodal"] }

embeddings-all

Convenience flag that enables all embedding features.

[dependencies]
laurus = { version = "0.12", features = ["embeddings-all"] }

TLS and Network Behavior

The embedding features use two independent TLS stacks with different trust sources:

FeatureHTTP clientTLS backendTrust source
embeddings-candle, embeddings-multimodalhf-hub (ureq)rustlsBundled Mozilla root certificates (webpki-roots)
embeddings-openaireqwestrustlsOS trust store (via rustls-platform-verifier)

Model downloads from Hugging Face Hub (embeddings-candle / embeddings-multimodal) use certificates bundled into the binary rather than the operating system’s trust store. This is deliberate: it lets a fully static musl binary download models inside a scratch or distroless container with no ca-certificates package installed. The tradeoff is that SSL_CERT_FILE / SSL_CERT_DIR are not honored on this path, and a custom CA installed only in the OS trust store (for example behind a corporate TLS-inspecting proxy) will not be trusted. If you need to route Hugging Face downloads through such a proxy, pre-populate the cache and point HF_HOME at it, or set HF_ENDPOINT to an internally trusted mirror.

embeddings-openai reads the OS trust store, so containers using it still need ca-certificates installed.

Feature Flag Impact on Binary Size

Enabling embedding features adds dependencies that increase compile time and binary size:

ConfigurationApproximate Impact
No features (lexical only)Baseline
embeddings-candle+ Candle ML framework
embeddings-openai+ reqwest HTTP client
embeddings-multimodal+ image processing + Candle
embeddings-allAll of the above

If you only need lexical (keyword) search, you can use Laurus with no features enabled for the smallest binary and fastest compile time.