Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost
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.
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
- 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.
- Run TRL’s AsyncGRPOTrainer inside the container using the supplied RL task definitions to train a LoRA adapter for your chosen harness.
- 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 ↗