Skip to content
 
 

Latest commit

 

History

1,298 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 ART — Agent Reinforcement Trainer

Python PyTorch License Streamlit

Agentic Reinforcement Training — GRPO (Group Relative Policy Optimization) mit LoRA für Qwen2.5 und Llama 3.1.

📋 Beschreibung

ART ist ein spezialisiertes Trainings-Framework, das Group Relative Policy Optimization (GRPO) mit Low-Rank Adaptation (LoRA) kombiniert. Es ermöglicht effizientes Fine-Tuning großer Sprachmodelle (Qwen2.5 7B, Llama 3.1 8B) für agentische Aufgaben — mit 4-Bit-Quantisierung, Reward-Modellierung und einer interaktiven Streamlit-Konfigurationsoberfläche.

  • GRPO-Training — Group Relative Policy Optimization mit konfigurierbaren Generations, Beta und Temperatur
  • LoRA-Adapter — Effizientes Fine-Tuning mit PEFT/LoRA auf Qwen und Llama
  • Reward-Modell — Konfigurierbare Reward-Funktionen für agentische Aufgaben
  • 4-Bit Quantisierung — BitsAndBytes für speichereffizientes Training

✨ Features

  • 🎯 GRPO + LoRA — State-of-the-Art RL-Training für Sprachmodelle
  • 🤖 Multi-Modell-Support — Qwen2.5 (7B/1.5B) und Llama 3.1 (8B)
  • 4-Bit Training — BitsAndBytes-Quantisierung für Consumer-GPUs
  • 🏆 Reward-Modell — Flexible Reward-Funktionen mit konfigurierbaren Gewichten
  • 🖥️ Streamlit-App — Interaktive Konfiguration von GRPO, LoRA und Reward-Parametern
  • 📊 W&B Tracking — Vollständiges Experiment-Tracking
  • 🧪 Umfangreiche Tests — Unit-Tests für alle Kernkomponenten
  • 🔧 vLLM Runtime — Dedizierte Server-Integration für schnelle Inferenz

🚀 Installation

# Repository klonen
git clone https://github.com/mark-baumann/ART.git
cd ART

# Virtuelle Umgebung erstellen
python3 -m venv .venv
source .venv/bin/activate

# Abhängigkeiten installieren
pip install -r requirements.txt

# Für GPU-Training (CUDA 11.8)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install bitsandbytes accelerate peft trl

🎮 Nutzung

GRPO-Training starten

# Standard-Training mit Qwen 2.5 7B
python train_agent.py

# Llama 3.1 8B
python train_agent.py --model llama

# Schneller Test-Modus (Qwen 1.5B)
python train_agent.py --model qwen --test-mode

# Mit benutzerdefinierter Konfiguration
python train_agent.py --config my_config.py

Streamlit-App

streamlit run app.py

Die App bietet drei Modi:

  1. GRPO-Training konfigurieren — Modell, GRPO-Parameter, LoRA-Rank, Training-Setup
  2. Reward-Modell testen — Reward-Funktionen mit Beispiel-Prompts testen
  3. LoRA-Parameter einstellen — Rank, Alpha, Dropout, Target-Module

Tests

pytest tests/ -v

🏗️ Tech-Stack

Komponente Technologie
Sprache Python 3.10+
Framework PyTorch 2.0+, TRL (GRPOTrainer)
Modelle Qwen2.5, Llama 3.1
Fine-Tuning PEFT (LoRA), BitsAndBytes (4-bit)
Inferenz vLLM Runtime
UI Streamlit
Tracking Weights & Biases
Testing pytest

📁 Projektstruktur

ART/
├── train_agent.py          # GRPO-Training-Pipeline
├── app.py                  # Streamlit-Konfigurations-App
├── config.py               # Modell- und Trainingskonfigurationen
├── reward_model.py         # Reward-Modell und Reward-Funktionen
├── vllm_runtime/           # vLLM-Integration
│   └── src/art_vllm_runtime/
│       ├── dedicated_server.py
│       ├── lora_delta.py
│       └── patches.py
└── tests/
    ├── unit/               # Umfangreiche Unit-Tests
    │   ├── test_reward_model.py
    │   ├── test_grpo_config.py
    │   ├── test_sft.py
    │   └── ...
    └── support/

👤 Autor

Mark BaumannGitHub


Für Fragen oder Beiträge: Issue erstellen oder Pull Request öffnen.

About

Agentic Reinforcement Training: train multi-step agents with GRPO + LoRA

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages