pub struct FastEmbedder { /* private fields */ }Expand description
FastEmbed-backed semantic embedder.
Supports multiple ONNX models with configurable dimensions and pooling.
Implementations§
Source§impl FastEmbedder
impl FastEmbedder
Sourcepub fn embedder_id_static() -> &'static str
pub fn embedder_id_static() -> &'static str
Stable embedder identifier for MiniLM (matches vector index naming).
Sourcepub fn model_id_static() -> &'static str
pub fn model_id_static() -> &'static str
Stable model identifier for MiniLM.
Sourcepub fn required_model_files() -> &'static [&'static str]
pub fn required_model_files() -> &'static [&'static str]
Required non-model files for any ONNX embedder.
The ONNX model itself can live at onnx/model.onnx (modern) or
model.onnx (legacy) — use [select_model_file] to find it.
Sourcepub fn model_file_candidates() -> &'static [&'static str]
pub fn model_file_candidates() -> &'static [&'static str]
Candidate ONNX model locations, ordered from preferred to legacy.
Sourcepub fn select_model_file(model_dir: &Path) -> Option<PathBuf>
pub fn select_model_file(model_dir: &Path) -> Option<PathBuf>
Select the ONNX model file, preferring onnx/model.onnx over model.onnx.
Sourcepub fn default_model_dir(data_dir: &Path) -> PathBuf
pub fn default_model_dir(data_dir: &Path) -> PathBuf
Default MiniLM model directory relative to the cass data dir.
Sourcepub fn model_dir_for(data_dir: &Path, embedder_name: &str) -> Option<PathBuf>
pub fn model_dir_for(data_dir: &Path, embedder_name: &str) -> Option<PathBuf>
Get model directory for a specific embedder name.
Sourcepub fn runtime_model_dir_for(
data_dir: &Path,
embedder_name: &str,
) -> Option<PathBuf>
pub fn runtime_model_dir_for( data_dir: &Path, embedder_name: &str, ) -> Option<PathBuf>
Resolve the runtime model directory for an embedder.
model_dir_for is the cass-managed cache location. This variant honors
the explicit FRANKENSEARCH_MODEL_DIR override used by operators who
pre-stage a model bundle outside the cass data directory.
pub fn canonical_name(embedder_name: &str) -> Option<&'static str>
Sourcepub fn config_for(embedder_name: &str) -> Option<OnnxEmbedderConfig>
pub fn config_for(embedder_name: &str) -> Option<OnnxEmbedderConfig>
Get config for a specific embedder by name.
Sourcepub fn load_from_dir(model_dir: &Path) -> EmbedderResult<Self>
pub fn load_from_dir(model_dir: &Path) -> EmbedderResult<Self>
Load the MiniLM model (convenience wrapper).
Sourcepub fn load_with_config(
model_dir: &Path,
config: OnnxEmbedderConfig,
) -> EmbedderResult<Self>
pub fn load_with_config( model_dir: &Path, config: OnnxEmbedderConfig, ) -> EmbedderResult<Self>
Load an ONNX embedder with custom configuration.
Sourcepub fn load_by_name(
data_dir: &Path,
embedder_name: &str,
) -> EmbedderResult<Self>
pub fn load_by_name( data_dir: &Path, embedder_name: &str, ) -> EmbedderResult<Self>
Load an embedder by name from the data directory.
Trait Implementations§
Source§impl SyncEmbed for FastEmbedder
impl SyncEmbed for FastEmbedder
Source§fn embed_sync(&self, text: &str) -> EmbedderResult<Vec<f32>>
fn embed_sync(&self, text: &str) -> EmbedderResult<Vec<f32>>
Source§fn embed_batch_sync(&self, texts: &[&str]) -> EmbedderResult<Vec<Vec<f32>>>
fn embed_batch_sync(&self, texts: &[&str]) -> EmbedderResult<Vec<Vec<f32>>>
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Source§fn is_semantic(&self) -> bool
fn is_semantic(&self) -> bool
Source§fn category(&self) -> ModelCategory
fn category(&self) -> ModelCategory
Source§fn supports_mrl(&self) -> bool
fn supports_mrl(&self) -> bool
Auto Trait Implementations§
impl !Freeze for FastEmbedder
impl RefUnwindSafe for FastEmbedder
impl Send for FastEmbedder
impl Sync for FastEmbedder
impl Unpin for FastEmbedder
impl UnsafeUnpin for FastEmbedder
impl UnwindSafe for FastEmbedder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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> 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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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