post_cortex_embeddings/embeddings/backends/mod.rs
1// Copyright (c) 2025 Julius ML
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in all
11// copies or substantial portions of the Software.
12
13//! Concrete [`EmbeddingBackend`](super::backend::EmbeddingBackend) implementations.
14//!
15//! - [`StaticHashBackend`] — hash-based fallback, always compiled in. Used
16//! only for `EmbeddingModelType::StaticSimilarityMRL` and as the last
17//! resort when both `bert` and `model2vec` features are disabled.
18//! - [`BertBackend`] (feature `bert`) — Candle + HuggingFace Hub BERT
19//! transformer models (MiniLM / multilingual / TinyBERT / BGE).
20//! - [`Model2VecBackend`] (feature `model2vec`, default) — `model2vec-rs`
21//! static embeddings for the Potion family (multilingual / code).
22
23#[cfg(feature = "bert")]
24pub mod bert;
25#[cfg(feature = "model2vec")]
26pub mod model2vec;
27pub mod static_hash;
28
29#[cfg(feature = "bert")]
30pub use bert::BertBackend;
31#[cfg(feature = "model2vec")]
32pub use model2vec::Model2VecBackend;
33pub use static_hash::StaticHashBackend;