← Back
Hugging Face Blog

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

•21 min read•
#agents#llm#deployment
Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost
Level:Advanced
For:AI Engineers
✦TL;DR

The authors demonstrate that training a custom RL‑trained LoRA adapter (“harness adapter”) for Qwen3.8‑27B inside specific agent harnesses (Pi, OpenCode, Hermes Agent) raises Terminal‑Bench 2.1 pass@1 from 39 % to 55 % while cutting average token usage from 2.9 K to 1.5 K per task. Each adapter outperforms the base model on its own harness, and the three adapters can be merged into a single “super‑adapter” that works unchanged across all three harnesses. Engineers can reproduce the recipe using TRL’s AsyncGRPOTrainer, OpenEnv, and Harbor‑enabled Docker images that ship the target harnesses.

⚡ Key Takeaways

  • Qwen3.8‑27B baseline: 39 % pass@1, 2.9 K tokens (Pi harness); after LoRA: 55 % pass@1, 1.5 K tokens.
  • Adapter training is performed inside the harness via TRL’s AsyncGRPOTrainer and OpenEnv’s Harbor integration.
  • Super‑adapter merges the three per‑harness LoRAs into one model that runs unchanged on Pi 1.5.2, OpenCode 2.2.7, and Hermes Agent v0.22.6.
  • Training pipeline uses ready‑to‑use Docker images that pre‑install the target harnesses and proxy token streams to vLLM.
  • All artifacts (adapters, GGUFs, RL tasks, safeagents plugin) are hosted in a Hugging Face collection.
💡 Why It Matters

By aligning model fine‑tuning with the exact runtime harness, engineers can achieve sizable gains in both accuracy and token‑efficiency without changing the underlying model, directly reducing inference cost for production agent systems.

✅ Practical Steps

  1. Pull the provided Docker image (e.g., `docker pull yourorg/pi-harness-adapter:latest`) which includes Pi 1.5.2, OpenCode 2.2.7, or Hermes Agent v0.22.6 pre‑installed.
  2. Run TRL’s AsyncGRPOTrainer inside the container using the supplied RL task definitions to train a LoRA adapter for your chosen harness.
  3. Replace the base model checkpoint with the released LoRA (or super‑adapter) GGUF when launching the agent in production.

Want the full story? Read the original article.

Read on Hugging Face Blog ↗

More like this

Censored vs. Truncated Regression in Python, Explained

Towards Data Science•#llm

New in AWS Quick: More capable flows, an updated web experience, and agents that work together

AWS ML Blog•#agents

Three insights you may have missed from theCUBE’s coverage of the Dell Technologies New York Symposium

SiliconANGLE AI•#deployment

How Google Duplex evolved to also call businesses for you in Gemini

Google Research•#agents

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING