Skip to main content

TRL Jobs.

Project description

🏭 TRL Jobs

TRL Jobs is a simple wrapper around hfjobs that makes it easy to run TRL (Transformer Reinforcement Learning) workflows directly on 🤗 Hugging Face infrastructure.

Think of it as the quickest way to kick off Supervised Fine-Tuning (SFT) and more, without worrying about all the boilerplate setup.

📦 Installation

Get started with a single command:

pip install trl-jobs

⚡ Quick Start

Run your first supervised fine-tuning job in just one line:

trl-jobs sft --model_name Qwen/Qwen3-0.6B --dataset_name trl-lib/Capybara

Th training is tracked with Trackio and the fine-tuned model is automatically pushed to the Hub.

trackio_sft trained_model_sft

🛠 Available Commands

Right now, SFT (Supervised Fine-Tuning) is supported. More workflows will be added soon!

🔹 SFT (Supervised Fine-Tuning)

trl-jobs sft --model_name Qwen/Qwen3-0.6B --dataset_name trl-lib/Capybara

Required arguments

  • --model_name → Model to fine-tune (e.g. Qwen/Qwen3-0.6B)
  • --dataset_name → Dataset to train on (e.g. trl-lib/Capybara)

Optional arguments

  • --peft → Use PEFT (LoRA) (default: False)
  • --flavor → Hardware flavor (default: a100-large, only option for now)
  • --timeout → Max runtime (1h by default). Supports s, m, h, d
  • -d, --detach → Run in background and print job ID
  • --namespace → Namespace where the job will run (default: your user namespace)
  • --token → Hugging Face token (only needed if not logged in)

➡️ You can also pass any arguments supported by trl sft. For the full list, see the TRL CLI docs.

📊 Supported Configurations

Here are some ready-to-go setups you can use out of the box.

🦙 Meta LLaMA 3

Model Max context length Tokens / batch Example command
Meta-Llama-3-8B 4096 262,144 trl-jobs sft --model_name meta-llama/Meta-Llama-3-8B --dataset_name ...
Meta-Llama-3-8B-Instruct 4096 262,144 trl-jobs sft --model_name meta-llama/Meta-Llama-3-8B-Instruct --dataset_name ...

🦙 Meta LLaMA 3 with PEFT

Model Max context length Tokens / batch Example command
Meta-Llama-3-8B 24,576 196,608 trl-jobs sft --model_name meta-llama/Meta-Llama-3-8B --peft --dataset_name ...
Meta-Llama-3-8B-Instruct 24,576 196,608 trl-jobs sft --model_name meta-llama/Meta-Llama-3-8B-Instruct --peft --dataset_name ...

🐧 Qwen3

Model Max context length Tokens / batch Example command
Qwen3-0.6B 32,768 65,536 trl-jobs sft --model_name Qwen/Qwen3-0.6B --dataset_name ...
Qwen3-1.7B 24,576 98,304 trl-jobs sft --model_name Qwen/Qwen3-1.7B --dataset_name ...
Qwen3-4B 20,480 163,840 trl-jobs sft --model_name Qwen/Qwen3-4B --dataset_name ...
Qwen3-8B 4,096 262,144 trl-jobs sft --model_name Qwen/Qwen3-8B --dataset_name ...

🐧 Qwen3 with PEFT

Model Max context length Tokens / batch Example command
Qwen3-8B 24,576 196,608 trl-jobs sft --model_name Qwen/Qwen3-8B --peft --dataset_name ...
Qwen3-14B 20,480 163,840 trl-jobs sft --model_name Qwen/Qwen3-14B --peft --dataset_name ...
Qwen3-32B 4,096 131,072 trl-jobs sft --model_name Qwen/Qwen3-32B --peft --dataset_name ...

🤖 OpenAI GPT-OSS (with PEFT)

🚧 Coming soon!

💡 Want support for another model? Open an issue or submit a PR—we’d love to hear from you!

🔑 Authentication

You’ll need a Hugging Face token to run jobs. You can provide it in any of these ways:

  1. Login with huggingface-cli login
  2. Set the environment variable HF_TOKEN
  3. Pass it directly with --token

📜 License

This project is under the MIT License. See the LICENSE file for details.

🤝 Contributing

We welcome contributions! Please open an issue or a PR on GitHub.

Before committing, run formatting checks:

ruff check . --fix && ruff format . --line-length 119

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

trl_jobs-0.1.11.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

trl_jobs-0.1.11-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file trl_jobs-0.1.11.tar.gz.

File metadata

  • Download URL: trl_jobs-0.1.11.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for trl_jobs-0.1.11.tar.gz
Algorithm Hash digest
SHA256 e2b8783cd3da302fcca84e3427c8ac8bd41caa7f76268e4d30807d086a5d1ccd
MD5 2fbf242045c28c5cacf9cc03510a7e08
BLAKE2b-256 47b95d161e3bc7b76f8d6b7ed5b0615d1f0abe12ac86a6162273b00066c0ad38

See more details on using hashes here.

File details

Details for the file trl_jobs-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: trl_jobs-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for trl_jobs-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b888dffb905096933b31e91fde922d6ffbd9b3c9300ec4d77c54530009da20
MD5 f5ac3096fe0fe6b8276556e8695235fe
BLAKE2b-256 d442b8a94d17506ed8bf5f5eb89488678e758aaf2340a6acdbb5bbb4e23dbea6

See more details on using hashes here.

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