pub struct NativeEmbeddingService { /* private fields */ }Expand description
Unstable: model-loading API still evolving; signature may change as lattice-inference matures.
Pure-Rust local embedding service for one BERT-family or Qwen model configuration.
It memoizes the load result independently of cancellation.
See docs/service.md for loading and architecture details.
Implementations§
Source§impl NativeEmbeddingService
impl NativeEmbeddingService
Sourcepub fn new() -> Self
pub fn new() -> Self
Unstable: constructor signature may change; use EmbeddingService trait for stable API.
Sourcepub fn with_model(model_type: EmbeddingModel) -> Self
pub fn with_model(model_type: EmbeddingModel) -> Self
Unstable: constructor signature may change; use EmbeddingService trait for stable API.
Sourcepub fn with_model_config(model_config: ModelConfig) -> Result<Self>
pub fn with_model_config(model_config: ModelConfig) -> Result<Self>
Unstable: create with explicit model config (model + optional MRL truncation dim).
Sourcepub fn with_model_from_env(model_type: EmbeddingModel) -> Result<Self>
pub fn with_model_from_env(model_type: EmbeddingModel) -> Result<Self>
Unstable: create with model config read from LATTICE_EMBED_DIM env var.
Sourcepub fn save_cache(&self) -> Result<usize>
pub fn save_cache(&self) -> Result<usize>
Unstable: persistence API may be moved to a separate manager type.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Unstable: internal diagnostic; may be removed or moved to metrics.
Sourcepub async fn ensure_loaded(&self) -> Result<()>
pub async fn ensure_loaded(&self) -> Result<()>
Unstable: preload the model without performing an encode pass.
Returns the same loading errors as the first embed call.
See docs/service.md for preload behavior.