Harness adapters
Small LoRA adapters trained with RL inside unmodified agent harnesses (pi, hermes, opencode): one adapter per model and harness, all served from one base model. A tool call is checked by safeagents before it runs. Blog post: harness-hub/harness-adapters.
Models
LoRA adapters for agent harnesses on Inkling 2 Mini, trained with async GRPO. Released: Inkling-2-Mini-pi-adapted, for pi at reasoning effort high (coding + cyber tasks, a tool-efficiency bonus and a length penalty; PRESET=pi-adapted), and the effort-none adapters (pi, hermes, opencode, DeepSeek Harness on scale800 + TermGrade, one job per harness). The Qwen3.8-27B recipe's settings, with what Inkling needs.
A pi harness adapter for the 180B Qwen3.8-Flash-Next, thinking on, trained with async GRPO on agentic coding and terminal tasks (scale800 + TermGrade). One 8-GPU B300 node: vLLM tensor + expert parallel on 4 GPUs, the LoRA trainer sharded with FSDP2 over the other 4. SLURM scripts only.
One LoRA adapter per agent harness (pi, hermes, opencode), trained with async GRPO inside the unmodified harness on verifiable Harbor tasks, with safeagents checking every tool call.
One LoRA adapter per agent harness (pi, hermes, opencode), trained with async GRPO inside the unmodified harness on verifiable Harbor tasks, with safeagents checking every tool call.
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.
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.
Guide
Small LoRA adapters trained with RL inside unmodified agent harnesses (pi, hermes, opencode): one adapter per model and harness, all served from one base model. A tool call is checked by safeagents before it runs. Blog post: harness-hub/harness-adapters.
| Model | Steps | Training tasks | HF Jobs | Recipe |
|---|---|---|---|---|
LiquidAI/LFM2.5-24B-A2B |
200 | 100 medium + 200 hard SmolDataEnvs, 230 traj2envs | h200x4 | LFM2.5-24B-A2B/ |
LiquidAI/LFM3-1.7B |
400 | 300 medium + 250 hard SmolDataEnvs, 230 traj2envs | h200x2 | LFM3-1.7B/ |
webAI-Official/TwIL-8B (experiment) |
100 | 150 medium + 250 hard SmolDataEnvs, 230 traj2envs | h200x4 | TwIL-8B/ |
Qwen/Qwen3.8-27B |
1000 | 750 scale800, 300 TermGrade | h200x2 per harness (untested) | Qwen3.8-27B/ |
Qwen3.8-27B has its own training script, TRL branch and settings. Its README lists the differences; the rest of this page describes the LFM / TwIL runs.
How a run works #
scripts/launcher_train.py runs everything inside one job:
- one vllm serve --enable-lora that serves the base model and every adapter version
- one OpenEnv Harbor server per harness, with its sandboxes on HF sandboxes
- one AsyncGRPO trainer per harness (--run NAME:HARNESS:DIFFICULTY) running scripts/async_grpo_harbor.py
After each optimizer step, a trainer loads only its new adapter into vLLM, so the three harnesses share one server. Flags the launcher does not know are passed on to the training script.
Every model uses the same settings: - LoRA r=32 on all linear layers, learning rate 1e-5, 8 rollouts per task - 4 gradient-accumulation steps, rollouts at most 4 weight updates stale, temperature 0.8 - up to 32,768 output tokens per turn - a checkpoint every 10 steps
The reward is the task's own verifier plus 0.1 × (1 − calls / 15), given only to correct rollouts
(--tool-efficiency-weight 0.1). safeagents runs with two atif-scan plugins: scripts/atif_smoldataenvs.py and
scripts/atif_traj2envs.py. They block the agent from reading a task's answers at their source.
Evaluation (scripts/launcher_eval.py --eval-lora) serves the base and every checkpoint on one vLLM and measures
pass@1 per harness on two held-out splits:
- final-heldout: 150 easy and medium SmolDataEnvs tasks from index 1000
- traj2envs-heldout: the 40 traj2envs tasks from index 230
Layout #
scripts/ shared by every model
launcher_train.py HF Jobs / local entry point for training (PEP 723: `hf jobs uv run` installs its deps)
launcher_eval.py same for evaluation
async_grpo_harbor.py the training script (AsyncGRPOTrainer + LoRA + Harbor rollouts)
evaluate_harbor.py the eval client the eval launcher runs per checkpoint
atif_*.py safeagents plugins (atif_harbor.py: generic, used by Qwen3.8-27B)
eval_sweep.py scheduled job that evaluated every checkpoint of the released runs as it landed
release_adapters.py packages the 9 released adapters (+ GGUF) and writes their model cards
<model>/
recipe.yaml metadata: hyperparameters, datasets, hardware, released checkpoints, the TRL it runs on
trl.patch Qwen3.8-27B only: its TRL fork's changes to trl/, relative to the upstream commit it branched from
train_local.sh train_hf_jobs.sh eval_local.sh eval_hf_jobs.sh
HF Jobs #
You need the hf CLI logged in, and a bucket of yours the job mounts on /outputs, set with BUCKET.
BUCKET=<user>/<bucket> bash LFM3-1.7B/train_hf_jobs.sh
Each script uploads the files the job reads from the bucket (the training or eval script, the safeagents plugins, and
TwIL's chat template), then submits the job detached. Runs are written to /outputs/runs/<model>-<harness>-<job id>-<hex>/
and evals to /outputs/eval/.
To evaluate every new checkpoint of a run on a schedule, copy scripts/launcher_eval.py to the bucket and edit
MODELS in scripts/eval_sweep.py to point at your job id:
hf jobs scheduled uv run "0 */6 * * *" --no-concurrency --flavor h200 --image huggingface/trl --secrets HF_TOKEN \
--volume hf://buckets/<user>/<bucket>:/outputs scripts/eval_sweep.py -- LFM2.5-24B-A2B
TRL version. The released runs installed a TRL wheel from the bucket
(--trl-wheel /outputs/wheels/lfm3/trl-1.17.0.dev0-py3-none-any.whl). The branch it was built from was not recorded.
Without TRL_WHEEL, the scripts use the launcher's pinned TRL: huggingface/trl@9f8725f7 on main, the merge of
#7966 that added tree-attention packing for LFM (no release includes it
yet). To use a wheel, set TRL_WHEEL=/outputs/<path>.whl.
TRL fork changes. Qwen3.8-27B still runs on a TRL fork, so its folder has a trl.patch. It holds the diff of
trl/ between the TRL fork commit that recipe installs and the upstream huggingface/trl commit the fork branched from. Both commits are recorded in
recipe.yaml under trl: and in the patch header. To rebuild the same TRL from upstream, check out upstream_base
and run git apply trl.patch. To regenerate the patch after the fork moves:
git diff $(git merge-base origin/main <fork commit>) <fork commit> -- trl/
Local machine #
The *_local.sh scripts run the same launcher with the same flags on the machine you are on: uv run installs the
launcher's inline dependencies, and the training script, plugins and chat template are read from this folder instead of
a bucket. You need uv, HF_TOKEN (the HF sandboxes also run under it), and as many GPUs as the run uses: 4 for
LFM2.5-24B-A2B and TwIL-8B, 2 for LFM3-1.7B and for each Qwen3.8-27B harness, all H200 class. Runs and evals go to
./outputs (DATA_ROOT). These are untested: none of the runs was made this way.
cd LFM3-1.7B && MAX_STEPS=2 bash train_local.sh