---
id: harness-adapters/Qwen3.8-27B
title: Qwen3.8-27B harness adapters
type: recipe
project: harness-adapters
model_id: Qwen/Qwen3.8-27B
trainers:
- AsyncGRPOTrainer
platforms:
- local
- hf_jobs
gpus:
- H200
- B200
verified:
  local: false
  hf_jobs: false
trl_source:
- TRL fork
tags:
- lora
- agentic-rl
- harbor
- safeagents
- multi-harness
date_added: '2026-11-13'
url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/index.html
markdown_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/index.md
json_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/recipe.json
yaml_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/recipe.yaml
hub_tree: https://huggingface.co/spaces/trl-lib/trl-recipes/tree/main/recipes/harness-adapters/Qwen3.8-27B
released_collection: https://huggingface.co/collections/harness-hub/qwen38-27b-harness-adapters-6afaa929267f8340ded09791
---

# Qwen/Qwen3.8-27B — Harness adapters

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.

## Summary & Links

- **Recipe ID:** `harness-adapters/Qwen3.8-27B`
- **Model:** [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)
- **Project:** [Harness adapters](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/index.md)
- **Trainers:** `AsyncGRPOTrainer`
- **Harnesses:** `pi`, `hermes`, `opencode`
- **GPUs:** H200, B200
- **Platforms:** Local machine, HF Jobs
- **Released models collection:** https://huggingface.co/collections/harness-hub/qwen38-27b-harness-adapters-6afaa929267f8340ded09791
- **Interactive command builder:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/index.html
- **Structured JSON:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/recipe.json
- **Recipe YAML:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/recipe.yaml
- **Space files:** https://huggingface.co/spaces/trl-lib/trl-recipes/tree/main/recipes/harness-adapters/Qwen3.8-27B

## Quickstart Commands

### Train on HF Jobs (not run as written yet · h200x2 per harness (untested))

```bash
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
BUCKET="<your user>/<bucket>" bash train_hf_jobs.sh
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.

### Train on Local machine (not run as written yet · 2 GPUs per harness, H200 or B200 class (untested))

```bash
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
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.

### Evaluate on HF Jobs (not run as written yet · h200x2 per harness (untested))

```bash
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
BENCH=sbp \
POLICIES=Qwen/Qwen3.8-27B@pi,hermes,opencode \
BUCKET="<your user>/<bucket>" \
bash eval_hf_jobs.sh
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.

### Evaluate on Local machine (not run as written yet · 2 GPUs per harness, H200 or B200 class (untested))

```bash
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
BENCH=sbp \
POLICIES=Qwen/Qwen3.8-27B@pi,hermes,opencode \
bash eval_local.sh
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.

## Guide

LoRA adapters for pi, hermes and opencode on [`Qwen/Qwen3.8-27B`](https://huggingface.co/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](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/README.md). Full hyperparameters: [recipe.yaml](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/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](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/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](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/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

| Parameter | Value |
|---|---|
| `lora_r` | `32` |
| `lora_target_modules` | `q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj` |
| `learning_rate` | `2e-5` |
| `num_generations` | `8` |
| `gradient_accumulation_steps` | `16` |
| `max_staleness` | `16` |
| `temperature` | `0.8` |
| `max_completion_length` | `16,384` |
| `max_model_len` | `65,536` |
| `token_budget` | `65,536` |
| `agent_step_limit` | `50` |
| `agent_timeout_s` | `1,800` |
| `max_inflight` | `64` |
| `tool_efficiency_weight` | `0.1` |
| `max_steps` | `1,000` |
| `save_steps` | `10` |
| `thinking` | `false` |

### Serving (vLLM)

| Setting | Value |
|---|---|
| `tool_call_parser` | `qwen3_xml` |
| `reasoning_parser` | `qwen3` |
| `extra_args` | `--language-model-only, --enable-prefix-caching, --mamba-cache-mode align` |

### Hardware

- **Local machine:** 2 GPUs per harness, H200 or B200 class (untested) (untested)
- **HF Jobs:** h200x2 per harness (untested) (untested)

## Datasets

### Training

- [`harness-hub/scale800-harbor@56c7f75d01f70859ec1354e97866e32a175c1a40`](https://huggingface.co/datasets/harness-hub/scale800-harbor)
- [`harness-hub/termgrade-train-harbor`](https://huggingface.co/datasets/harness-hub/termgrade-train-harbor)

### Evaluation

| Benchmark | Details |
|---|---|
| `sbp-hard51` | harness-hub/swebench-pro-v2-hard51-harbor |
| `tb21-20pct` | harborframework/terminal-bench-2.1@3e235dff6880252a587fa479c09bcb1e16edf2eb, 18 tasks |
| `s800-heldout` | harness-hub/scale800-heldout-harbor (the repositories left out of training), 1800 s and 50 steps as in training |
| `automationbench` | Zapier AutomationBench, 10 tasks per domain (60), as the base eval |

## TRL Version

- **Fork:** [`younesbelkada/trl@e498acc6`](https://github.com/younesbelkada/trl/commit/e498acc637084cffff14deb09ccdc423a766adb2) (async-grpo-shared-vllm)
- **Upstream base:** [`huggingface/trl@d115286b`](https://github.com/huggingface/trl/commit/d115286bc5aef8d346e8510bfe312803c7881c4a)
- **Patch file:** [trl.patch](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/trl.patch)

```bash
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
```

## Files

- [`train_local.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/train_local.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/train_local.sh))
- [`train_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/train_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/train_hf_jobs.sh))
- [`eval_local.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/eval_local.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/eval_local.sh))
- [`eval_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/eval_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/eval_hf_jobs.sh))
- [`recipe.yaml`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/recipe.yaml) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/recipe.yaml))
- [`trl.patch`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/trl.patch) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/trl.patch))
- [`async_grpo_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/async_grpo_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/async_grpo_harbor.py))
- [`eval_automationbench.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Qwen3.8-27B/eval_automationbench.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Qwen3.8-27B/eval_automationbench.py))

### Shared by project

- [`scripts/async_grpo_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/async_grpo_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/async_grpo_harbor.py))
- [`scripts/atif_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_harbor.py))
- [`scripts/atif_smoldataenvs.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_smoldataenvs.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_smoldataenvs.py))
- [`scripts/atif_traj2envs.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_traj2envs.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_traj2envs.py))
- [`scripts/deepseek_harness.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/deepseek_harness.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/deepseek_harness.py))
- [`scripts/eval_sweep.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/eval_sweep.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/eval_sweep.py))
- [`scripts/evaluate_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/evaluate_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/evaluate_harbor.py))
- [`scripts/launcher_eval.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/launcher_eval.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/launcher_eval.py))
- [`scripts/launcher_train.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/launcher_train.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/launcher_train.py))
- [`scripts/release_adapters.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/release_adapters.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/release_adapters.py))
- [`scripts/slurm_setup.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/slurm_setup.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/slurm_setup.sh))
