# Open-Instruct

> AllenAI's open codebase for instruction-tuning and post-training LLMs

- Category: Training & Fine-Tuning / Fine-Tuning Frameworks
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/allenai/open-instruct
- Canonical page: https://ai-tldr.dev/tools/open-instruct/

## In short

Open-Instruct is AllenAI's open codebase for instruction-tuning and post-training pretrained language models on publicly available datasets. It sits in the Fine-Tuning Frameworks category of the Training & Fine-Tuning tools and is open-source, written in Python and licensed Apache-2.0. To get started: install dependencies.

## Overview

Open-Instruct is AllenAI's open codebase for instruction-tuning and post-training pretrained language models on publicly available datasets. It collects the scripts, data formats, and training recipes the team used to build the Tulu and OLMo model families, so you can reproduce their work or apply the same methods to your own base models.

It covers the main stages of modern post-training: supervised finetuning (SFT) on instruction data, preference tuning with DPO, and reinforcement learning with verifiable rewards (RLVR). The repo also ships reward-model training and a unified format for mixing instruction datasets, plus LoRA and QLoRA for parameter-efficient finetuning.

It is aimed at researchers and ML engineers who want a documented, reproducible pipeline rather than a one-line wrapper. As a fine-tuning framework, it sits alongside the released model checkpoints and the TÜLU 3 paper, giving you the full recipe from base model to instruction-following model.

## What it does

- Supervised finetuning (SFT) of pretrained models on instruction datasets in a unified format
- Preference tuning with DPO and other preference-finetuning methods
- Reinforcement learning with verifiable rewards (RLVR), plus reward-model (RM) training
- Ready-made recipes for the Tulu 3 and OLMo 2 model families (Llama 3.1 8B/70B, OLMo-2 7B/13B)
- LoRA and QLoRA support for parameter-efficient finetuning
- Released checkpoints on HuggingFace for SFT, DPO, RLVR and reward-model stages

## Getting started

Open-Instruct uses uv for dependency management and ships ready-to-run training scripts. Clone the repo, sync dependencies, then launch one of the recipe scripts.

1. Install dependencies

   The repository uses uv for installation and running code. From the cloned repo, sync the environment.

```bash
uv sync
```

2. Run supervised finetuning (SFT)

   Launch the Tulu 3 8B SFT recipe to instruction-tune a base model.

```bash
bash scripts/train/tulu3/finetune_8b.sh
```

3. Run preference tuning (DPO)

   After SFT, run the DPO recipe to align the model on preference data.

```bash
bash scripts/train/tulu3/dpo_8b.sh
```

4. Try the released models

   If you just want to use the results, download the Tulu and OLMo checkpoints from HuggingFace (for example allenai/Llama-3.1-Tulu-3-8B) or try the free demo at playground.allenai.org.

## When to use it

- Reproduce the Tulu 3 or OLMo 2 post-training pipeline from base model to instruction-following model
- Instruction-tune your own base model with SFT, DPO and RLVR using documented recipes
- Train a reward model and run RLVR experiments on verifiable-reward tasks
- Run parameter-efficient finetuning with LoRA or QLoRA when GPU memory is limited
