Skip to content

Training and Reinforcement Learning (RL)

vLLM is widely used as the high-throughput rollout and teacher-scoring engine for post-training workflows including RLHF, GRPO, Online DPO, and on-policy distillation.

Quick Routing Guide (Task → Doc)

What you want to do Document Key Flags / APIs
Synchronize updated trainer weights into a running vLLM engine (IPC, NCCL, M2N, Sharded RDT, ModelExpress) Weight Updates --weight-transfer-config, VLLM_RELOAD_MODE
Sync weights over HTTP without installing or importing vLLM in the trainer process Trainer Without Importing vLLM (HTTP-Only) VLLM_SERVER_DEV_MODE=1, /init_weight_transfer_engine, /update_weights
Understand in-place weight reload vs. layerwise reload & online quantization (QeRL) Direct Weight Reload / Layerwise (Re)loading VLLM_RELOAD_MODE=auto\|direct\|layerwise
Verify that a weight update landed identically on every rank Weight Checker SHA-256 parameter digest check
Export rollout artifacts to the trainer (MoE routing, sampling masks, teacher top-K logprobs) Rollout Artifacts --enable-return-routed-experts, prompt_logprob_token_ids
Overlap rollout generation and training (async RL / one-off pipelining) Async Reinforcement Learning pause_generation, resume_generation, weight_version
Integrate vLLM with Hugging Face TRL Transformers Reinforcement Learning (TRL) use_vllm=True, vllm_mode

These capabilities live under docs/features/ because they also serve general inference, but are frequently used in RL and post-training setups:

  • Sleep Mode: Free GPU memory (weights and KV cache) between rollout and training phases in colocated RL.
  • Batch Invariance: Reduce train–inference numerical mismatch by making rollout outputs invariant to batching.
  • Online Quantization: Quantize full-precision trainer weights on the fly during direct or layerwise reload.
  • Hidden State Extraction: Export per-token hidden states via a connector for training speculative-decoding draft models (e.g., EAGLE).

Open-Source RL Libraries Using vLLM

The following open-source RL libraries use vLLM for fast rollouts (sorted alphabetically and non-exhaustive):