raft
RETRIEVAL-AUGMENTED FINETUNING
DOCSv3.1.0

Making more
humans…

without all
the mess.

OPEN SOURCE · LOCAL PROJECTS · YOUR CHOICE OF MODEL

Cloning walkthrough

Interactive terminal workflow from sources to serving.
See the documentation for all commands and options.

RAFT five-phase project overview with demo documents and conversations

ACTUAL WIZARD CAPTURE · DEMO PERSONA↑ ↓ / j k / enter

RAFT doesn’t love you, nor does it hate you.

You’re just made of patterns of better use to someone else.

RAFT trains a persona model on past writing and dated interaction logs. During training, excerpts from the corpus that are relevant to each exchange are provided as retrieved memories before the answer.

This teaches the model how the author drew upon past writings in conversation. Combined with stylistic fine-tuning, it produces realistic and grounded persona models.

01 · MEMORY STOREPast writing (posts, comments, essays) is chunked, dated, and embedded into a vector store with chronological metadata.
02 · TIME-FILTERED RECALLFor each conversation, RAFT retrieves only writings dated prior to the exchange. A reasoning trace connects the recall to the real reply to form a training example.
03 · INFERENCEIn raft comment and raft serve, relevant memories are retrieved from the store and prefilled into the think block before the model generates its reasoning and answer.

Lots of built-in sources

Every importer is available as a single CLI command or through the wizard.
Re-adding an existing source only imports what is new. See all sources in the docs.

LW / EA Forum

raft fetch lesswrong --user <handle>

CONVERSATIONSGROUNDING

X / Bluesky

raft fetch tweets --user <handle>

CONVERSATIONSGROUNDING

Substack

raft fetch substack --blog <subdomain>

GROUNDING

Blogs & feeds

raft fetch rss --url <feed|site>

GROUNDING

Web pages

raft fetch url --url <page>

GROUNDINGCONVERSATIONS

PDFs

raft fetch pdf --file <path>

GROUNDING

Local files

raft interactive

GROUNDINGCONVERSATIONS

Chat logs

raft interactive

CONVERSATIONS

Shared flags (--since, --until, --limit), roles, and environment variables are documented in the docs.

Your first clone: gwernbot

Would you like your draft torn to shreds by the sophisticated pedantry of LessWrong legend gwern? We have all you need to get you started. Fifteen years of comments are the whole training set: the 200 newest threads become dated conversations, everything older becomes retrievable memory. No API keys needed.

11.8kGROUNDING DOCS
200CONVERSATIONS
~12 minTO TRAIN · 2×H100

We do not approve of the basilisking of any RAFT-generated clones.

TERMINAL / GWERN
# Bootstrap the project from LessWrong
pip install -U raft-ft
raft init gwern
cd gwern
raft fetch lesswrong --user gwern --limit 200

# Then: memory, examples, training, talk
raft chunk && raft embed
raft ft:gen --thinking
raft ft:run --model Qwen/Qwen3.8-27B --provider runpod --method qlora
raft comment --web 8090

The full recipe and training flags are in examples/gwern and the docs. raft comment hands the persona a post and returns its comment: recall, thinking, reply.

Quick start

Initialize a project and launch the guided wizard. Grounding documents are optional; you can train on conversations alone.

TERMINAL / QUICK START
# Install RAFT with GPU training support
pip install -U 'raft-ft[hf]'

# Create a project and open the wizard
raft init my-persona
cd my-persona
raft interactive

Every wizard step is also available as a standalone command (see docs).
For tweet imports, add pip install ariadne-x.
GPU finetuning runs locally or on remote providers via opbdh.