pub struct EmbeddingConfig {
pub provider: String,
pub model: Option<String>,
pub dims: Option<usize>,
pub batch_size: usize,
pub max_retries: u32,
pub timeout_secs: u64,
pub url: Option<String>,
}Expand description
Embedding provider configuration.
Controls which embedding provider is used and its parameters.
When provider = "disabled", no embeddings are generated and
semantic/hybrid search modes will return errors.
§Providers
| Provider | Description |
|---|---|
"disabled" | No embeddings (default) |
"openai" | OpenAI API (text-embedding-3-small, etc.) |
"ollama" | Local Ollama instance (nomic-embed-text, etc.) |
"local" | Built-in models via fastembed (primary) or tract (musl/Intel Mac) (all-minilm-l6-v2, etc.) |
When using "openai", the OPENAI_API_KEY environment variable must be set.
When using "ollama", an Ollama instance must be running (default: http://localhost:11434).
When using "local", the model is downloaded on first use and cached in ~/.cache/huggingface/.
Fields§
§provider: StringProvider name: "disabled", "openai", "ollama", or "local". Default: "disabled".
model: Option<String>Embedding model name (e.g. "text-embedding-3-small", "nomic-embed-text",
"all-minilm-l6-v2"). Required for openai and ollama; optional for local
(defaults to "all-minilm-l6-v2").
dims: Option<usize>Embedding vector dimensionality (e.g. 1536 for text-embedding-3-small).
Required for openai and ollama; auto-detected for local.
batch_size: usizeNumber of texts to embed per batch. Default: 64.
max_retries: u32Maximum retry attempts for transient API errors. Default: 5.
timeout_secs: u64HTTP timeout per request in seconds. Default: 30.
url: Option<String>Base URL for Ollama API. Default: "http://localhost:11434".
Implementations§
Source§impl EmbeddingConfig
impl EmbeddingConfig
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true if an embedding provider is configured (not "disabled").
Trait Implementations§
Source§impl Clone for EmbeddingConfig
impl Clone for EmbeddingConfig
Source§fn clone(&self) -> EmbeddingConfig
fn clone(&self) -> EmbeddingConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbeddingConfig
impl Debug for EmbeddingConfig
Source§impl Default for EmbeddingConfig
impl Default for EmbeddingConfig
Source§impl<'de> Deserialize<'de> for EmbeddingConfig
impl<'de> Deserialize<'de> for EmbeddingConfig
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>,
Auto Trait Implementations§
impl Freeze for EmbeddingConfig
impl RefUnwindSafe for EmbeddingConfig
impl Send for EmbeddingConfig
impl Sync for EmbeddingConfig
impl Unpin for EmbeddingConfig
impl UnsafeUnpin for EmbeddingConfig
impl UnwindSafe for EmbeddingConfig
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§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().