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

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Fine-Tuning

> Create and monitor fine-tuning jobs from the Developer Console: training data, job configuration, progress, logs, and checkpoints.

To perform [fine-tuning](/core-concepts/customization/fine-tuning) of an Archetype AI model to
produce a custom model for your use case, use the Fine-Tuning dashboard in the Developer
Console.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-sidebar.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=0b2af7b36fe1ea52343ad081be459d9d" alt="Dashboard menu" width="292" height="274" data-path="developer-console/fine-tuning/console-ft-sidebar.png" />

## Creating a Fine-Tuning Job

Upon choosing the Fine-Tuning dashboard option in the sidebar, the Create Fine-Tuning Job modal
appears.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-create-job1.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=90481ffbde9e96f92c3392c3c146759e" alt="Create Fine-Tuning Job modal" width="719" height="446" data-path="developer-console/fine-tuning/console-ft-create-job1.png" />

Enter a human-readable name for the fine-tuning job, then select the base model that you wish to
fine-tune into a custom model.

Next, choose the method by which the base model should be adapted to your data. The methods
available depend on the base model you've selected. Some models may only offer one method. The
adaptation methods are described in the user interface; click the method's name to see a
description.

After selecting the base model, the modal expands to include options to configure the
fine-tuning job further, such as specifying training files, any validation files that are
needed, and hyperparameter settings.

### Specifying Training and Validation Files

Specifying training files for the fine-tuning job is done similarly to specifying files anywhere
in the Archetype Console: you can provide files in one of three ways:

* By selecting files already present in your library of files
* By entering the file IDs (file names) of existing files in your library
* By uploading new files to your library; doing so automatically adds them to the selected
  files list as well as adding them to your file library

<Tabs>
  <Tab title="Library">
    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-training-library.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=2c8fa1fd3104bc7526821e61447ceff6" alt="Selecting a file from the file library" width="702" height="436" data-path="developer-console/fine-tuning/console-ft-training-library.png" />
  </Tab>

  <Tab title="File IDs">
    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-training-fileids.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=b347ddb2dd45ee379e1bfc33ce96b336" alt="Specifying library files by file ID" width="702" height="352" data-path="developer-console/fine-tuning/console-ft-training-fileids.png" />
  </Tab>

  <Tab title="Upload">
    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-training-upload.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=1f3d9489d4c461e537e03380b0f60086" alt="Uploading files to the library" width="706" height="415" data-path="developer-console/fine-tuning/console-ft-training-upload.png" />
  </Tab>
</Tabs>

If using the Omega model, the list of selected files also lets you edit the class labels used for
each corresponding file.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-training-omega.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=528696ed6b1b1fed07090f97befcefdd" alt="Specifying class labels using the Omega model" width="705" height="300" data-path="developer-console/fine-tuning/console-ft-training-omega.png" />

Validation files are added next, using a similar interface. These files are required by the
Omega model and optional for the Newton C-model.

### Specifying Hyperparameters

The exact hyperparameters available may vary depending on the base model and/or adaptation
method you selected. To learn more about a given hyperparameter, highlight the <Icon icon="circle-info" /> icon next to its name to see a tooltip describing the hyperparameter. All
hyperparameters assume an automatic default value, but you can adjust fine-tuning by setting
particular values that suit your use case and input data.

To specify a custom value for a hyperparameter, first check the **Custom** checkbox next to the
hyperparameter's value input box, then enter the custom value for the hyperparameter.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-hyperparameters.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=54796ecdcd7ad16a7cfaaebb94858f0f" alt="Specifying custom values for hyperparameters" width="353" height="407" data-path="developer-console/fine-tuning/console-ft-hyperparameters.png" />

In the above example, a custom value of `32` is specified for the **Step Size** hyperparameter.

### Advanced Settings

Finally, review the available advanced settings to see if there are any you need to set up.
These are all optional. The advanced settings are:

| Setting       | Description                                                                                                                                                                                                                                                                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Model suffix  | A string appended to the end of the name of the generated model file. This lets you more easily tell it apart from other fine-tuned models, such as if you have multiple versions of the same fine-tune.                                                                                                                                                        |
| Checkpoint ID | The ID of the fine-tuning job checkpoint from which to start working. Using this lets you warm-start fine-tuning from a partially-completed job. Be sure to use a checkpoint whose base model matches the one you selected above. Model weights are initialized from the checkpoint instead of from the base model. The hyperparameters you specify *are* used. |
| Seed          | An optional random number seed to use for reproduceability. If you use the same seed as a previous run, with the same input parameters, you will get the same output. If you leave this blank, the seed is set at random.                                                                                                                                       |

For more information about these advanced settings, or for information about advanced settings
not listed above, highlight the <Icon icon="circle-info" /> icon next to the setting's name to
see a descriptive tooltip.

Once all settings are configured, click the **Create Job** button to create the job and enqueue
it to be run.

## Monitoring a Fine-Tuning Job

To see a list of existing fine-tuning jobs and their current statuses, click **Fine-Tuning** in
the Developer Console dashboard's sidebar.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-list.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=def0e3b89279d293956e38adcbc24702" alt="The Fine-Tuning dashboard" width="1250" height="487" data-path="developer-console/fine-tuning/console-ft-list.png" />

To copy the name or job ID of a job, click the clipboard icon next to its name or ID when you mouse
over a row in the job list.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-dash-copy-name.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=84d25d3c70653177b1fa9e6b6ba2df8c" alt="Copying a job name" width="906" height="150" data-path="developer-console/fine-tuning/console-ft-dash-copy-name.png" />

To view details about a job, click anywhere else in the row. This opens the details view for the
job.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-details.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=ab3848a4d8a774aea120dac0c4653c78" alt="Job details" width="1248" height="1024" data-path="developer-console/fine-tuning/console-ft-details.png" />

At the top is the job's name and current status. Next to this is the **<Icon icon="pause" />
Pause** or **<Icon icon="play" /> Resume** button. The remainder of the details view is divided
into several boxes.

The **Overview** box lists basic information about the job, including:

* The job ID
* The base model on which the fine-tuned model will be based
* The ID of the fine-tuned model (available only once the fine-tuning job has successfully
  completed)
* The checkpoint ID from which the job was warm-started
* The starting timestamp
* The ending timestamp (available only once the job has completed)
* The total amount of time the job took to run (available only once the job has completed)

The **Parameters** box lists basic configuration information about the job, including:

* The number of training files specified
* The number of validation files specified
* The suffix that will be applied to the new fine-tuned model's name
* The random number seed that was specified, if any

The **Training** box shows the progress of the training process. This information is updated
periodically as the training progresses, and is displayed using a tabbed interface.

<Tabs>
  <Tab title="Progress">
    The Progress tab displays progress information about the fine-tuning job, including
    the percentage of the job that is complete, the step that was last completed, the loss,
    the number of checkpoints that have been saved, and the estimated time remaining for the job.

    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-job-progress.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=314e7ce79dad2f030609845474a6c950" alt="Fine-tuning job progress" width="574" height="313" data-path="developer-console/fine-tuning/console-ft-job-progress.png" />

    When fine-tuning based on the Newton-C model, a graph showing Loss compared to the step number is drawn.

    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-loss-steps.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=d73e2f0af9d7248e432769614bf02d4a" alt="Loss • Steps" width="578" height="325" data-path="developer-console/fine-tuning/console-ft-loss-steps.png" />
  </Tab>

  <Tab title="Logs">
    The Logs tab displays log entries for the fine-tuning job. You can filter by the type of log entry, and you can search for specific information in the log.

    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-job-logs.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=f75b5cfda4264e488bbf17641e2373ff" alt="Fine-tuning job logs" width="561" height="339" data-path="developer-console/fine-tuning/console-ft-job-logs.png" />
  </Tab>

  <Tab title="Checkpoints">
    The Checkpoints tab lists the checkpoints that have been recorded for the fine-tuning job. These checkpoints can be used to warm-start a new fine-tuning job, or used as the fine-tuned model checkpoint ID when starting a batch processing job.

    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-job-checkpoints.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=4a489d6c177d96c3cced040dbabc86f1" alt="Fine-tuning job checkpoints" width="574" height="345" data-path="developer-console/fine-tuning/console-ft-job-checkpoints.png" />

    Click the clipboard icon next to the **Checkpoint ID** to copy the ID. This is useful, for example, when you want to warm-start a new job from a given checkpoint or to paste into the Batch Manager to use the fine-tuned checkpoint as the model for a batch processing job.
  </Tab>

  <Tab title="Training Files">
    The Training Files tab lists the training files specified for the job, with the ability to download copies of the files.

    <img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-job-files.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=bb0315f4f712ad892ff239651fca0cd1" alt="Fine-tuning job training files" width="574" height="245" data-path="developer-console/fine-tuning/console-ft-job-files.png" />
  </Tab>
</Tabs>

## Pausing and Resuming a Fine-Tuning Job

To pause a fine-tuning job, open its details view. At the top of the view, to the right of the
fine-tuning job's name and status, is the **Pause** button.

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-ft-pause.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=97b6bf808ca272778139c4bb653fc215" alt="The pause button's location" width="967" height="114" data-path="developer-console/fine-tuning/console-ft-pause.png" />

Click **<Icon icon="pause" /> Pause** to pause the job. The job will pause, freeing resources to
be used by other jobs, and the button's name changes to **<Icon icon="play" /> Resume**. Click
the **<Icon icon="play" /> Resume** button to continue the job from where it left off.

## Using a Fine-Tuned Model

Once fine-tuning has completed, open the **Checkpoints** tab in the fine-tuning job's screen,
then click the clipboard icon next to the checkpoint ID you wish to use as the model for your
batch job. This will copy the checkpoint ID to your clipboard.

Then, go to the [Batch Manager](/developer-console/batch-manager) and set up a new job. Before
starting the job, set the **Fine-tuned checkpoint** field in the **Create Batch Job** panel to
the ID of your model's checkpoint (by pasting the copied ID, for example).

<img src="https://mintcdn.com/archetypeai-bd6fb3cf/Lzk_epGJdQ7MNFad/developer-console/fine-tuning/console-batch-ft-checkpoint.png?fit=max&auto=format&n=Lzk_epGJdQ7MNFad&q=85&s=0245329aabf9cb80065b5603fabfa130" alt="Setting the fine-tuned checkpoint" width="707" height="138" data-path="developer-console/fine-tuning/console-batch-ft-checkpoint.png" />

This field is located immediately after where the source files (such as input files and N-shot
example files) are specified.

When you start the job, it will do so using your fine-tuned model.
