# Fine Tuning (OpenAI)

This guide shows how to fine-tune a model within **RagaAI Catalyst** using its built-in **Fine Tuning Enabler**. The Fine Tuning Enabler orchestrates the necessary dataset formatting, job creation, and interaction with third-party platforms (such as OpenAI) under the hood, so you can focus on defining your job configurations and data mappings. Refer to the annotated screenshots below for a visual walkthrough.

### Fine Tuning Enabler

The **Fine Tuning Enabler** is RagaAI Catalyst’s behind-the-scenes orchestrator for:

* **Dataset Conversion**: Automatically transforms your dataset into the structure required by the selected platform.
* **Job Creation**: Safely uploads files and initiates fine-tuning jobs with your chosen hyperparameters.
* **Progress Tracking**: Polls job status from the provider and updates Catalyst in near real-time.
* **Result Registration**: Stores the final fine-tuned model reference so you can easily query or test it in the Playground.

You do not need to perform any extra steps to use the Fine Tuning Enabler; simply provide the correct configurations in the UI, and it handles the rest.

***

### 1. Accessing the Fine-Tuning Tab

1. In the Catalyst sidebar, click **Finetuning**.
2. If you have not created any jobs yet, you will see **“No Job found.”**

<figure><img src="/files/DHcGDHVBvGuYVNdei3cw" alt=""><figcaption></figcaption></figure>

***

### 2. Creating a New Job

1. Click **+ New Job** (see bottom-right corner in the “No Job found” page).
2. A dialog box titled **“Create New Job”** appears.
3. Provide a **Job Name** (such as `New_job`) and click **Create**.

<figure><img src="/files/cE4Pu1F1exS9N3Vxjbcu" alt=""><figcaption></figcaption></figure>

> **Note**\
> After you click **Create**, you will be taken to the **Job Detail** page where you can configure your fine-tuning parameters.

***

### 3. Selecting a Dataset

Once you’re on the **Job Detail** page:

1. Use the **Select Dataset** dropdown at the top-left of the main area to choose from your project’s available datasets (e.g., `new_test_data`, `pii_test_v`).
2. If your project has many datasets, use the search bar within the dropdown to quickly locate the one you need.

<figure><img src="/files/iugvR8ZNv00Nix1LLpee" alt=""><figcaption></figcaption></figure>

> **Important**\
> The chosen dataset’s schema and rows will be used to create prompts, contexts, and responses during fine-tuning. Make sure your dataset is structured appropriately (e.g., columns that can map to prompt, instructions, or answer text).

***

### 4. Configuring Hyperparameters

On the **right-hand side** of the Job Detail page:

1. Under **Platform**, choose your provider (e.g., **OpenAI**).
2. Set your training config values:
   * **Epoch**: Number of training epochs.
   * **Learning Rate**: Learning rate for gradient updates.
   * **Batch Size**: Size of mini-batches during training.

***

### 5. Template and Preview

The **middle panel** displays a **Template** section, illustrating how your dataset columns will map to:

* **System** (overall instructions)
* **User** (prompt)
* **Assistant** (desired response)

You can also see a short **Result** summary at the bottom:

* **JobID** (placeholder if not yet created)
* **Model** (to be determined once you run the job)
* **Status** (e.g., `Draft`, `Running`, or `Succeeded`)

<figure><img src="/files/ATrxlcEAlsYFToPMkiRB" alt=""><figcaption></figcaption></figure>

***

### 6. Executing the Fine-Tuning Job

1. Review your chosen dataset, hyperparameters, and the template.
2. Click **Execute Job** (in the bottom-right corner of the middle panel).
3. If needed, **Save Changes** (top-right corner) to preserve your configuration before or after execution.

Once executed, the **Fine Tuning Enabler** will:

* Convert your dataset into the appropriate JSONL or other required format.
* Upload it securely to the selected platform (e.g., OpenAI).
* Create the corresponding Fine-Tuning job on that platform.
* Poll for job status, updating it in RagaAI Catalyst.

***

### 7. Monitoring Job Status

1. Navigate back to **Finetuning** from Job Status Page
2. Each job card displays whether it is **Running**, **Succeeded**, or **Failed**.
3. Click on a job card to view detailed logs, error messages (if any), and final results (fine-tuned model ID).

> **Tip**\
> Once your job succeeds, you can reference the newly fine-tuned model in **Playground** or other parts of RagaAI Catalyst.

***


---

# 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.raga.ai/ragaai-catalyst/fine-tuning.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.
