TRL /Recipes

Qwen/Qwen3.8-27B

One LoRA adapter per agent harness (pi, hermes, opencode) on Qwen3.8-27B, trained with async GRPO on agentic coding and terminal tasks (scale800 + TermGrade), one job per harness, thinking off.

AsyncGRPOTrainerH200 · B200TRL forkLoRA r321,000 stepspi · hermes · opencodeloraagentic-rlharborsafeagentsmulti-harness

Command builder

Train · Local machine · 2 GPUs per harness, H200 or B200 class (untested)

Not run as written yet
hf download trl-lib/trl-recipes --repo-type space --include "recipes/harness-adapters/*" --local-dir trl-recipes
cd trl-recipes/recipes/harness-adapters/Qwen3.8-27B
HARNESS=pi bash train_local.sh

Guide

LoRA adapters for pi, hermes and opencode on Qwen/Qwen3.8-27B, trained for up to 1,000 steps. Training data is the 750 scale800 tasks interleaved with 300 TermGrade tasks. Setup and shared settings: ../README.md. Full hyperparameters: recipe.yaml.

HF Jobs (untested) Local (untested)
Train bash train_hf_jobs.sh, one h200x2 job per harness HARNESS=pi bash train_local.sh, one harness per machine (2 GPUs)
Eval BENCH=sbp\|tb\|s800\|automationbench ... bash eval_hf_jobs.sh (h200) BENCH=sbp\|tb\|s800\|automationbench ... bash eval_local.sh (1 GPU)

How this differs from the LFM / TwIL recipes: - Training script and TRL. This folder has its own async_grpo_harbor.py, built on HarnessAsyncGRPOTrainer. That trainer comes from TRL's async-grpo-shared-vllm branch (younesbelkada/trl@e498acc6), not the launcher's pinned TRL. Its changes relative to upstream are in trl.patch. The HF Jobs and local launchers install it from git (--trl-wheel). - One job per harness, not one job for all three. - Thinking off. Each run has 50 agent steps and 1800 s, and --no-responses-thinking. - vLLM settings: - --language-model-only, plus prefix caching with --mamba-cache-mode align, which the gated-DeltaNet layers need. - Safeagents plugin. It is the generic Harbor plugin, scripts/atif_harbor.py.

Evaluation #

Evals compare each checkpoint with a base eval run the same way, under the same tag: run the base once per benchmark (POLICIES="Qwen/Qwen3.8-27B@pi,hermes,opencode"). s800 is the scale800 held-out set: the repositories left out of training, under training's own limits (1800 s, 50 steps).

Hyperparameters

lora_r32
lora_target_modulesq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
learning_rate2e-5
num_generations8
gradient_accumulation_steps16
max_staleness16
temperature0.8
max_completion_length16,384
max_model_len65,536
token_budget65,536
agent_step_limit50
agent_timeout_s1,800
max_inflight64
tool_efficiency_weight0.1
max_steps1,000
save_steps10
thinkingfalse

Serving (vLLM)

tool_call_parserqwen3_xml
reasoning_parserqwen3
extra_args--language-model-only, --enable-prefix-caching, --mamba-cache-mode align

Hardware

Local machine2 GPUs per harness, H200 or B200 class (untested) untested
HF Jobsh200x2 per harness (untested) untested

Datasets

Training

Evaluation

sbp-hard51harness-hub/swebench-pro-v2-hard51-harbor
tb21-20pctharborframework/terminal-bench-2.1@3e235dff6880252a587fa479c09bcb1e16edf2eb, 18 tasks
s800-heldoutharness-hub/scale800-heldout-harbor (the repositories left out of training), 1800 s and 50 steps as in training
automationbenchZapier AutomationBench, 10 tasks per domain (60), as the base eval

TRL version

This recipe runs on a TRL fork. trl.patch holds the changes to trl/ relative to the upstream base commit.

Forkyounesbelkada/trl@e498acc6 async-grpo-shared-vllm
git clone https://github.com/huggingface/trl && cd trl
git checkout d115286bc5aef8d346e8510bfe312803c7881c4a
curl -sL https://huggingface.co/spaces/trl-lib/trl-recipes/resolve/main/recipes/harness-adapters/Qwen3.8-27B/trl.patch | git apply

Download trl.patch (5 files changed)

Files

Shared by the project

Added 2026-11-13 Report an issue