Hugging Face Introduces Harness Adapters to Specialize Open Models for Agent Runtimes
Hugging Face has released a reproducible recipe and open LoRA adapters that train a frozen base model, with reinforcement learning, inside the coding agent it will actually run in. By Daniel Dominguez
Hugging Face has unveiled a method for enhancing open models specifically for use in agent runtimes, through the introduction of harness adapters. These small LoRA adapters, trained via reinforcement learning inside a particular agent harness while keeping the base model's architecture frozen, are designed to address the limitations often encountered when general-purpose models operate within specific coding agents.
The release features adapters tailored for Qwen3.8-27B under Pi, OpenCode, and Hermes Agent, accompanied by a combined super-adapter, GGUF builds, training tasks, and a safeagents plugin, all consolidated in a single Hugging Face collection.
The rationale behind this development is that general-purpose models frequently do not achieve their optimal performance when embedded within a specific coding agent, due to constraints such as reduced accuracy and token usage. For instance, Qwen3.8-27B, when running under the Pi harness, attains a pass@1 of 39% on Terminal-Bench 2.1, utilizing around 2.9K tokens per task.
However, a LoRA adapter trained within this harness significantly improves performance, achieving 55% accuracy with just 1.5K tokens, primarily by minimizing tool usage and achieving success on the first attempt.
Comparatively, a similar improvement is noted on the 51 most challenging SWE-bench Pro tasks, where performance jumps from 39.2% to 64.7% under Pi. This is in contrast to many reinforcement learning (RL) setups, which typically rebuild the agent's operational loop from scratch. The Hugging Face recipe operates directly within the existing harness and leverages token data recorded by a proxy between the harness and vLLM for training.
The training process utilizes TRL's AsyncGRPOTrainer, OpenEnv, and Harbor. The tasks encompassed in this process include those from SWE-smith, SWE-Gym, and Repo2RLEnv's Tasksmith pipeline, which must pass the validate check by OpenEnv and a difficulty screen to retain only those problems that the base model occasionally solves.
Each harness-specific adapter was trained on two NVIDIA B200 GPUs, with the 'thinking' mode disabled to streamline the process. These adapters were then merged into a rank-96 super-adapter by concatenating three rank-32 LoRAs, with the half-strength scaling preventing the agents from becoming too terse and adversely affecting Pi's performance.
The company asserts that each harness's adapter independently maintains its leading position in most comparisons, and is the preferable choice when only one harness is utilized. It is noted that even with 'thinking' turned off, each harness's adapter still outperforms or matches the performance of the base model across six harness-benchmark pairs, while simultaneously reducing the number of tool calls.
Hugging Face warns against directly comparing the results across different harnesses, as the behavior differs—specifically, Pi employs context compaction by default, which OpenCode and Hermes do not. On a set of 300 AutomationBench tasks conducted within the agent's loop on their own benchmark, the adapters' performance closely mirrors that of the base model.
Furthermore, the team observed that adapters trained with 'thinking' disabled sometimes produce succinct reasoning-like text prior to invoking a tool, an occurrence they term 'reasoning leakage'. Mario Zechner, the creator of the Pi coding agent, commented on X, clarifying that Pi does indeed transmit each assistant turn along with its 'reasoning_content', and the observed difference is attributed to context compaction (as 16 out of 51 of the published SWE-bench Pro thinking runs were compacted), rather than the omission of reasoning entirely.
Upon reviewing the merged adapter, @MrNirmata raised the point that the specialist adapters should be the ones deployed. The blog's documentation, when considering the scenario with 'thinking' off, demonstrates that the Pi adapter attains a 64% accuracy on SWE-bench Pro hard-51 tasks, outperforming the super-adapter’s 46%. The blog's table, however, suggests that concatenation might not be universally advantageous across different harnesses.
Independently, a commenter on Hacker News reported that Qwen3.8-27B frequently fails basic tool calls within Pi, and this method appears to alleviate such issues. This approach of keeping the production harness integral to the training loop echoes strategies implemented in Agent Lightning v1.0 and SkyRL's Harbor integration. Other reinforcement learning (RL) frameworks, such as verl, SkyRL-Gym, rLLM, and ART, typically train against a re-engineered version of the agent interface rather than the unmodified runtime.
The adapters, along with the associated training data, trajectories, and the recipe, are made available on the Hugging Face Hub, commencing with the blog post and the Qwen3.8-27B harness-adapter collection.
Rewritten by urgent.news; may contain errors — check the original.
Source: infoq.com