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

# webAI-Official/TwIL-8B — Harness adapters

Experiment: one LoRA adapter per agent harness (pi, hermes, opencode) on a model not trained on agentic data, with more agent steps and a longer rollout timeout.

## Summary & Links

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

## Quickstart Commands

### Train on HF Jobs (not run as written yet · h200x4)

```bash
hf download trl-lib/trl-recipes --repo-type space --include "recipes/harness-adapters/*" --local-dir trl-recipes
cd trl-recipes/recipes/harness-adapters/TwIL-8B
BUCKET="<your user>/<bucket>" bash train_hf_jobs.sh
```

### Train on Local machine (not run as written yet · 4 GPUs, H200 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/TwIL-8B
bash train_local.sh
```

### Evaluate on HF Jobs (not run as written yet · h200x4)

```bash
hf download trl-lib/trl-recipes --repo-type space --include "recipes/harness-adapters/*" --local-dir trl-recipes
cd trl-recipes/recipes/harness-adapters/TwIL-8B
SPLIT=final-heldout \
BUCKET="<your user>/<bucket>" \
bash eval_hf_jobs.sh
```

### Evaluate on Local machine (not run as written yet · 4 GPUs, H200 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/TwIL-8B
SPLIT=final-heldout bash eval_local.sh
```

## Guide

LoRA adapters for pi, hermes and opencode on [`webAI-Official/TwIL-8B`](https://huggingface.co/webAI-Official/TwIL-8B),
a model not trained on agentic data. Trained on 400 SmolDataEnvs tasks (150 medium, 250 hard) and 230 traj2envs 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/TwIL-8B/recipe.yaml).

| | HF Jobs | Local (untested) |
|---|---|---|
| Train | `bash train_hf_jobs.sh` (h200x4, ~48h) | `bash train_local.sh` (4 GPUs) |
| Eval | `bash eval_hf_jobs.sh` (h200) | `bash eval_local.sh` (1 GPU) |

Model-specific flags:
- vLLM serves the model with [chat_template.jinja](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/chat_template.jinja), which the HF Jobs scripts upload to the bucket
  as `twil_chat_template.jinja`. The trainer uses `--qwen3-5-response-template`.
- `--tool-call-parser qwen3_coder --reasoning-parser qwen3`, `--token-budget 65536`
- `--agent-step-limit 30 --agent-timeout 1200`: the model needs more steps per task.
- `--max-inflight 12` (48 for the LFM models): its long reasoning fills vLLM's memory sooner.

**Steps:** the launch command and the released checkpoints use 100 steps (`--max-steps 100`), but the blog post's table
says 300.

Released checkpoints (job `6aedb49dc78863f9c63408be`):

| Harness | Step | Repo |
|---|--:|---|
| pi | 90 | `harness-hub/TwIL-8B-pi` |
| hermes | 60 | `harness-hub/TwIL-8B-hermes` |
| opencode | 100 | `harness-hub/TwIL-8B-opencode` |

## Hyperparameters

| Parameter | Value |
|---|---|
| `lora_r` | `32` |
| `lora_target_modules` | `all-linear` |
| `learning_rate` | `1e-5` |
| `num_generations` | `8` |
| `gradient_accumulation_steps` | `4` |
| `max_staleness` | `4` |
| `temperature` | `0.8` |
| `max_completion_length` | `16,384` |
| `max_output_tokens` | `32,768` |
| `max_model_len` | `131,072` |
| `token_budget` | `65,536` |
| `agent_step_limit` | `30` |
| `agent_timeout_s` | `1,200` |
| `max_inflight` | `12` |
| `tool_efficiency_weight` | `0.1` |
| `max_steps` | `100` |
| `save_steps` | `10` |

### Serving (vLLM)

| Setting | Value |
|---|---|
| `tool_call_parser` | `qwen3_coder` |
| `reasoning_parser` | `qwen3` |
| `chat_template` | `chat_template.jinja` |
| `trainer_flags` | `--qwen3-5-response-template` |

### Hardware

- **HF Jobs:** h200x4 (untested)
- **Local machine:** 4 GPUs, H200 class (untested) (untested)

## Datasets

### Training

- [`FineEnvs/SmolDataEnvs-harbor-train`](https://huggingface.co/datasets/FineEnvs/SmolDataEnvs-harbor-train)
- [`harness-hub/traj2envs-rl@191a751bda511eada76f6a9a76513d143321a64a`](https://huggingface.co/datasets/harness-hub/traj2envs-rl)

### Evaluation

| Benchmark | Details |
|---|---|
| `final-heldout` | FineEnvs/SmolDataEnvs-harbor-train, 150 easy/medium tasks from index 1000 |
| `traj2envs-heldout` | harness-hub/traj2envs-rl, the 40 tasks from index 230 |

## TRL Version

Runs on `huggingface/trl` main at [`9f8725f7`](https://github.com/huggingface/trl/commit/9f8725f7ac8e840f1304c10c4521fc3c38de8ca5) (PR [#7966](https://github.com/huggingface/trl/pull/7966)).

```bash
pip install "trl @ git+https://github.com/huggingface/trl.git@9f8725f7ac8e840f1304c10c4521fc3c38de8ca5"
```

## Files

- [`train_local.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/train_local.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/train_local.sh))
- [`train_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/train_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/train_hf_jobs.sh))
- [`eval_local.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/eval_local.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/eval_local.sh))
- [`eval_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/eval_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/eval_hf_jobs.sh))
- [`recipe.yaml`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/recipe.yaml) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/recipe.yaml))
- [`chat_template.jinja`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/TwIL-8B/chat_template.jinja) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/TwIL-8B/chat_template.jinja))

### 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))
