Metadata-Version: 2.4
Name: training-hub
Version: 0.1.0a1
Summary: An algorithm-focused interface for common language model training, continual learning, and reinforcement learning techniques
License: Apache-2.0
Project-URL: homepage, https://ai-innovation.team/
Project-URL: source, https://github.com/Red-Hat-AI-Innovation-Team/training_hub
Project-URL: issues, https://github.com/Red-Hat-AI-Innovation-Team/training_hub/issues
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: instructlab-training>=0.11
Requires-Dist: torch
Provides-Extra: cuda
Requires-Dist: instructlab-training[cuda]>=0.11; extra == "cuda"
Dynamic: license-file

# training_hub
An algorithm-focused interface for common llm training, continual learning, and reinforcement learning techniques.

## Support Matrix

| Algorithm | InstructLab-Training | PEFT | VERL | Status |
|-----------|---------------------|------|------|--------|
| **Supervised Fine-tuning (SFT)** | ✅ | - | - | Implemented |
| Continual Learning (OSFT) | 🔄 | 🔄 | - | Planned |
| Direct Preference Optimization (DPO) | - | - | 🔄 | Planned |
| Low-Rank Adaptation (LoRA) | 🔄 | 🔄 | - | Planned |
| Group Relative Policy Optimization (GRPO) | - | - | 🔄 | Planned |

**Legend:**
- ✅ Implemented and tested
- 🔄 Planned for future implementation  
- \- Not applicable or not planned

## Implemented Algorithms

### [Supervised Fine-tuning (SFT)](examples/sft_usage.md)
Fine-tune language models on supervised datasets with support for:
- Single-node and multi-node distributed training
- Configurable training parameters (epochs, batch size, learning rate, etc.)
- InstructLab-Training backend integration

```python
from training_hub import sft

result = sft(
    model_path="/path/to/model",
    data_path="/path/to/data",
    ckpt_output_dir="/path/to/checkpoints",
    num_epochs=3,
    learning_rate=1e-5
)
```

## Installation

### Basic Installation
```bash
pip install training-hub
```

### Development Installation
```bash
git clone https://github.com/Red-Hat-AI-Innovation-Team/training_hub
cd training_hub
pip install -e .
```

### CUDA Support
For GPU training with CUDA support:
```bash
pip install training-hub[cuda]
# or for development
pip install -e .[cuda]
```

**Note:** If you encounter build issues with flash-attn, install the base package first:
```bash
# Install base package (provides torch, packaging, wheel, ninja)
pip install training-hub
# Then install with CUDA extras
pip install training-hub[cuda]

# For development installation:
pip install -e .
pip install -e .[cuda]
```

**For uv users:** You may need the `--no-build-isolation` flag:
```bash
uv pip install training-hub
uv pip install training-hub[cuda] --no-build-isolation

# For development:
uv pip install -e .
uv pip install -e .[cuda] --no-build-isolation
```

## Getting Started
