# Quickstart - Finetune and deploy your first model

This guide walks you through the complete process of fine-tuning and deploying your first model on **AI Studio** quickly and effortlessly.\
By the end of this quickstart, you will learn how to:

* Fine-tune a model using your own dataset
* Evaluate and analyze the model's performance
* Deploy the model for inference through **Model Hub**

### **Step 1. Prepare Your Dataset**

1. Prepare your dataset following **Alpaca** or **ShareGPT**  formats for fine-tuning.
   1. **Alpaca**

      **Alpaca** uses a very simple structure to fine-tune the model with Instruction-following format. The basic structure includes:

      * **instruction**: A string containing the specific task or request that the model needs to perform.
      * **input**: A string containing the information that the model needs to process in order to carry out the task.
      * **output**: A string representing the result the model should return, generated from processing the instruction and input.

      **Example:**

      ```json
      [
        {
          "instruction": "Classify the following into animals, plants, and minerals",
          "input": "Oak tree, copper ore, elephant",
          "output": "Oak tree: Plant\nCopper ore: Mineral\nElephant: Animal"
        },
        {
          "instruction": "Find the area of a circle given its radius.",
          "input": "Radius = 4",
          "output": "The area of a circle with a radius of 4 is equal to 12.5664 square units. This is calculated by using the formula A = πr2, where A is the area, π is roughly equal to 3.1416 and r is the radius of the circle."
        }
      ]
      ```
   2. **ShareGPT**

      **ShareGPT** is designed to represent **multi-turn conversations** between a user and an AI assistant. Each data sample consists of a conversations array, where each turn in the chat includes:

      * **from**: Who is speaking, must be **human** or **gpt** or **system**.
      * **value**: The actual message text from that speaker.

      Each sample should begin with a **system** or **human** message, followed by a **human** or **gpt** message.

      **Example:**

      ```json
      [
        {
          "conversations": [
            {
              "from": "human",
              "value": "Can you tell me what is the best solution to share files between co workers in a local network? There is a ubuntu server available that can be used to host files."
            },
            {
              "from": "gpt",
              "value": "There are several ways to share files between coworkers on a local network, depending on your specific requirements and the infrastructure you have available..."
            }
          ]
        }
      ]
      ```
2. Save your dataset in **JSON**, **JSONL**, or **PARQUET** format.&#x20;

   For a quick start, make sure your file is **under 100 MB** so it can be uploaded directly. If your dataset is larger, refer to the **Data Hub** section for instructions on uploading large files.

### **Step 2. Fine-tune a Model**

1. Open **Model Fine-tuning** → In **Fine-tuning Pipelines**, click **Create Pipeline**.
2. Select a **base model** from **Model Hub**.

   <figure><img src="/files/qhwCVOdb4tCNKVZRZX4Q" alt=""><figcaption></figcaption></figure>
3. Choose the dataset format and upload the dataset you prepared in **Step 1**.

   <figure><img src="/files/CR49pZ1P5ep3tbju5KWj" alt=""><figcaption></figcaption></figure>
4. Configure training parameters and infrastructure.

   <figure><img src="/files/PNncjcmFLT47ve7rdZ1F" alt=""><figcaption></figcaption></figure>
5. Enter a custom **Pipeline name**, check the **Send email** option to receive notifications upon completion and **Save** pipeline.

   <figure><img src="/files/sb3WQWh23wPiYZNfR4Bn" alt=""><figcaption></figcaption></figure>
6. Click **Start** Fine-tuning.

   <figure><img src="/files/OXkQPZGaJQ3QKJiBi1LK" alt=""><figcaption></figcaption></figure>
7. Monitor your job progress in the **Fine-tuning Job Dashboard** - you can track logs, training loss, and evaluation metrics.

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

💡 *Tip:* Training progress and resulting models are automatically versioned and saved in **Model Hub**.

### **Step 3. Evaluate your Model**

1. Go to **Model Testing** → click **Test Jobs** and **Create New Job**.
2. Select the fine-tuned model you created.

   <figure><img src="/files/zWk9aMqsMW9m2BIDGke6" alt=""><figcaption></figcaption></figure>
3. Choose the **Test suite** and **Test criteria**, and upload your test data if needed.

   <figure><img src="/files/4ZA02o07siJCvmaxlLvI" alt=""><figcaption></figcaption></figure>
4. Review the **output** and **evaluation metrics** (Fuzzy Match, BLEU, ROUGE, etc.).

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

### **Step 4. Deploy the Model**

1. In **Model Hub**, locate your fine-tuned model version.
2. Choose deployment mode (e.g., API Endpoint).

   <figure><img src="/files/h7WAaUxpgh0bjhlmgqHj" alt=""><figcaption></figcaption></figure>
3. Once deployed, copy the **Endpoint URL, Model** and **Token** for inference requests. In addition, we can chat directly on the Interactive Session interface.

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

### **Summary**

This completes your first end-to-end workflow on AI Studio. You’re now ready to explore more advanced options like multi-node training, dataset versioning, custom evaluation pipelines, etc.


---

# 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://ai-docs.fptcloud.com/fpt-ai-studio/quickstart-finetune-and-deploy-your-first-model.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.
