Skip to main content

embed_passages_parallel_with_embedding_choice

Function embed_passages_parallel_with_embedding_choice 

Source
pub fn embed_passages_parallel_with_embedding_choice(
    models_dir: &Path,
    texts: &[String],
    parallelism: usize,
    local_batch_size: usize,
    embedding_backend: EmbeddingBackendChoice,
    llm_backend: LlmBackendChoice,
) -> Result<Vec<Vec<f32>>, AppError>
๐Ÿ‘ŽDeprecated since 1.2.3:

clones the whole corpus; use embed_passages_parallel_shared, which takes an Arc<[String]> and is the real implementation this delegates to

Expand description

v1.0.93 (GAP-OR-INGEST): embeds multiple passages with EmbeddingBackendChoice awareness. When the resolved chain starts with OpenRouter and the client is initialised, uses the HTTP batch API (embed_batch) โ€” no LLM slot consumed, ~200ms per batch.

ยงDeprecated

This entry point takes a BORROWED slice, which cannot be handed to the 'static fan-out tasks, so it clones the entire corpus on every call โ€” a 36k-passage backfill copies every string before a single request is sent. [embed_passages_parallel_shared] takes an Arc<[String]> instead and is the real implementation this delegates to; migrating costs one Arc::from(vec) at the call site and removes the copy.