Skip to main content

Crate ckg_embed

Crate ckg_embed 

Source
Expand description

Local embeddings via fastembed-rs (nomic-embed-text-v1.5, 768 dim).

Module layout:

  • embedder — public API (Embedder, EMBED_DIM), lazy init, backend trait
  • batching — byte-cap enforcement, batch chunking, output validation
  • verify — ONNX SHA-256 hash verification (cache-poisoning gate)
  • vec_math — cosine similarity helper

Re-exports§

pub use vec_math::cosine;

Modules§

vec_math
Cosine similarity helper.

Structs§

Embedder
Lazy fastembed wrapper. Model is loaded on first embed() call.

Constants§

EMBED_DIM
Expected embedding dimension for NomicEmbedTextV15.

Functions§

has_cached_model
True if cache_dir holds an .onnx file at least min_size_bytes in size (recursive scan). Encapsulates the model-cache layout so callers (e.g. ckg setup) don’t reimplement the walk.