Metadata-Version: 2.4
Name: fed-rag
Version: 0.0.6.post3
Summary: A framework for federated fine-tuning of retrieval-augmented generation (RAG) systems.
Project-URL: Documentation, https://vectorinstitute.github.io/fed-rag/
Project-URL: Repository, https://github.com/VectorInstitute/fed-rag
Project-URL: Issues, https://github.com/VectorInstitute/fed-rag/issues
Project-URL: Changelog, https://github.com/VectorInstitute/fed-rag/blob/main/CHANGELOG.md
Author-email: Andrei Fajardo <andrei.fajardo@vectorinstitute.ai>, David Emerson <david.emerson@vectorinstitute.ai>
Maintainer-email: Andrei Fajardo <andrei.fajardo@vectorinstitute.ai>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: deep learning,federated learning,llms,machine learning,rag,retrieval,semantic search
Requires-Python: <4.0,>=3.10
Requires-Dist: asyncio>=3.4.3
Requires-Dist: datasets>=3.1.0
Requires-Dist: flwr==1.9.0
Requires-Dist: pyarrow>=19.0.1
Requires-Dist: pydantic-settings>=2.7.1
Requires-Dist: pydantic>=2.10.5
Requires-Dist: torch>=2.5.1
Requires-Dist: torchvision>=0.20.1
Requires-Dist: typing-extensions>=4.12.2
Provides-Extra: huggingface
Requires-Dist: peft>=0.14.0; extra == 'huggingface'
Requires-Dist: sentence-transformers>=3.4.1; extra == 'huggingface'
Requires-Dist: transformers>=4.49.0; extra == 'huggingface'
Description-Content-Type: text/markdown

# FedRAG

---------------------------------------------------------------------------------------

[![Linting](https://github.com/VectorInstitute/fed-rag/actions/workflows/lint.yml/badge.svg)](https://github.com/VectorInstitute/fed-rag/actions/workflows/lint.yml)
[![Unit Testing and Upload Coverage](https://github.com/VectorInstitute/fed-rag/actions/workflows/unit_test.yml/badge.svg)](https://github.com/VectorInstitute/fed-rag/actions/workflows/unit_test.yml)
[![codecov](https://codecov.io/github/VectorInstitute/fed-rag/graph/badge.svg?token=JjJBPckP8v)](https://codecov.io/github/VectorInstitute/fed-rag)
![GitHub License](https://img.shields.io/github/license/VectorInstitute/fed-rag)
![GitHub Release](https://img.shields.io/github/v/release/VectorInstitute/fed-rag)
[![DOI](https://zenodo.org/badge/918377874.svg)](https://doi.org/10.5281/zenodo.15092361)

FedRAG is a framework for federated fine-tuning of Retrieval-Augmented Generation
(RAG) systems, wherein a server and potentially several client nodes share an overall
model architecture. Since the model is common to all participants of the system,
fine-tuning can be done collaboratively without any of the raw data leaving any
of the client nodes. Instead only the model weight updates are shared between
the client and the server.

```sh
./fed_rag
├── __init__.py
├── base
│   ├── __init__.py
│   ├── loss.py
│   └── models
│       ├── __init__.py
│       ├── generator.py # BaseGeneratorModel
│       ├── rag.py # BaseRAGModel
│       └── retriever.py # BaseRetrieverModel
├── loss
│   ├── __init__.py
│   ├── generator  # Losses for generation task
│   │   └── __init__.py
│   └── retriever # Losses for retrieval task
│       └── __init__.py
├── models
│   ├── __init__.py
│   ├── generators # Generator models
│   │   └── __init__.py
│   └── retrievers # Retrieval models
│       └── __init__.py
├── ops # module for running fed system
│   └── __init__.py
└── types
    ├── __init__.py
    ├── client.py # Wrapper for flwr.Client
    └── server.py # Wrapper for flwr.Server
```

## Getting Started

## Contributing

Install the project's dev dependencies:
```sh
# while in root directory of project `fed-rag/`
uv sync --all-extras --dev
```

Install the pre-commit hooks:
```sh
pre-commit install
