pub enum EmbeddingModel {
Default,
HuggingFace {
repo: String,
revision: Option<String>,
query_prefix: Option<String>,
doc_prefix: Option<String>,
pooling: Option<Pooling>,
download: bool,
},
Local {
path: PathBuf,
query_prefix: Option<String>,
doc_prefix: Option<String>,
pooling: Option<Pooling>,
},
Endpoint {
url: String,
model: String,
api_key_env: Option<String>,
query_prefix: Option<String>,
doc_prefix: Option<String>,
},
}Expand description
The embedding model backing a catalog’s semantic/hybrid engines.
Variants§
Default
Built-in bge-small-en-v1.5, pinned. The zero-config default.
HuggingFace
A BERT-family HuggingFace repo, loaded in-process via Candle. revision
defaults to main; pooling is auto-detected when None. download
(default false) must be opted into for Ratel to fetch it — otherwise it
must already be in the local cache (Ratel auto-downloads only the default).
Fields
Local
A BERT-family model directory on disk (config.json / tokenizer.json /
model.safetensors), loaded in-process via Candle.
Fields
Endpoint
An OpenAI-compatible /embeddings HTTP endpoint (OpenAI, Ollama, TEI,
vLLM…). api_key_env names the env var holding the key (read at call time).
Pooling lives server-side, so there is no pooling here.
Fields
Implementations§
Source§impl EmbeddingModel
impl EmbeddingModel
Sourcepub fn validate(&self) -> Result<(), EmbedderError>
pub fn validate(&self) -> Result<(), EmbedderError>
Validate a concrete Rust model value. SDK configs normally enter through
Self::resolve, but Rust callers can construct public enum variants
directly; this keeps that path subject to the same nonblank-field rules.
§Errors
EmbedderError::Config when a required source, model, URL, or env-var
name is blank.
Sourcepub fn resolve(spec: EmbeddingSpec) -> Result<EmbeddingModel, EmbedderError>
pub fn resolve(spec: EmbeddingSpec) -> Result<EmbeddingModel, EmbedderError>
Validate and resolve a spec into a concrete model. Runs at catalog construction, so config mistakes surface immediately (not at first search).
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 PartialEq for EmbeddingModel
impl PartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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