trl Docker & Self-Hosted Deployment

GitHub

Train transformer language models with reinforcement learning.

19,577 stars Python Python 42 files ยท ~128,057 tokens
1. Pull Image (DOCKERHUB) docker pull huggingface/trl:latest
2. Docker Run (1-Click Launch) docker run -d --name trl --restart always huggingface/trl:latest
3. Podman Run podman run -d --name trl --restart always huggingface/trl:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/huggingface/trl:latest
5. ORAS Pull (OCI Artifact) oras pull huggingface/trl:latest
docker/trl-dev/Dockerfile
FROM nvidia/cuda:13.0.3-devel-ubuntu24.04
COPY --from=ghcr.io/astral-sh/uv:0.12.24 /uv /usr/local/bin/uv
ENV VIRTUAL_ENV=/opt/venv UV_PYTHON_INSTALL_DIR=/opt/uv/python PATH=/opt/venv/bin:$PATH
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
RUN uv venv --python 3.13 --seed $VIRTUAL_ENV
# Without this floor, uv may pick vLLM 0.30.0 (no transformers cap) with the latest transformers (not tested with vLLM 0.30.0): https://github.com/huggingface/trl/issues/7819
RUN uv pip install --no-cache "git+https://github.com/huggingface/trl.git#egg=trl[kernels,liger,peft,vlm,vllm]" "vllm>=0.31.0" trackio