# 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="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2FOjh0KygmXmH9SaY8uELK%2Fimage.png?alt=media&#x26;token=27cafca4-88c6-4b87-a444-b6db8d50d68f" 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="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2F2KtwDTbNi5LguXq1aQIy%2Fimage.png?alt=media&#x26;token=a1d665c1-4813-40dc-9553-b12fcfff65c9" 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="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2FxKIjSVmJ0GoKGBH3Vgvi%2Fimage.png?alt=media&#x26;token=c38cb951-434b-45c6-b295-a31b55c9a42a" 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="https://1811327582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYbIiNdp1QbG4avl7VShw%2Fuploads%2F3Nr3l8kaa6iPhCG6dI9b%2Fimage.png?alt=media&#x26;token=5c83f1ba-7bf0-49bc-9b9e-962cc8b916b5" 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.

***
