pub fn get_embedder(
models_dir: &Path,
) -> Result<&'static Mutex<TextEmbedding>, AppError>Expand description
Returns the process-wide singleton embedder, initializing it on first call.
Subsequent calls return the cached instance regardless of models_dir.
§Errors
AppError::Embedding— ONNX model load failure or runtime initialisation error.AppError::Io— cache directory is inaccessible or cannot be created.