Agentic Reinforcement Training — GRPO (Group Relative Policy Optimization) mit LoRA für Qwen2.5 und Llama 3.1.
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
- 🎯 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
# 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# 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.pystreamlit run app.pyDie App bietet drei Modi:
- GRPO-Training konfigurieren — Modell, GRPO-Parameter, LoRA-Rank, Training-Setup
- Reward-Modell testen — Reward-Funktionen mit Beispiel-Prompts testen
- LoRA-Parameter einstellen — Rank, Alpha, Dropout, Target-Module
pytest tests/ -v| 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 |
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/
Mark Baumann — GitHub
Für Fragen oder Beiträge: Issue erstellen oder Pull Request öffnen.