pub enum EmbeddingModel {
AllMiniLmL6V2,
NomicEmbedV1_5,
PotionCode16M,
Custom(CustomModelSpec),
}Expand description
Supported embedding models.
Variants§
AllMiniLmL6V2
all-MiniLM-L6-v2 — generic sentence embeddings (384d, ~91MB). Default model for backward compatibility.
NomicEmbedV1_5
nomic-embed-text-v1.5 — top MTEB general-purpose (768d, ~547MB). Matryoshka representation learning, supports dimension truncation.
PotionCode16M
potion-code-16M — static (model2vec) code embeddings (256d, ~64MB), run in pure Rust: no ONNX Runtime, microseconds per chunk.
Custom(CustomModelSpec)
Any HuggingFace repo with an ONNX export + tokenizer.json
(hf:org/repo[@revision], GL #397).
Implementations§
Source§impl EmbeddingModel
impl EmbeddingModel
pub const DEFAULT: EmbeddingModel = Self::AllMiniLmL6V2
Sourcepub const ALL: &'static [EmbeddingModel]
pub const ALL: &'static [EmbeddingModel]
All built-in model variants (custom models are user-defined).
pub fn config(&self) -> ModelConfig
Sourcepub fn from_str_name(s: &str) -> Option<EmbeddingModel>
pub fn from_str_name(s: &str) -> Option<EmbeddingModel>
Parse model name from string (env var / config file).
Accepts the built-in aliases plus the hf:org/repo[@revision] scheme
for custom HuggingFace models (GL #397).
Sourcepub fn storage_dir_name(&self) -> String
pub fn storage_dir_name(&self) -> String
Unique subdirectory name for model storage isolation.
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 moreSource§impl Debug for EmbeddingModel
impl Debug for EmbeddingModel
Source§impl<'de> Deserialize<'de> for EmbeddingModel
impl<'de> Deserialize<'de> for EmbeddingModel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EmbeddingModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EmbeddingModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for EmbeddingModel
impl Display for EmbeddingModel
impl Eq 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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for EmbeddingModel
Auto Trait Implementations§
impl Forget for EmbeddingModel
impl Freeze for EmbeddingModel
impl Move for EmbeddingModel
impl RefUnwindSafe for EmbeddingModel
impl Send for EmbeddingModelwhere
RawVecInner: Send,
impl Sync for EmbeddingModelwhere
RawVecInner: Sync,
impl Unpin for EmbeddingModel
impl UnsafeUnpin for EmbeddingModel
impl UnwindSafe for EmbeddingModelwhere
RawVecInner: UnwindSafe,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more