# Building a GUI for Fine-Tuning AI Agents using the RAG Teacher-to-Student Method

**URL:** <https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548>\
**Category:** MI300 Series\
**Tags:** ai, rocm, gpu, developer-program, seek-feedback\
**Created:** [May 23, 2026, 3:16am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548 "2026-05-23T03:16:27Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 23, 2026, 3:16am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/1 "2026-05-23T03:16:27Z")

</div>

Hi everyone,

I’m currently working on a project to build a dedicated Graphical User Interface (GUI) for fine-tuning AI agents, specifically focusing on the **RAG (Retrieval-Augmented Generation) Teacher-to-Student method**.

The goal of this tool is to simplify the pipeline where a larger, robust “Teacher” model (leveraging RAG for highly accurate, domain-specific context) generates high-quality QA pairs and synthetic data to fine-tune a smaller, highly efficient “Student” model.

**I am designing the GUI to handle:**

- **Data Ingestion:** Uploading, chunking, and embedding documents for the RAG vector store.

- **Teacher Configuration:** Setting up the Teacher LLM’s system prompts, generation parameters, and retrieval settings.

- **Student Fine-Tuning:** Managing the actual training loop (e.g., configuring LoRA/QLoRA parameters, tracking loss, and exporting the final weights).

**Developing for AMD Hardware:** Since I want this pipeline to run as efficiently as possible on AMD hardware, I am actively looking into ROCm optimizations. Running a Teacher model for inference while simultaneously training a Student model can be incredibly VRAM-intensive.

**I’d love to get the community’s thoughts on a few things:**

1. **ROCm Optimizations:** Are there any recommended strategies or libraries for managing VRAM effectively when running concurrent inference (Teacher) and training (Student) workloads on AMD GPUs?

2. **Open-Source Integrations:** Are there specific AMD-optimized libraries you highly recommend integrating into this pipeline?

I’ll be sharing updates and open-sourcing the progress as it comes along. Looking forward to hearing your feedback and advice!

---

<div class="post-metadata">

**Author:** ![Hakob\_Arzumanyan](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/hakob_arzumanyan/32/214_2.png) [@Hakob\_Arzumanyan](https://devcommunity.amd.com/u/Hakob_Arzumanyan)\
**Post date:** [May 25, 2026, 10:33am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/2 "2026-05-25T10:33:41Z")

</div>

Hi, this is a great project, just couple suggestions from my side. If you’re running both models on the same AMD GPU, doing it at the same time will likely cause Out Of Memory (OOM) crashes. Instead of concurrent runs, use **vLLM** with FP8 quantization to generate a batch of synthetic data first, save it, and shut it down before starting the training loop. For the Student training, you should absolutely integrate **Unsloth** , which now officially supports ROCm and cuts VRAM usage by up to 80%.

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 25, 2026, 2:56pm UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/3 "2026-05-25T14:56:08Z")

</div>

You are right, bro. Running the teacher and student models simultaneously is actually a bottleneck—I just experienced that firsthand. I have to shut down the teacher model after generating the datasets before I can train the student model. Thank you for the advice!

As for my current progress, the RAG teacher-student method is working now. I might release the fine-tuning GUI this week, but I think I need to study Unsloth and integrate it first. Thank you!

---

<div class="post-metadata">

**Author:** ![Hakob\_Arzumanyan](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/hakob_arzumanyan/32/214_2.png) [@Hakob\_Arzumanyan](https://devcommunity.amd.com/u/Hakob_Arzumanyan)\
**Post date:** [May 25, 2026, 9:52pm UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/4 "2026-05-25T21:52:12Z")

</div>

You`r welcome, and yes Unsloth is really great you should totally do that. Do not hesitate to keep us updated

---

<div class="post-metadata">

**Author:** ![Danila\_Permogorskii](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/danila_permogorskii/32/604_2.png) [@Danila\_Permogorskii](https://devcommunity.amd.com/u/Danila_Permogorskii)\
**Post date:** [May 26, 2026, 10:00am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/5 "2026-05-26T10:00:30Z")

</div>

Hey, Gerald!

If you’re serving your workloads on consumer Radeon, go with vLLM + FP8 - Hakob is right. On Instinct either engine works, but SGLang is worth a look if you go for K samples per chunk or multi-step teacher prompting. That’s where SGLang’s Radix cache beats vLLM’s hash-block approach.

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 27, 2026, 11:35am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/6 "2026-05-27T11:35:08Z")

</div>

Okay bro thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 27, 2026, 11:43am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/7 "2026-05-27T11:43:18Z")

</div>

Okay bro i need to study that, I’ll keep that in mind. Thank you so much! 😀

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 28, 2026, 9:50am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/8 "2026-05-28T09:50:10Z")

</div>

![image](https://global.discourse-cdn.com/amd/original/1X/857a3794aa075ead7f7f4ef5505f364e10ac3c41.png)

The Unsloth and LoRA integration is working perfectly, and I plan to release it tomorrow. There are still a few things that need polishing, so I would highly appreciate your feedback. I welcome negative feedback especially, so that we can address any issues immediately. Additionally, I would be grateful for any tips, suggestions, or advice regarding fine-tuning. Thank you so much!

**Current Issues:**

- Only two fine-tuning methods—LoRA and Unsloth—are properly functioning at this time. The others are still in development.

- The GPU server on DigitalOcean is failing to render or create properly, only showing the current GPU.

- Embeddings are currently tied to Featherless AI and lack integration with local embeddings or alternative providers.

---

<div class="post-metadata">

**Author:** ![Hakob\_Arzumanyan](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/hakob_arzumanyan/32/214_2.png) [@Hakob\_Arzumanyan](https://devcommunity.amd.com/u/Hakob_Arzumanyan)\
**Post date:** [May 28, 2026, 11:00am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/9 "2026-05-28T11:00:43Z")

</div>

Heyy, here is some feedback on your issues:

1. you have LoRA and Unsloth working, thats already really good. For your launch, I’d suggest adding a simple dataset format validator in the GUI, because bad JSON or text formatting is the number one reason why users’ fine-tuning runs fail.

2. As you may know the “VF” in MI350X VF means you’re running on a Virtual Function. In virtualized cloud servers, rocm-smi is blocked from reading hardware telemetry by the host, which is why only the device name shows up. Your UI is probably fine, it’s just a limitation of cloud VMs.

3. For an easy local alternative to Featherless, try integrating Ollama’s embeddings API or Hugging Face’s TEI (Text Embeddings Inference). Both have great ROCm support, are super lightweight, and won’t steal VRAM from your training.

Hope these are helpfull.

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 28, 2026, 11:32am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/10 "2026-05-28T11:32:06Z")

</div>

Hey bro thank you 😀

1.) I hadn’t thought about that. That’s excellent advice, and I will definitely add a dataset format validator. Thank you!

2.) For some reason, after reading the DigitalOcean documentation and trying their CLI, it failed to create a GPU server in any region I selected. However, through their web interface, I can create one easily. I’m not sure why that is, but as long as it works, I suppose it’s fine.

3.) I will definitely integrate this as well. Thank you for the suggestions.

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [May 30, 2026, 4:54pm UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/11 "2026-05-30T16:54:08Z")

</div>

# \*\*The Complete Guide to Fine-Tune Studio: RAG Teacher-Student Distillation & Training

\*\*

> **[GitHub - Zrald1/Finetune-studio](https://github.com/Zrald1/Finetune-studio)**
>
> Contribute to Zrald1/Finetune-studio development by creating an account on GitHub.

Fine-Tune Studio is a desktop application built on React, TypeScript, and Rust (via Tauri) designed to simplify large-scale LLM training and data distillation on AMD Instinct™ GPU servers (including MI300X and MI350X architectures).

By combining concurrent vector ingestion, multimodal text extraction, automated teacher-student distillation, and Hugging Face model uploads, Fine-Tune Studio enables developers to easily build private reasoning models from raw files or pre-existing datasets.

* * *

## **High-Level Architecture Overview**

Fine-Tune Studio operates under two main workflows:

```bash

```

### **1. The RAG Teacher-Student Distillation Method**

Instead of training a model on generic text, you build a specialized dataset using your private files:

1. **Document Ingestion** : Private documents (PDFs, images) are parsed by **PaddleOCR** and embedded using a cluster of **Qwen 8B Embedding** models.

2. **Vector Storage** : Embeddings are stored inside a **Qdrant** database.

3. **Conversational Synthesis** : A high-parameter **Teacher Model** (e.g., Qwen 2.5 72B) uses RAG to query the Qdrant database, synthesizes answers, and generates a conversational instruction-tuning dataset.

4. **Distillation** : A smaller, lightweight **Student Model** (e.g., Qwen 7B) is fine-tuned on this custom dataset.

### **2. The Direct Method**

If you already have a structured dataset on Hugging Face (public or private), you bypass the RAG stage and proceed directly to training the student model.

* * *

## **Step 1: Credentials & GPU Server Uplink**

Before creating pipelines, configure your credentials to authenticate with DigitalOcean, Hugging Face, and your remote GPU server.

### **1. DigitalOcean GPU Droplet Provisioning (Optional)**

If you do not have an existing GPU server, you can create one directly through the Tauri app:

1. Go to the **GPU Servers** tab.

2. Input your **DigitalOcean API Token**.

3. Click **Sync Account** to load available plans, images, projects, and SSH keys.

4. Select one of the pre-configured AMD Instinct GPU sizes (such as `gpu-mi350x1-288gb` or `gpu-mi300x1-192gb`).

5. Choose the **ROCm™ Software** image (e.g., `ROCm 7.2 on Ubuntu 24.04`, ID: `220895104`).

6. Select your target **SSH Keys** and click **Create GPU Server**.

### **2. Server Uplink Configuration**

Navigate to the **Credentials** page and configure the following:

- **Hugging Face API Key** : Necessary to retrieve private datasets, download gated models, and automatically upload your trained models and datasets back to Hugging Face.

- **GPU Server IP Address** : Enter the public IP address of your GPU server (e.g., `165.245.135.34`).

- **SSH Credentials** : Choose `root` as the username, specify the port (default `22`), and select the path to your private key file (e.g., `C:\Users\Zrald\.ssh\gpu_server`).

- Click **Test System Uplink** to verify the Tauri app can establish a connection and communicate with the Docker daemon on the server.

**TIP**

Successful connection will display ROCm SMI status info (device ID, GUID, VRAM usage, and active temperatures) in the console log.

* * *

## **Step 2: The RAG Teacher-Student Pipeline**

This method allows you to convert unformatted files (such as manuals, textbooks, or scanned images) into a polished conversational dataset.

```auto
       +----------------------------------------------------+

```

```auto
   | Document Ingestion |

   | Raw Files -> PaddleOCR -> Qwen 8B Embedder -> Qdrant |

   +-------------------------+--------------------------+

                             |

                             v

   +----------------------------------------------------+

   | Teacher Dataset Generation |

   | Teacher Model (RAG Query) -> Synthesized QA Data |

   +-------------------------+--------------------------+

                             |

                             v

   +----------------------------------------------------+

   | Student Training |

   | Fine-Tuning on Synthesized Dataset via Unsloth/LoRA|

   +----------------------------------------------------+

```

### **1. Deploying the Ingestion Cluster**

Navigate to the **Pipeline** page and click **Detect GPU**. Fine-Tune Studio will detect your hardware (e.g., 1x AMD MI350X with 288GB VRAM) and optimize the cluster setup.

In the **Knowledge Ingestion** section:

- **Deploy Qdrant** : Spins up a Qdrant container running on port `6333`.

- **Deploy PaddleOCR** : Deploys a Baidu PaddleOCR container running on port `8080` to parse scanned images and PDFs.

- **Create Multiple Embedders** : Set up multiple concurrent embedding endpoints running Qwen 8B Embedder models (e.g., port `8101` and `8102`).

**NOTE**

If you already have an existing vector database, select the **Qdrant Only** option to skip embedding generation and restore directly from a Qdrant snapshot.

### **2. Ingesting Documents**

- Upload your PDF, TXT, or image files.

- The system automatically triggers the extraction pipeline:

### **3. Deploying the Teacher Model**

Once your database is populated, configure the **Teacher Model** :

1. Select a model from the preset list (e.g., `Qwen/Qwen3.6-35B-A3B` or `Qwen/Qwen2.5-72B-Instruct`) or input a custom Hugging Face model repository.

2. The Tauri app starts the container (e.g., `rocm-vllm` using vLLM ROCm image or `rocm-sglang` using SGLang ROCm image) and loads the weights.

3. The teacher model executes RAG prompts, retrieves relevant facts from Qdrant, and writes a clean conversational dataset (formatted in standard ShareGPT/Alpaca formats) directly to the server storage.

* * *

## **Step 3: Direct Training Method**

If you already have pre-packaged training datasets uploaded on Hugging Face (e.g., private training JSON files or public datasets), select the **Direct** training option.

1. **Select Dataset** : Choose between a **Public Dataset** (paste the Hugging Face repo path) or a **Private Dataset** (which uses your configured Hugging Face access token).

2. **Verify Dataset** : The app checks the structure (ensuring it matches keys like `instruction`, `input`, `output` or standard conversation formats).

* * *

## **Step 4: Fine-Tuning the Student Model**

Whether your dataset was generated via RAG distillation or loaded directly, you are now ready to train your student model:

1. **Select Student Model** : Pick your student model (e.g., `Qwen/Qwen2.5-7B-Instruct`).

2. **Configure Parameters** :

**IMPORTANT**

**Resume Capabilities** : Fine-Tune Studio automatically saves checkpoints at regular intervals. If a network interruption occurs, you can resume training from the last saved checkpoint without losing progress.

* * *

## **Step 5: Post-Training Deployment & GGUF Conversion**

Once training is complete, the application performs post-processing steps:

1. **Adapter Weight Copy-Back** : The Tauri backend securely copies the trained LoRA adapter weights from the remote Docker container back to the host filesystem, preventing them from being deleted during container cleanups.

2. **Hugging Face Hub Upload** : If selected, the app pushes the trained weights automatically to your Hugging Face account.

3. **GGUF Conversion** :

Any feedback is welcome. Please feel free to share any techniques, advice, or suggestions to improve Fine-Tune Studio’s RAG teacher-student method. Thank you!

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [August 6, 2026, 6:00pm UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/12 "2026-08-06T18:00:42Z")

</div>

I’ll be updating this project this week, thanks 🙂

---

<div class="post-metadata">

**Author:** ![Vasundhara\_Boyalla](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@Vasundhara\_Boyalla](https://devcommunity.amd.com/u/Vasundhara_Boyalla)\
**Post date:** [August 9, 2026, 4:02am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/13 "2026-08-09T04:02:30Z")

</div>

Hi, this is a truly exciting project! Just a couple suggestions from my side. If you’re running both models on the same AMD GPU, doing it at the same time will likely cause Out Of Memory (OOM) crashes. Instead of concurrent runs, use vLLM with FP8 quantization to generate a batch of synthetic data first, save it, and shut it down before starting the training loop. For the Student training, you should absolutely integrate Unsloth, which now officially supports ROCm and cuts VRAM usage by up to 85

Keep up the great work! 💪✨

---

<div class="post-metadata">

**Author:** ![George\_Smith](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/george_smith/32/1319_2.png) [@George\_Smith](https://devcommunity.amd.com/u/George_Smith)\
**Post date:** [August 17, 2026, 6:37am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/14 "2026-08-17T06:37:06Z")

</div>

This is an interesting approach, especially the idea of using a RAG-based Teacher to generate high-quality data for a smaller Student model. The main challenge with running both workloads concurrently on AMD GPUs seems to be managing VRAM efficiently.

For the ROCm side, I think it would be useful to monitor memory usage closely and experiment with batch sizes, sequence lengths, and quantization before increasing concurrency. LoRA or QLoRA could also help keep the Student training workload more manageable.

I would also be interested in seeing how your GUI handles the separation between retrieval, Teacher inference, dataset generation, and Student training. Making those stages independently configurable could make the tool useful for different hardware configurations.

It would be great to see your benchmarks comparing Teacher-only inference, Student-only training, and concurrent workloads on AMD GPUs.

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [August 18, 2026, 12:53am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/15 "2026-08-18T00:53:44Z")

</div>

Thank you bro for appreciating my work, I’ll definitely integrate your ideas to my next update thank you so much, i will add live progress and usage while generating datasets.

Yes bro, i will add automatic benchmark after training .

Yes i like your idea of having sperate hardware configuration like a dedicated for teachers model and a dedicated for student model.

Thank you so much!

---

<div class="post-metadata">

**Author:** ![GERALD\_BUSTILLA](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/gerald_bustilla/32/631_2.png) [@GERALD\_BUSTILLA](https://devcommunity.amd.com/u/GERALD_BUSTILLA)\
**Post date:** [September 16, 2026, 6:50am UTC](https://devcommunity.amd.com/t/building-a-gui-for-fine-tuning-ai-agents-using-the-rag-teacher-to-student-method/548/16 "2026-09-16T06:50:15Z")

</div>

Added new features benchmark and fixed some bugs , you can try it now. Thank you
