Skip to content

Repository files navigation

candding

candding is an embedding library for Rust that implements every model architecture on candle's candle-core and candle-nn, with no ONNX runtime and no candle-transformers. It returns dense vectors, sparse rows, multi-vector matrices and rerank scores, and every catalog model is tested against its reference implementation, with a status per device and dtype.

cargo add candding
use candding::TextEmbedding;

fn main() -> candding::Result<()> {
  let model = TextEmbedding::builder("BAAI/bge-small-en-v1.5").build()?;
  let passages = model.passage_embed(&["Embeddings map text to vectors."], None)?;
  let queries = model.query_embed(&["what do embeddings do"], None)?;
  let score: f32 = queries[0].iter().zip(&passages[0]).map(|(q, p)| q * p).sum();
  println!("dim {} score {score:.4}", model.dim());
  Ok(())
}

What ships

Output Entry point Models
Dense vectors TextEmbedding 35, in nine families: BERT, Qwen3, Gemma3, XLM-RoBERTa, MPNet, JinaBERT, NomicBERT, ModernBERT and GTE
Sparse (index, weight) rows SparseTextEmbedding, Bm25TextEmbedding 6: prithivida/Splade_PP_en_v1, naver/splade-code-06B, BAAI/bge-m3, miniCOIL, BM42 and BM25
Multi-vector matrices for late interaction MultiVectorTextEmbedding 4: BAAI/bge-m3, colbert-ir/colbertv2.0, answerdotai/answerai-colbert-small-v1 and jinaai/jina-colbert-v2
One score per query and document TextCrossEncoder 8: cross-encoder/ms-marco-MiniLM-L6-v2, BAAI/bge-reranker-base and -v2-m3, jinaai/jina-reranker-v1-tiny-en and -v2-base-multilingual, and Qwen/Qwen3-Reranker at 0.6B, 4B and 8B

The model catalog lists every model with its licence and its status per device and dtype.

Python

pip install candding
from candding import TextEmbedding

model = TextEmbedding("BAAI/bge-small-en-v1.5")
passages = model.passage_embed(["Embeddings map text to vectors."])
queries = model.query_embed(["what do embeddings do"])
print(model.dim, queries @ passages.T)

The bindings keep the Rust method names and return NumPy arrays. The wheels for Linux x86-64 and aarch64 and for macOS on Apple Silicon, with Metal, need no Rust toolchain; the Python guide has the API and the source build for CUDA.

Requirements

Requirement Needed for
Linux or macOS every build; Windows is not tested
Rust 1.94 or newer every build
A C compiler the default download feature, whose TLS stack builds aws-lc-sys from C; with default-features = false the builders read only the Hugging Face cache and local directories

Documentation

candding.rust-dd.com: getting started, Python, model catalog, API, CLI and roadmap.

License

candding is licensed under either Apache-2.0 or MIT, at your option.

NOTICE carries the attribution for the model implementations derived from Hugging Face text-embeddings-inference.

About

Pure candle embeddings for Rust with no ONNX: dense and sparse ship today, across nine model families; late-interaction, reranker and image models are on the roadmap.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages