#[non_exhaustive]pub enum EmbeddingModel {
BgeSmallEnV15,
BgeBaseEnV15,
BgeLargeEnV15,
MultilingualE5Small,
MultilingualE5Base,
Qwen3Embedding0_6B,
Qwen3Embedding4B,
AllMiniLmL6V2,
ParaphraseMultilingualMiniLmL12V2,
TextEmbedding3Small,
}Expand description
Stable: external consumers may depend on this; breaking changes require a SemVer bump.
Registry of supported local and remote embedding models.
See docs/model.md for model capabilities and identity rules.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BgeSmallEnV15
BGE small English v1.5 (384 dimensions) - fast and efficient.
BgeBaseEnV15
BGE base English v1.5 (768 dimensions) - balanced quality/speed.
BgeLargeEnV15
BGE large English v1.5 (1024 dimensions) - highest quality local.
MultilingualE5Small
Multilingual E5 small (384 dimensions) - multilingual, same arch as BGE.
MultilingualE5Base
Multilingual E5 base (768 dimensions) - best multilingual quality/speed.
Qwen3Embedding0_6B
Qwen3-Embedding-0.6B (1024 dimensions) - multilingual, decoder-only, GPU-accelerated.
Qwen3Embedding4B
Qwen3-Embedding-4B (2560 dimensions, MRL-capable) - multilingual, decoder-only, GPU-accelerated.
AllMiniLmL6V2
all-MiniLM-L6-v2 (384 dimensions) - BERT-class, WordPiece tokenizer, sentence-transformers.
ParaphraseMultilingualMiniLmL12V2
paraphrase-multilingual-MiniLM-L12-v2 (384 dimensions) - multilingual, XLM-R base, sentence-transformers.
TextEmbedding3Small
OpenAI text-embedding-3-small (1536 dimensions) - remote API.
Implementations§
Source§impl EmbeddingModel
impl EmbeddingModel
Sourcepub const fn native_dimensions(&self) -> usize
pub const fn native_dimensions(&self) -> usize
Stable: get the native (full-resolution) output dimension of this model’s embeddings.
Returns the model’s intrinsic dimension regardless of any MRL truncation.
For MRL-capable models with a configured truncation, use ModelConfig::dimensions().
Sourcepub const fn dimensions(&self) -> usize
pub const fn dimensions(&self) -> usize
Stable: get this model’s native output dimension.
See docs/model.md for active-dimension selection.
Sourcepub const fn is_local(&self) -> bool
pub const fn is_local(&self) -> bool
Stable: check if this model can run locally (via lattice-inference).
Sourcepub const fn max_input_tokens(&self) -> usize
pub const fn max_input_tokens(&self) -> usize
Stable: conservative maximum input tokens for chunking and truncation.
See docs/model.md for per-model limits.
Sourcepub const fn query_instruction(&self) -> Option<&'static str>
pub const fn query_instruction(&self) -> Option<&'static str>
Stable: query instruction prefix for asymmetric retrieval, when required.
See docs/model.md for prompt policy and vector-space implications.
Sourcepub const fn document_instruction(&self) -> Option<&'static str>
pub const fn document_instruction(&self) -> Option<&'static str>
Stable: document instruction prefix for asymmetric retrieval, when required.
See docs/model.md for prompt policy and vector-space implications.
Sourcepub const fn max_instruction_bytes(&self) -> usize
pub const fn max_instruction_bytes(&self) -> usize
Stable: byte length of this model’s longest retrieval instruction.
Zero for symmetric models, which take no prefix at all.
Callers apply an instruction to caller-supplied text, so text that has
already been prepared is longer than what the caller passed by at most
this many bytes. Length guards that run on prepared text size themselves
with this; guards that run on caller text use MAX_TEXT_BYTES exactly.
Sourcepub const fn model_id(&self) -> &'static str
pub const fn model_id(&self) -> &'static str
Stable: get the model identifier (HuggingFace ID or provider/model).
Sourcepub const fn supports_output_dim(&self) -> bool
pub const fn supports_output_dim(&self) -> bool
Stable: whether this model supports configurable output dimensions (MRL/Matryoshka).
Sourcepub const fn bert_pooling(&self) -> Option<BertPooling>
pub const fn bert_pooling(&self) -> Option<BertPooling>
Stable: BERT pooling strategy for this model, or None for non-BERT paths.
See docs/model.md for pooling routing.
Sourcepub const fn key_version(&self) -> &'static str
pub const fn key_version(&self) -> &'static str
Stable: embedding key revision string for this model family.
Trait Implementations§
Source§impl Clone for EmbeddingModel
impl Clone for EmbeddingModel
Source§fn clone(&self) -> EmbeddingModel
fn clone(&self) -> EmbeddingModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EmbeddingModel
Source§impl Debug for EmbeddingModel
impl Debug for EmbeddingModel
Source§impl Default for EmbeddingModel
impl Default for EmbeddingModel
Source§fn default() -> EmbeddingModel
fn default() -> EmbeddingModel
Source§impl<'de> Deserialize<'de> for EmbeddingModel
impl<'de> Deserialize<'de> for EmbeddingModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for EmbeddingModel
impl Display for EmbeddingModel
impl Eq for EmbeddingModel
Source§impl FromStr for EmbeddingModel
impl FromStr for EmbeddingModel
Source§impl Hash for EmbeddingModel
impl Hash for EmbeddingModel
Source§impl PartialEq for EmbeddingModel
impl PartialEq for EmbeddingModel
Source§impl Serialize for EmbeddingModel
impl Serialize for EmbeddingModel
impl StructuralPartialEq for EmbeddingModel
Auto Trait Implementations§
impl Freeze for EmbeddingModel
impl RefUnwindSafe for EmbeddingModel
impl Send for EmbeddingModel
impl Sync for EmbeddingModel
impl Unpin for EmbeddingModel
impl UnsafeUnpin for EmbeddingModel
impl UnwindSafe for EmbeddingModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.