---
title: "Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost"
description: "RL-training a LoRA adapter for a specific agent harness and task distribution makes a frozen base model both more accurate and cheaper: Qwen3.8-27B under the pi harness rises from 39% to 55% pass@1 on Terminal-Bench 2.1 while average token usage drops from 2.9K to 1.5K per task, mostly because the model reasons less and calls fewer tools."
url: "https://swe.quest/articles/introducing-harness-adapters-adapt-your-favorite-model-to-your-harness-to-8f64a783213a2586"
canonical: "https://huggingface.co/blog/harness-adapters-at-scale"
source: "Hugging Face"
published: "2026-11-20"
difficulty: "hard"
kind: "Research"
reading_minutes: 21
tags: ["model-training","ai-agents","ai-coding","evals","llms"]
---

# Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-11-20, 21 min read, Research. Original: [https://huggingface.co/blog/harness-adapters-at-scale](https://huggingface.co/blog/harness-adapters-at-scale)

## Summary

RL-training a LoRA adapter for a specific agent harness and task distribution makes a frozen base model both more accurate and cheaper: Qwen3.8-27B under the pi harness rises from 39% to 55% pass@1 on Terminal-Bench 2.1 while average token usage drops from 2.9K to 1.5K per task, mostly because the model reasons less and calls fewer tools. The recipe trains one adapter per harness (pi, OpenCode, Hermes Agent) inside the unmodified harness, using a proxy to vLLM and TRL's AsyncGRPOTrainer. It builds a validated, difficulty-filtered task set from SWE-smith, SWE-Gym and Tasksmith-generated PR tasks using openenv validate, keeping only tasks the base model solves sometimes. The post also covers learning-rate sweeps (settling on 2e-5), a small tool-efficiency reward bonus, safeagents guardrails during rollouts, and merging the three nearly orthogonal adapters into one super-adapter that works across all harnesses.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- reinforcement learning with GRPO ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- LoRA fine-tuning ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- LLM coding agents ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- vLLM serving

## Keywords

Qwen3.8-27B, TRL AsyncGRPOTrainer, OpenEnv, Harbor, Terminal-Bench 2.1, LoRA, Tasksmith, safeagents

## Related posts

- [Improving Deep Agents with harness engineering](https://swe.quest/articles/improving-deep-agents-with-harness-engineering-33fb749a7cb2187c.md): LangChain · 2026-10-13 · Medium · 8 min read · AI agents, AI for coding, Evaluation, LLMs
  Changing only the harness around a fixed model (gpt-5.2-codex) raised deepagents-cli from 52.8% to 66.5% on Terminal Bench 2.0, moving it from outside the top 30 to the top 5.
- [Async GRPO with LoRA across HF Jobs: a bucket, a proxy, and no NCCL](https://swe.quest/articles/async-grpo-with-lora-across-hf-jobs-a-bucket-a-proxy-and-no-nccl-a625fff69adbae9a.md): Hugging Face · 2026-09-10 · Hard · 29 min read · Model training, Inference & serving, Caching, Load balancing, LLMs
  TRL v1.14's AsyncGRPOTrainer can train a LoRA adapter and sync only that adapter to vLLM, which lets the trainer and inference replicas run as separate Hugging Face Jobs on separate machines without NCCL.
- [StackLLaMA: A hands-on guide to train LLaMA with RLHF](https://swe.quest/articles/stackllama-a-hands-on-guide-to-train-llama-with-rlhf-9d42cc2a0ae4620b.md): Hugging Face · 2023-04-05 · Hard · 14 min read · Model training, LLMs, Machine learning, Python
  A 7B LLaMA model is trained to answer Stack Exchange questions with the full RLHF pipeline: supervised fine-tuning on packed Stack Exchange text, a pairwise reward model trained on upvote-derived preference scores, and PPO with a KL penalty against a frozen reference model.
- [DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency](https://swe.quest/articles/daisyrose-27b-pushing-the-frontier-of-post-training-efficiency-d0f8a1d5a44a14e8.md): Hugging Face · 2026-11-18 · Hard · 6 min read · Model training, AI agents, LLMs, Sandboxing & isolation, Evaluation
  DaisyRose-27B is an RL post-trained version of Qwen3.8-27B, trained with the Miles framework on about 1,200 curated long-horizon agent tasks over 18 days on 144 H200s.
- [Harness, Scaffold, and the AI Agent Terms Worth Getting Right](https://swe.quest/articles/harness-scaffold-and-the-ai-agent-terms-worth-getting-right-0e5aba5b0f70e57a.md): Hugging Face · 2026-05-25 · Easy · 12 min read · AI agents, LLMs, Model training
  A glossary of AI agent terms that are often conflated. The model is a stateless LLM.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
