Skip to main content

create_embedding_model

Function create_embedding_model 

Source
pub fn create_embedding_model(
    config: &EmbeddingModelConfig,
) -> OrbokResult<Box<dyn EmbeddingModel>>
Expand description

Construct an embedding model from configuration.

  • Mock backend: always works, no model file required.
  • OnnxRuntime: requires --features tract and the model file.
  • CandleCpu/CandleCuda: requires --features candle and weights.

Returns OrbokError::Cache with a human-readable message when the requested backend is not compiled in, so callers can degrade to keyword-only mode.