Configure local or hosted embedding models in RAGLight 4.
Embedding models are injected independently from the LLM. They implement embed_documents() and
embed_query(), which lets the same pipeline combine local retrieval with hosted generation or the
reverse.
Provider
Class
Extra
Example model
Ollama
OllamaEmbeddings
ollama
nomic-embed-text
OpenAI
OpenAIEmbeddings
openai
text-embedding-3-small
Google Gemini
GeminiEmbeddings
gemini
models/text-embedding-004
Hugging Face
HuggingFaceEmbeddings
huggingface
all-MiniLM-L6-v2
AWS Bedrock
BedrockEmbeddings
bedrock
amazon.titan-embed-text-v2:0
Create an embedding model
from raglight.integrations.ollama import OllamaEmbeddingsembeddings = OllamaEmbeddings(model_name="nomic-embed-text")
from raglight.integrations.openai import OpenAIEmbeddingsembeddings = OpenAIEmbeddings(model_name="text-embedding-3-small")
from raglight.integrations.gemini import GeminiEmbeddingsembeddings = GeminiEmbeddings(model_name="models/text-embedding-004")
from raglight.integrations.huggingface import HuggingFaceEmbeddingsembeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
from raglight.integrations.bedrock import BedrockEmbeddingsembeddings = BedrockEmbeddings( model_name="amazon.titan-embed-text-v2:0", region_name="eu-west-1",)
Connect embeddings to storage
The vector store owns the embedding model used for indexing and querying:
from raglight.integrations.chroma import ChromaVectorStorevector_store = ChromaVectorStore( collection_name="product-docs", embeddings_model=embeddings, persist_directory="./raglight-db",)
Pass the same embeddings object to RAGPipeline. The pipeline validates that all required
components are present, while the vector store performs the actual embedding calls.
Changing the embedding model for an existing collection can make stored and query vectors
incompatible. Use a new collection or rebuild the index.
Custom embeddings
No inheritance is required. A custom object is accepted when it exposes: