Skip to main content

An algorithm-focused interface for common language model training, continual learning, and reinforcement learning techniques

Project description

training_hub

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

Support Matrix

Algorithm InstructLab-Training RHAI Innovation Mini-Trainer 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)

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
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
)

Orthogonal Subspace Fine-Tuning (OSFT)

OSFT allows you to fine-tune models while controlling how much of its existing behavior to preserve. Currently we have support for:

  • Single-node and multi-node distributed training
  • Configurable training parameters (epochs, batch size, learning rate, etc.)
  • RHAI Innovation Mini-Trainer backend integration

Here's a quick and minimal way to get started with OSFT:

from training_hub import osft

result = osft(
    model_path="/path/to/model",
    data_path="/path/to/data.jsonl", 
    ckpt_output_dir="/path/to/outputs",
    unfreeze_rank_ratio=0.25,
    effective_batch_size=16,
    max_tokens_per_gpu=2048,
    max_seq_len=1024,
    learning_rate=5e-6,
)

Installation

Basic Installation

pip install training-hub

Development Installation

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:

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:

# 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:

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

For comprehensive tutorials, examples, and documentation, see the examples directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

training_hub-0.1.0a3.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

training_hub-0.1.0a3-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file training_hub-0.1.0a3.tar.gz.

File metadata

  • Download URL: training_hub-0.1.0a3.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for training_hub-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 22a23066ad520583b74f53dcf11ceb29151ac65108e18232508a6005991b6f5b
MD5 cff81deb1024d14c959f7cfaa98e8f28
BLAKE2b-256 29a402747c163109191ed3f1eae0dfd27b315f7ee9092a599a20a35d510e6c47

See more details on using hashes here.

Provenance

The following attestation bundles were made for training_hub-0.1.0a3.tar.gz:

Publisher: pypi.yaml on Red-Hat-AI-Innovation-Team/training_hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file training_hub-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: training_hub-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for training_hub-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 f2747ca1f38764b372f8f5074764dd56f78e9efa52c61efd07d6131c1aeb75e8
MD5 6dc326578c92487523599de17f6a4a6e
BLAKE2b-256 04f5406e299b77db523562ef3f5ac8c3a8b8c5fa3c9115a8e77a0017dfeffb04

See more details on using hashes here.

Provenance

The following attestation bundles were made for training_hub-0.1.0a3-py3-none-any.whl:

Publisher: pypi.yaml on Red-Hat-AI-Innovation-Team/training_hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page