Hugging Face's harness adapters: training a small LoRA inside your agent's own loop improves both accuracy and efficiency on coding tasks
Hugging Face describes a method for RL-training LoRA adapters that are specific to a given agent harness (Pi, OpenCode, Hermes Agent), showing that Qwen3.8-27B's Terminal-Bench 2.1 score rises from 39% to 55% while average token usage drops from 2.9K to 1.5K under the Pi harness. The three adapters merge into a single 'super-adapter' at half weight that works across all three harnesses. Out-of-distribution testing shows the gains do not clearly transfer to unrelated task types.
General-purpose language models are not optimized for the specific agent harness you use them with. The model targets broad performance; when you combine it with a particular harness and task distribution, you leave both accuracy and efficiency on the table. Hugging Face's team proposes closing that gap by running reinforcement learning inside the harness itself, producing a small LoRA adapter that is tuned to the exact token sequence the harness generates.
The concrete recipe: freeze the base model weights, attach a LoRA adapter, and train with TRL's AsyncGRPOTrainer using rollouts that happen inside the target harness via Harbor and OpenEnv. The harness runs exactly as it ships; a proxy between the harness and vLLM records the exact tokens for the trainer. For Qwen3.8-27B under the Pi harness, this raised Terminal-Bench 2.1 pass@1 from 39% to 55% while cutting average token usage from 2.9K to 1.5K per task. The gains come from the model reasoning less, calling fewer tools, and performing better on the first attempt. Each specialist adapter beats the base model under its own harness on both SWE-bench Pro (hard 51) and Terminal-Bench 2.1.
Because the three adapters (Pi, Hermes, OpenCode) have cosine similarity of only 0.01–0.02 between them—meaning they push the model in nearly orthogonal directions—they can be merged. Concatenating along the rank dimension at weight ½ produces a single 'super-adapter' that improves over the base model under all three harnesses, with 53–73% fewer tool calls on tasks both models solve. At full weight the updates over-apply and Pi falls back to base-model level; at ⅓ each harness loses too much of its own gain.