· AI dev tools

Hugging Face releases Harness Adapters to specialize Qwen3.8-27B for agent runtimes

The Pi adapter, trained specifically within its own agent harness, achieved a 64% score on the 51 hardest SWE-bench Pro tasks, significantly surpassing the base model's 39.2% performance.


This improvement stems from Hugging Face's introduction of Harness Adapters, a new methodology that allows specialized fine-tuning of open models for specific agent environments.

Hugging Face has made available a reproducible guide and open LoRA adapters that enable the training of a frozen foundational model using reinforcement learning directly inside the coding agent where it will ultimately operate. This collection within the Hugging Face repository includes adapters tailored for Qwen3.8-27B across the Pi, OpenCode, and Hermes Agent, alongside a combined super-adapter, GGUF builds, training tasks, and a safety plugin called safeagents.

The company noted that when general-purpose models are deployed within a particular coding agent, their performance in terms of accuracy and token efficiency is diminished. For instance, Qwen3.8-27B achieved a 39% pass@1 on Terminal-Bench 2.1 when running under Pi, consuming roughly 2.9K tokens per task. However, a LoRA adapter trained within that specific harness managed to reach 55% while using only 1.5K tokens, largely by making fewer tool invocations and succeeding on the initial attempt.

A key distinction of this recipe is that, unlike many reinforcement learning setups which rebuild the agent loop entirely, this method utilizes the existing, production-ready harness. Training occurs by monitoring tokens recorded by a proxy situated between the harness and vLLM. The training process employs TRL's AsyncGRPOTrainer and OpenEnv, alongside Harbor. Furthermore, problems sourced from SWE-smith, SWE-Gym, and Repo2RLEnv's Tasksmith pipeline must satisfy an openenv validation and a difficulty screening process, ensuring only problems the base model has some capacity to solve are included.

Each adapter was developed using two NVIDIA B200 GPUs, with the model's "thinking" capability intentionally deactivated. Following this, Hugging Face merged the three rank-32 LoRAs into a single rank-96 super-adapter. This super-adapter was scaled down by half its strength after a simple summation, as the initial concatenation resulted in agents that were overly concise and negatively impacted Pi's performance.

The firm asserts that, even without enabling thinking, each harness's dedicated adapter remains superior in most comparative evaluations and is the preferred option when only one specific harness is being employed. Despite not having thinking enabled during its training, the super-adapter reportedly matches or exceeds the thinking base model across all six harness-benchmark pairs while simultaneously reducing the number of tool calls.

The team cautioned that the Terminal-Bench figures should be viewed with some reservation, as the merging weight for the super-adapter was selected based specifically on that benchmark. Moreover, they warned against comparing results across different harnesses because Pi automatically applies context compaction, a feature not present in OpenCode or Hermes.

When tested against 300 AutomationBench tasks, running within that benchmark's native agent loop, the adapters maintained performance metrics closely aligned with the base model. Researchers also observed a phenomenon where adapters trained with thinking off sometimes output brief, reasoning-like text immediately preceding a tool call, which the team termed "reasoning leakage."

Mario Zechner, the creator of the Pi coding agent, issued a clarification on X regarding a prior statement from Hugging Face. The company had claimed that Pi does not retain previous reasoning turns, unlike OpenCode and Hermes. Zechner countered that Pi does transmit every assistant turn along with its reasoning_content; the perceived gap is actually due to auto-compaction, noting that 16 out of 51 of the published SWE-bench Pro thinking runs underwent compaction. He clarified that this represents a context overflow difference, not a loss of reasoning.

In a discussion about the merged adapter, @MrNirmata contended that the specialized adapter should still be the one deployed in production. The blog's own data, specifically when thinking is off, demonstrates the Pi adapter achieving 64% on SWE-bench Pro hard-51, compared to only 46% for the super-adapter.

Hugging Face concluded that while concatenation presents an interesting experimental avenue, it is not a universally beneficial solution across all harnesses. Independently, a commenter named Wheen on Hacker News noted that the Qwen3.8-27B model often fails basic tool calls in Pi, and this new approach appears to alleviate that issue. The concept of integrating the production harness directly into the training cycle echoes approaches seen in Agent Lightning v1.0 and SkyRL's Harbor integration. It is worth noting that other RL frameworks, such as verl, SkyRL-Gym, rLLM, and ART, generally train against a reconstructed agent interface rather than the unmodified runtime environment.

The necessary adapters, training datasets, trajectories, and the complete recipe are all accessible on the Hugging Face Hub, starting from the initial blog post and the Qwen3.8-27B harness-adapter collection.

Why it matters

This tooling allows developers to fine-tune large models to perform optimally within specific agent environments, moving beyond general-purpose model limitations. The availability of these adapters and recipes on the Hugging Face Hub provides a concrete path for customizing AI agents for production coding tasks.

Earlier coverage

Related coverage

Also worth reading

  1. Angular 21.2.27 released, fixes component template capture during compile
  2. next.js 16.6.0-canary.0 released, adds experimental new server for Switchyard
  3. next.js 16.5.0-rc.4 released, featuring turbopack document chunking updates
  4. Optimizely Supply-Chain Attack Delivers Malware Through Websites of 178 Global Brands
  5. UK ministers blame AI-assisted hackers for DWP benefits system meltdown