embedding
section in your r2r.toml
file to configure your embedding provider. Here are some example configurations:
LiteLLM (Default)
OpenAI
Ollama (Local)
update_files
: When updating existing files in the systemingest_files
: During the ingestion of new filessearch
: For embedding search queriesrag
: As part of the Retrieval-Augmented Generation processEmbeddingProvider
class and implementing the required methods. This allows you to integrate any embedding model or service into R2R.
EmbeddingConfig
: A configuration class for Embedding providers.EmbeddingProvider
: An abstract base class that defines the interface for all Embedding providers.EmbeddingConfig
class is used to configure Embedding providers:
EmbeddingProvider
is an abstract base class that defines the common interface for all Embedding providers:
EmbeddingProvider
.get_embedding
, get_embeddings
, rerank
, and tokenize_string
.EmbeddingConfig
class to include your custom provider:r2r.toml
or when initializing the EmbeddingConfig.
base_dimension
in your config matches the actual output of the chosen model.