FedRAG is an open-source framework for federated fine-tuning of Retrieval-Augmented Generation (RAG) systems.
Transform centralized RAG fine-tuning into federated learning with just a few additional lines of code.
Seamlessly integrates with popular frameworks including HuggingFace, LlamaIndex, and LangChain — use the tools you already know.
Clean, intuitive abstractions that simplify RAG fine-tuning while maintaining full flexibility and control.
# pypi
pip install fedrag
# conda-forge
conda install -c conda-forge fed-rag
Note
Extras for fed-rag
are also available, such as the HuggingFace extra, which
can be installed via pip install fed-rag[huggingface]
git clone https://github.com/VectorInstitute/fed-rag.git
cd fed-rag
# install using pip
pip install -e .
# or, install using uv, our package manager tool of choice
uv sync --all-extras --group dev --group docs
For more detailed documentation, visit our official documentation site.
Tip
This README provides a high-level overview, but our official documentation is updated more frequently with the latest features, tutorials, and API changes. For the most current information, please refer to the documentation site.
Check out our examples directory for more detailed usage examples:
- Basic RAG fine-tuning with federated learning
- Implementing RA-DIT with FedRAG
- Custom federated aggregation strategies
- Integration with popular LLM frameworks
We welcome contributions! Please see our Contributing Guide for more details.
If you use FedRAG in your research, please cite our library:
@software{Fajardo_fed-rag_2024,
author = {Fajardo, Andrei and Emerson, David},
doi = {10.5281/zenodo.15092361},
license = {Apache-2.0},
month = mar,
title = {{fed-rag}},
url = {https://github.com/VectorInstitute/fed-rag},
version = {0.0.8},
year = {2024}
}
Note
The above citation may not reflect the most recent version of the library. We recommend using the Github citation widget (i.e. "Cite this respository") to obtain a citation entry reflecting the latest released version.
FedRAG is released under the Apache License 2.0.
FedRAG is developed and maintained by the Vector Institute.