pub struct EmbeddingConfig {
pub provider: String,
pub model: String,
pub url: String,
pub dimensions: usize,
pub cache_capacity: usize,
pub batch_size: usize,
pub dtype: String,
}Expand description
Embedding provider configuration.
Fields§
§provider: StringProvider name: “candle” (default), “ollama”, or “openai”.
model: StringModel name (provider-specific). For Candle: HF repo ID (e.g. “BAAI/bge-base-en-v1.5”).
url: StringAPI URL for remote providers.
dimensions: usizeEmbedding dimensions for remote providers (Ollama/OpenAI).
Ignored by Candle — reads hidden_size from model’s config.json.
cache_capacity: usizeLRU cache capacity.
batch_size: usizeBatch size for embedding forward passes (GPU memory trade-off).
dtype: StringWeight dtype: “f32” (default), “f16” (half precision), “bf16”. F16 halves memory and is faster on Metal GPU.
Trait Implementations§
Source§impl Clone for EmbeddingConfig
impl Clone for EmbeddingConfig
Source§fn clone(&self) -> EmbeddingConfig
fn clone(&self) -> EmbeddingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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 EmbeddingConfigwhere
EmbeddingConfig: Default,
impl<'de> Deserialize<'de> for EmbeddingConfigwhere
EmbeddingConfig: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more