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

# Train Model • AI Agents Framework

> train_model: API reference for TrainModel.train_model

# train\_model

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**TrainModel**](../classes/TrainModel) class in the [**train**](../modules/train) module.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def train_model() -> Any
```

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `load_datasets`
* `tokenize_dataset`
* `is_bfloat16_supported`
* `os.getenv`
* `TrainingArguments`
* `SFTTrainer`
* `train_on_responses_only`
* `trainer.train`
* `save_pretrained`

## Used By

* [`TrainModel.run`](../functions/TrainModel-run)
* [`TrainVisionModel.run`](../functions/TrainVisionModel-run)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/train.py#L214">
  `praisonai/train.py` at line 214
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agent Train" icon="dumbbell" href="/docs/concepts/agent-train" />

  <Card title="Training" icon="chart-line" href="/docs/train" />
</CardGroup>
