raft
RAFT, or Retrieval-Augmented Fine-Tuning, is a method comprising of a fine-tuning and a RAG-based retrieval phase. It is particularly suited for the creation of
What is raft?
RAFT, or Retrieval-Augmented Fine-Tuning, is a method comprising of a fine-tuning and a RAG-based retrieval phase. It is particularly suited for the creation of agents that realistically emulate a specific human target.
Overview of raft
What it is
RAFT (Retrieval-Augmented Fine-Tuning) is a method that combines fine-tuning with a RAG-based retrieval phase. It is designed for creating agents that realistically emulate a specific human target. The repository includes tools for importing data from various sources, training a persona model, and generating responses with recall.
Key features
- Combines fine-tuning with RAG retrieval to emulate a specific human target.
- Imports data from Substack, LessWrong, EA Forum, Twitter/X, RSS feeds, URLs, and PDFs via the
raft fetchcommand. - Supports thinking models with recall in the thinking phase using
--thinking. - Uses quote-anchored recall: recollections must cite verbatim sentences from source material.
- Provides
raft commentto generate a persona's comment on a given post or text. - Allows separate API endpoints for the persona model, helper LLM, and embeddings.
Use cases
- Creating conversational agents that mimic specific individuals based on their public writing.
- Building personas from forum comments, blog posts, tweets, and other text sources.
- Research on language model behavior and the ability to emulate deterministic patterns.
Getting started
Install the package via pip: pip install -U raft-ft Example usage: import a Substack blog as a persona: raft fetch substack --blog garymarcus For detailed instructions, see the repository README.
License and pricing
License: MIT. Open source.
Based on the project's public README and repository metadata.