Back to Academic Projects

POC of an AI agent for medical triage: SFT + DPO fine-tuning of an LLM (Qwen3-1.7B)

Python, LLM, Fine-Tuning, LoRA, DPO, Hugging Face, vLLM, MLOps, Healthcare AI, RGPD

POC of an AI Medical Triage Agent (Fine-Tuning SFT + DPO)

Overview

This project implements the complete specialization cycle of an LLM for a sensitive clinical use case: assisting hospital emergency department staff in the initial triage of patients. The objective is to transform a general-purpose base model (Qwen3-1.7B-Base) into an agent capable of evaluating a medical priority level, by following a rigorous methodology — from corpus creation to the deployment of a demonstration endpoint.

The project applies best practices of LLM fine-tuning and MLOps in a medical context, with particular attention paid to GDPR compliance, experiment traceability, and honesty regarding the system's clinical limitations.


Objectives


Demonstrated Skills

Creation and Governance of a Medical Corpus


Supervised Fine-tuning (SFT) and LoRA Adaptation


Preference Alignment (DPO)


Deployment and Industrialization (MLOps)


Evaluation and Strategic Reporting


Architecture

   Corpus médicaux bruts (MediQA, FrenchMedMCQA,
        MedQuAD, UltraMedical-Preference)
                       │
                       ▼
        Anonymisation RGPD (Presidio)
                       │
                       ▼
     Structuration : dataset SFT (~5000 paires)
        + dataset DPO (paires préférentielles)
                       │
                       ▼
       Fine-tuning SFT (Qwen3-1.7B-Base + LoRA)
                       │
                       ▼
        Alignement par préférences (DPO)
                       │
                       ▼
        Validation clinique & contrôles
           de sécurité (hallucinations)
                       │
                       ▼
      Conteneurisation (Docker) + API FastAPI
              Inférence optimisée (vLLM)
                       │
                       ▼
         Pipeline CI/CD (GitHub Actions)
                       │
                       ▼
     Endpoint pilote + rapport & recommandations

Technical Stack

Fine-tuning & Alignment

Data & Compliance

Experiment Tracking

Deployment & Inference

CI/CD

Deliverables


Applied Best Practices


Results

Upon completion of this project, the system allows for:


Skills Acquired