RAG-FiT
A modular Python library for improving how large language models use retrieved information, by generating RAG-augmented training datasets, fine-tuning models on them with parameter-efficient methods, and measuring the result with RAG-specific metrics.
RAG-FiT is a library for improving a large language model's ability to use external information by fine-tuning on specially created retrieval-augmented generation datasets. It covers four stages: creating a dataset from a chosen RAG technique, including retrieval, ranking, query manipulation and prompt generation; training a model on that dataset with parameter-efficient fine-tuning; running inference with a trained or untrained model; and evaluating the generated output against a configurable list of metrics.
Dataset creation persists RAG interactions in a consistent, model-independent format alongside their metadata, so the same pipeline can be reused across experiments. Evaluation metrics include exact match, F1, ROUGE, BERTScore, RAGAS and classification metrics, computed either per example or across the whole dataset, and custom metrics can be added. Workflows are configured through configuration files rather than code changes, and trained models can be pushed to the Hugging Face Hub.
It installs as an editable Python package, with optional extras for Haystack and DeepEval integrations, and was formerly named RAG Foundry.