#!/usr/bin/env bash # Set up a training host: patched PRIME-RL, its venv, the pinned model and the env packages. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" [[ -f "$ROOT/.env" ]] && set -a && source "$ROOT/.env" && set +a git -C "$ROOT" -c url.https://github.com/.insteadOf=git@github.com: \ submodule update --init --recursive cd "$ROOT/prime-rl" # torch/vLLM moved out of the base dependencies into the `gpu` extra. uv sync --frozen --no-dev --package prime-rl --extra gpu --extra flash-attn --extra quack python="$(uv run --no-sync python -c 'import sys; print(sys.executable)')" # Env dependencies missing from PRIME-RL's lock, constrained to the versions it resolved. constraints="$(mktemp)" uv pip freeze --python "$python" --exclude-editable > "$constraints" uv pip install --python "$python" --constraint "$constraints" \ math-verify reasoning-gym langdetect jsonschema pyyaml \ 'verifiable-instructions @ git+https://github.com/abukharin-nv/verifiable-instructions.git@f46a5ac' # --no-deps/--no-sources: install into PRIME-RL's venv without re-resolving verifiers # or the envs' workspace source for nemotron-guard-v1. uv pip install --python "$python" --no-deps --no-sources \ $(printf -- '-e %s ' "$ROOT"/envs/*) # Inference and trainer run with HF_HUB_OFFLINE=1, so the model must be cached up front. uvx --from huggingface-hub hf download arcee-ai/Trinity-Mini \ --revision cdb81e8130815fec299cccc8f8700004b8366e1e