# Fine-Tune

In the following guide, we'll learn how to use the Yotta AI fine-tuning CLI tool to fine-tune a Llama 3 7B model on a testing dataset.

## Install the CLI

To get started, install the Yotta Python CLI:

{% code overflow="wrap" fullWidth="false" %}

```sh
pip install --upgrade yotta
```

{% endcode %}

## Authentication

The API Key can be configured via setting the `YOTTA_API_KEY` environment variable by running the following command:

```sh
export YOTTA_API_KEY=xxxxx
```

## Uploading Data

To upload your data, run the following command. Remember to replace `PATH_TO_DATA_FILE` with the path to your dataset.

```
yotta files upload {PATH_TO_DATA_FILE}
```

## Start Fine-Tuning Job

You now can start the fine-tuning job based on your training file and model. The command line is:

```
yotta fine-tuning start --training-file {FILE_ID} --model {MODEL_NAME} --wandb-api-key {WANDB_API_KEY}
```

## Monitor Jobs

You can use the following command line to get the progress of a job:

```
yotta fine-tuning list-events {FINE-TUNING_ID}
```

## Other Useful CLI Commands

```sh
# list all available commands
yotta --help

# check which models are available.
yotta models list

# check your jsonl file
yotta files check test.jsonl

# upload your jsonl file
yotta files upload test.jsonl

# list your uploaded files
yotta files list

# retrieve progress updates about the finetune job
yotta fine-tuning retrieve ft-01b7df2b-122a-4b84-9838-4d84200dc7ac

# download your fine-tuned model using the uuid of your fine-tuning job
yotta fine-tuning download ft-01b7df2b-122a-4b84-9838-4d84200dc7ac 
```

## **Pricing**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yottalabs.ai/products/fine-tune.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
