luplo.core.embedding.local

Local embedding backend using sentence-transformers (BGE-M3).

Requires the luplo[vector-local] extra:

uv pip install 'luplo[vector-local]'

Classes

LocalEmbedding

Embedding backend backed by a local sentence-transformers model.

Module Contents

class luplo.core.embedding.local.LocalEmbedding(model_name: str = 'BAAI/bge-m3')

Embedding backend backed by a local sentence-transformers model.

Parameters:

model_name – HuggingFace model ID (default BAAI/bge-m3).

async embed(texts: list[str]) list[list[float] | None]

Embed texts using the local model.

Note: sentence-transformers is synchronous; this call blocks. For production use, consider wrapping in asyncio.to_thread.