freshcrate
Skin:/
Home > Frameworks > fed-rag

fed-rag

A framework for fine-tuning retrieval-augmented generation (RAG) systems.

Why this rank:Strong adoptionHealthy release cadence

Description

A framework for fine-tuning retrieval-augmented generation (RAG) systems.

README

logo

FedRAG


Linting Unit Testing and Upload Coverage codecov GitHub License GitHub Release DOI Ask DeepWiki

FedRAG is an open-source framework for fine-tuning Retrieval-Augmented Generation (RAG) systems across both centralized and federated architectures.

Simplified RAG fine-tuning across centralized or federated architectures

Advanced RAG fine-tuning

Comprehensive support for state-of-the-art RAG fine-tuning methods that can be federated with ease.

Work with your tools

Seamlessly integrates with popular frameworks including HuggingFace, LlamaIndex, and LangChain โ€” use the tools you already know.

Lightweight abstractions

Clean, intuitive abstractions that simplify RAG fine-tuning while maintaining full flexibility and control.

Installation

From package managers

# pypi
pip install fed-rag

# 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]

From source

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

Documentation

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.

Examples

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

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

Citation

If you use FedRAG in your research, please cite our library:

@software{Fajardo_fed-rag_2025,
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.27},
year = {2025}
}

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.

License

FedRAG is released under the Apache License 2.0.

Acknowledgements

FedRAG is developed and maintained by the Vector Institute.

Release History

VersionChangesUrgencyDate
v0.0.27## What's Changed * [docs] Update mcp cookbook with training of smaller generator model to avoid OOM by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/424 * [docs] add link to paper by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/425 * [chore] Add docstrings for `exceptions` module by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/427 * [docs] update paper link to point to camera-ready version by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/429Low6/18/2025
v0.0.26## What's Changed * [version] bump to version v0.0.25.post1 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/421 * Bump the all-python-packages group with 5 updates by @dependabot in https://github.com/VectorInstitute/fed-rag/pull/422 * Batching and cosine changes by @amasin2111 in https://github.com/VectorInstitute/fed-rag/pull/366 * [version] bump version to v0.0.26 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/423 **Full Changelog**: https://github.com/VectorInsLow6/10/2025
v0.0.25.post1## What's Changed * Bump the all-python-packages group across 1 directory with 4 updates by @dependabot in https://github.com/VectorInstitute/fed-rag/pull/407 * [docs] integrations page update by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/408 * [docs] Add docs for LangChain Bridge by @czakop in https://github.com/VectorInstitute/fed-rag/pull/409 * [Feature] add complete method to `BaseGenerator` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/410 * [Feature] Add notLow6/9/2025
v0.0.24## What's Changed * [feature] Add `NoEncodeBaseKnowledgeStore` and `NoEncodeAsyncBaseKnowledgeStore` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/385 * [Feature] Adds `NoEncodeRAGSystem` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/386 * [Feature] Verify bridge framework version by @czakop in https://github.com/VectorInstitute/fed-rag/pull/381 * [Feature] Add `AsyncNoEncodeRAGSystem` and `AsyncRAGSystem` by @nerdai in https://github.com/VectorInstitute/fed-rag/Low6/2/2025
v0.0.23## What's Changed * [Feature] Add ability to save benchmark evaluations to a JSONL file by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/377 * [Feature] Add BaseAsyncKnowledgeBase (#262) by @czakop in https://github.com/VectorInstitute/fed-rag/pull/376 * [version] bump version to v0.0.23 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/378 * Revert "v0.0.22 (#378)" by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/379 * [version] bump version to v0.0.23 by @Low5/27/2025
v0.0.22## What's Changed * [chore] docs uncomment installation instructions in unsloth cookbook by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/362 * Passing kwargs for trainer by @amasin2111 in https://github.com/VectorInstitute/fed-rag/pull/365 * [Refactor] Simplify HF generator implementations by @czakop in https://github.com/VectorInstitute/fed-rag/pull/369 * [Fix] Make HF generators return newly generated tokens only by @czakop in https://github.com/VectorInstitute/fed-rag/pull/370 *Low5/26/2025
v0.0.21## What's Changed * [fix] bug for mismatch types in `UnslothFastModelGenerator._get_peft_model()` between LoRA adapters and base model by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/360 * [version] bump version to v0.0.21 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/361 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.20...v0.0.21Low5/23/2025
v0.0.20## What's Changed * Make knowledge node embedding optional and remove redundant embedding in Qdrant upserts by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/353 * [chore] fix link for quick starts benchmarking RAG by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/355 * [Feature] Add `UnslothFastModelGenerator` ๐Ÿฆฅ by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/356 * [Feature] Support `get_peft_model` in `UnslothFastModelGenerator` by @nerdai in https://gitLow5/23/2025
v0.0.19## What's Changed * [docs] Small typo in qdrant example .md by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/324 * [Feature] Add `base.evals` module and `BaseBenchmark` `BaseBenchmarker` classes by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/326 * [Feature] Add `ExactMatchEvaluationMetric` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/333 * Bump datasets from 3.1.0 to 3.6.0 in the all-python-packages group by @dependabot in https://github.com/VectorInsLow5/20/2025
v0.0.18## What's Changed * [refactor] `types` to `data_structures` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/319 * Add trainer managers as a root import by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/320 * Add `fed_rag.trainers` submodule public api by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/321 * [version] bump version to v0.0.18 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/322 **Full Changelog**: https://github.com/VectorInstituLow5/17/2025
v0.0.17## What's Changed * [docs] Remove llama-index example out of case studies since its now in notebooks by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/312 * [chore] configure dependabot by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/314 * Bump the all-python-packages group with 11 updates by @dependabot in https://github.com/VectorInstitute/fed-rag/pull/316 * Bump astral-sh/setup-uv from 5 to 6 by @dependabot in https://github.com/VectorInstitute/fed-rag/pull/315 * RevLow5/17/2025
v0.0.16## What's Changed * [Fix] Fix `LlamaIndexBridge` issue with fed-rag prompt template not playing nice with llama-index's template by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/309 * [API version] Add knowledge stores, generators, retrievers and rest of types to public api (bump to v0.0.2) by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/310 * [version] bump version to v0.0.16 and public api version to v0.0.2 by @nerdai in https://github.com/VectorInstitute/fed-rag/pulLow5/17/2025
v0.0.15## What's Changed * Fix llamaindex inference by @ravi03071991 in https://github.com/VectorInstitute/fed-rag/pull/298 * [version] bump version to v0.0.14.post1 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/301 * [Example] notebook example โ€” basic starter by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/303 * [version] bump post for v0.0.14 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/304 * Nerdai/simpler imports by @nerdai in https://github.com/VectorLow5/16/2025
v0.0.14.post2## What's Changed * [Example] notebook example โ€” basic starter by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/303 * [version] bump post for v0.0.14 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/304 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.14.post1...v0.0.14.post2Low5/15/2025
v0.0.14.post1## What's Changed * Fix llamaindex inference by @ravi03071991 in https://github.com/VectorInstitute/fed-rag/pull/298 * [version] bump version to v0.0.14.post1 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/301 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.14...v0.0.14.post1Low5/14/2025
v0.0.14## What's Changed * Example: RA-DIT dockerize knowledge store build by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/267 * [docs] Button up docsโ€”tutorials section and organize RA-DIT example by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/275 * [docs] Add in-depth examples and skeleton for ra-dit example by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/276 * [docs] In-depth example: Build a Qdrant KS by @nerdai in https://github.com/VectorInstitute/fed-ragLow5/14/2025
v0.0.13## What's Changed * [Example] RA-DIT update fine-tuning to use `HuggingFaceTrainerManager` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/247 * [docs] Update docs with a new quick start: fine-tune a RAG system by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/254 * Move validation of the presence of trainers to `BaseTrainerManager` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/257 * Example: RA-DIT Add `federated_finetune.py` by @nerdai in https://githuLow5/10/2025
v0.0.12## What's Changed * [Fix] Various fixes to make RALT training work by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/248 * [version] bump version to v0.0.12 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/249 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.11...v0.0.12Low5/4/2025
v0.0.11## What's Changed * [chore] Update docs with `HuggingFaceTrainerForRALT` and torch trainer classes. by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/244 * [Fix] Various bugs to make LSR trainer work by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/245 * [version] bump version to v0.0.11 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/246 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.10...v0.0.11Low5/3/2025
v0.0.10## What's Changed * Add exception for missing extra error by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/208 * [Feature] Data collators for LSR (both `huggingface` and `torch`) by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/187 * [chore] Add data collator to docs by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/209 * [chore] Move HFSentenceTransformerRetriever to huggingface module for consistency by @KeithArogo in https://github.com/VectorInstitute/fedLow5/2/2025
v0.0.9## What's Changed * Example: `RA-DIT` โ€” establish part of rig for finetuning generator on `nerdai/fedrag-commonsense-qa` dataset by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/152 * Example: `RA-DIT` centralized training pipeline by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/154 * Example - `RA-DIT` add benchmarker module -- test on MMLU by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/156 * Example: `RA-DIT` improve `QAMixin` for easier subclassing byLow4/25/2025
v0.0.8.post1## What's Changed * Example: `RA-DIT` โ€” establish part of rig for finetuning generator on `nerdai/fedrag-commonsense-qa` dataset by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/152 * Example: `RA-DIT` centralized training pipeline by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/154 * Example - `RA-DIT` add benchmarker module -- test on MMLU by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/156 * Example: `RA-DIT` improve `QAMixin` for easier subclassing byLow4/17/2025
v0.0.8## What's Changed * [docs] add mixin and managed ks + exceptions by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/138 * [Example] `RA-DIT`: Retrieval-Augmented Generator Instruction Tuning by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/102 * Example: `RA-DIT` Setup onboarding data rig! by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/139 * Example: `RA-DIT` small cleanup by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/140 * Example: `RA-DIT`Low4/9/2025
v0.0.7## What's Changed * [post-version] v0.0.6.post1 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/103 * [chore] Add CITATION.cff by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/104 * [fix] CITATION.cff format by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/105 * [chore] Fix pyproject.toml and CITATION.cff incorrect license โ€” apache not mit by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/106 * [Fix] Revert back `__associated_rag_system` attribLow4/6/2025
v0.0.6.post4## What's Changed * [chore] rm asyncio as main dep and bump to v0.0.6.post4 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/128 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.6.post3...v0.0.6.post4Low4/5/2025
v0.0.6.post3## What's Changed * Defining and implementing the persist and load methods in the knowledge store by @lotif in https://github.com/VectorInstitute/fed-rag/pull/107 * [docs] styling by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/113 * [Docs] Vector branding! by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/114 * [docs] fix mobile settings by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/115 * [docs] favicon at 48x48 by @nerdai in https://github.com/VectorInLow4/5/2025
v0.0.6.post2## What's Changed * [chore] Add CITATION.cff by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/104 * [fix] CITATION.cff format by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/105 * [chore] Fix pyproject.toml and CITATION.cff incorrect license โ€” apache not mit by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/106 * [Fix] Revert back `__associated_rag_system` attribute. by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/108 * Docs initial setup by @Low3/30/2025
v0.0.6.post1## What's Changed * [post-version] v0.0.6.post1 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/103 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.6...v0.0.6.post1Low3/26/2025
v0.0.6## What's Changed * [submodules update pointer] by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/91 * Update LICENSE to Apache 2.0 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/92 * [Feature] - Enable `BaseGenerator` and `BaseRetriever` used in `RAGSystem` to access the rag system by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/95 * Small fixes to problems I found while running the quick start example by @lotif in https://github.com/VectorInstitute/fed-Low3/26/2025
v0.0.5## What's Changed * (Example: RA-DIT) - Mock generator training loop; federated for a 350M model by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/67 * Re org RA-DIT example app by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/69 * Add `examples-vector-compute` as a private submodule by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/70 * [chore] Update `examples-vector-compute` submodules pointer by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/7Low3/18/2025
v0.0.4## What's Changed * Add ability to specify device on load for HF Models by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/55 * Adds `federate.trainer.huggingface` decorators by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/56 * Adds `federate.tester.huggingface` and associated inspectors by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/59 * Adds `HuggingFaceFLTask` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/61 * [EXAMPLE] - Adds `RA-DIT` rLow3/14/2025
v0.0.3## What's Changed * (Example: RA-DIT) `DragonRetriever` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/26 * (Example: RA-DIT) - LLM by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/28 * (Example: RA-DIT) Use quantization by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/29 * (Example: RA-DIT) Add `Llama3` LLM by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/30 * `BaseGenerator` and `HFPretrainedModelGenerator` classes by @nerdai in https://gitLow3/12/2025
v0.0.2## What's Changed * [chore] Turn package into workspace, quick-start example as member by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/24 * [version] bump version to v0.0.2 by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/25 **Full Changelog**: https://github.com/VectorInstitute/fed-rag/compare/v0.0.1...v0.0.2Low3/1/2025
v0.0.1## What's Changed * basic README by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/1 * Initial library organization by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/2 * fix release.yml by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/3 * Add codecov by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/4 * `BaseTaskModel` and `PyTorchTaskModel` by @nerdai in https://github.com/VectorInstitute/fed-rag/pull/5 * re-jig quickstart and scaffolding for decLow3/1/2025
v0.0.1-a1Release v0.0.1-a1Low1/19/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

kg-ragThis project implements a comprehensive framework for Knowledge Graph Retrieval Augmented Generation (KG-RAG). It focuses on financial data from SEC 10-Q filings and explores how knowledge graphs can main@2026-06-03
transformersTransformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.v5.10.1
modular-image-classification-frameworkA modular deep learning framework for training and evaluating image classification models on datasets like CIFAR-10 and MNIST. Supports configurable CNN architectures, automated training, and performamain@2026-05-28
FlexRAGFlexRAG: A RAG Framework for Information Retrieval and Generation.0.3.0
kagglerun๐Ÿš€ Run Python on Kaggle's free GPUs directly from your terminal without the need for a browser, streamlining your data science workflow.master@2026-06-07

More from VectorInstitute

retrieval-augmented-generationReference Implementations for the RAG bootcamp
kg-ragThis project implements a comprehensive framework for Knowledge Graph Retrieval Augmented Generation (KG-RAG). It focuses on financial data from SEC 10-Q filings and explores how knowledge graphs can

More in Frameworks

ctranslate2Fast inference engine for Transformer models
schemathesisProperty-based testing framework for Open API and GraphQL based apps
spec_driven_developSpec-Driven Develop is a platform-agnostic AI agent skill that automates the pre-development workflow for large-scale complex tasks. It is not a framework, not a runtime, not a package manager โ€” it is
DrasilGenerate all the things (focusing on research software)