Description
Add a HuggingFaceEmbedder using the sentence-transformers library for fully local, open-weight embeddings — no API key required.
Motivation
Not every user wants to call an external API. Local embeddings are faster for bulk ingestion, free, and privacy-preserving. all-MiniLM-L6-v2 is a solid default that balances quality and speed.
Acceptance criteria
Files to touch
ragframework/embeddings/huggingface.py — new file
ragframework/embeddings/__init__.py — export it
tests/test_embeddings/test_huggingface.py — new test file
Resources
Description
Add a
HuggingFaceEmbedderusing thesentence-transformerslibrary for fully local, open-weight embeddings — no API key required.Motivation
Not every user wants to call an external API. Local embeddings are faster for bulk ingestion, free, and privacy-preserving.
all-MiniLM-L6-v2is a solid default that balances quality and speed.Acceptance criteria
HuggingFaceEmbedderinragframework/embeddings/huggingface.pyEmbedderfromragframework/base.pymodel_name(default:"all-MiniLM-L6-v2") and optionaldevice("cpu"/"cuda")sentence-transformers(already in[huggingface]extra inpyproject.toml)EmbedderErroron failureragframework/embeddings/__init__.pyCHANGELOG.mdupdated under[Unreleased]Files to touch
ragframework/embeddings/huggingface.py— new fileragframework/embeddings/__init__.py— export ittests/test_embeddings/test_huggingface.py— new test fileResources
RandomEmbedderinragframework/embeddings/random_embedder.pyas reference