Skip to main content

select_backend

Function select_backend 

Source
pub async fn select_backend(
    config: &ModelConfig,
) -> Result<Arc<dyn EmbeddingBackend>>
Expand description

Select an embedding backend based on environment variables.

Priority:

  1. DAKERA_BACKEND โ€” explicit backend selection
  2. DAKERA_USE_GPU=1 โ†’ Candle (CUDA/Metal) when the candle feature is compiled in
  3. Default โ†’ OnnxBackend

ยงErrors

Returns an error if the requested backend is not compiled in or fails to initialise.