pub enum EmbeddingModelChoice {
BgeSmall,
BgeBase,
Nomic,
GteLarge,
OpenAILarge,
OpenAISmall,
OpenAIAda,
}Expand description
Supported embedding models for semantic search
Variants§
BgeSmall
BGE-small-en-v1.5: Fast, 384-dim, ~78% accuracy (default)
BgeBase
BGE-base-en-v1.5: Balanced, 768-dim, ~85% accuracy
Nomic
Nomic-embed-text-v1.5: High accuracy, 768-dim, ~86% accuracy
GteLarge
GTE-large-en-v1.5: Best semantic depth, 1024-dim
OpenAILarge
OpenAI text-embedding-3-large: Highest quality, 3072-dim (requires OPENAI_API_KEY)
OpenAISmall
OpenAI text-embedding-3-small: Good quality, 1536-dim (requires OPENAI_API_KEY)
OpenAIAda
OpenAI text-embedding-ada-002: Legacy model, 1536-dim (requires OPENAI_API_KEY)
Implementations§
Source§impl EmbeddingModelChoice
impl EmbeddingModelChoice
Sourcepub fn to_fastembed_model(&self) -> EmbeddingModel
pub fn to_fastembed_model(&self) -> EmbeddingModel
Get the fastembed EmbeddingModel enum value (only for local models)
§Panics
Panics if called on an OpenAI model. Use is_openai() to check first.
Sourcepub fn dimensions(&self) -> usize
pub fn dimensions(&self) -> usize
Get embedding dimensions
Source§impl EmbeddingModelChoice
impl EmbeddingModelChoice
Sourcepub fn from_dimension(dim: u32) -> Option<Self>
pub fn from_dimension(dim: u32) -> Option<Self>
Infer the best embedding model from vector dimension stored in MV2 file.
This enables auto-detection: users don’t need to specify –query-embedding-model if the MV2 file has vectors. The dimension uniquely identifies the model family.
§Dimension Mapping
- 384 → BGE-small (default local model)
- 768 → BGE-base (could also be Nomic, but same dimension works)
- 1024 → GTE-large
- 1536 → OpenAI small/ada
- 3072 → OpenAI large
Trait Implementations§
Source§impl Clone for EmbeddingModelChoice
impl Clone for EmbeddingModelChoice
Source§fn clone(&self) -> EmbeddingModelChoice
fn clone(&self) -> EmbeddingModelChoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbeddingModelChoice
impl Debug for EmbeddingModelChoice
Source§impl Default for EmbeddingModelChoice
impl Default for EmbeddingModelChoice
Source§fn default() -> EmbeddingModelChoice
fn default() -> EmbeddingModelChoice
Source§impl Display for EmbeddingModelChoice
impl Display for EmbeddingModelChoice
Source§impl FromStr for EmbeddingModelChoice
impl FromStr for EmbeddingModelChoice
Source§impl PartialEq for EmbeddingModelChoice
impl PartialEq for EmbeddingModelChoice
impl Copy for EmbeddingModelChoice
impl Eq for EmbeddingModelChoice
impl StructuralPartialEq for EmbeddingModelChoice
Auto Trait Implementations§
impl Freeze for EmbeddingModelChoice
impl RefUnwindSafe for EmbeddingModelChoice
impl Send for EmbeddingModelChoice
impl Sync for EmbeddingModelChoice
impl Unpin for EmbeddingModelChoice
impl UnwindSafe for EmbeddingModelChoice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.