> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trymonte.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SFT

> Train on example conversations

Supervised fine-tuning trains the model to produce a stated response for each prompt. It fits when the target output can be written down, and it often comes before [DPO](https://docs.trymonte.ai/training/dpo.md) or [GRPO](https://docs.trymonte.ai/training/grpo.md).

## Prepare the Data

SFT trains on a [dataset](https://docs.trymonte.ai/datasets/overview.md) added with `--kind sft`. Each row of `support-replies` is a ticket and what a support agent did with it, as a chat `messages` list:

```json theme={null}
{"messages": [{"role": "system", "content": "Answer from the knowledge base with search_kb, or call escalate_to_human with one category."}, {"role": "user", "content": "I was charged twice for my October invoice."}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "escalate_to_human", "arguments": "{\"reason\": \"money: duplicate charge on the October invoice\"}"}}]}]}
```

```bash theme={null}
monte dataset add support-replies --from-file demos.jsonl --kind sft
```

## Start a Run

```bash theme={null}
monte train support-triage \
  --config triage-sft \
  --data support-replies \
  --steps 200 \
  --from-base
```

## Parameters

| Parameter | Description |
| - | - |
| `model` | The base model |
| `lora` | Adapters instead of a full fine-tune |
| `batch_size` | Rows in one step |
| `learning_rate` | The peak learning rate |
| `max_seq_length` | The longest row in tokens. A longer row is truncated. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.