Hugging FaceYounes B, ben burtenshaw, Nathan Habib, Lysandre, Amine Dirhoussi, Adithya S K, shaun smith, Sergio Paniego, Joel Niklaus, Lewis TunstallTutorial
Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost
Summary
Training reinforcement learning-based LoRA adapters inside a specific agent harness improves model accuracy and efficiency for that harness and task combination. The post presents a reusable recipe for training such harness adapters, using Qwen3.8-27B as the base model and three harnesses: Pi, OpenCode, and Hermes Agent. The adapters are trained with GRPO using TRL’s AsyncGRPOTrainer, with rollouts executed inside the harness itself via Harbor integration. Results show that each harness adapter outperforms the base model on benchmarks like Terminal-Bench 2.1, achieving higher pass@1 scores while using fewer tokens. The three adapters were also merged into a single super adapter that works across all three harnesses without modification.
Context
Models are not fully optimized for all harnesses and task distributions, leaving performance and efficiency on the table. The post addresses this by training custom RL-based LoRA adapters for specific harness-task combinations.
Approach / What changed
Training LoRA adapters for Qwen3.8-27B per agent harness (Pi, OpenCode, Hermes Agent) using RL inside the harness itself. Datasets, training, and agent rollouts happen on the Hugging Face Hub using TRL’s AsyncGRPOTrainer, OpenEnv, and harbor. The adapters are trained with GRPO, and the recipe is fully reusable.
Takeaways
RL training inside the target harness yields more accurate and efficient models compared to the base model, as shown by higher pass@1 scores and lower token usage on Terminal-Bench 2.1.
The three harness-specific LoRA adapters can be merged into a single super adapter that performs well across all three harnesses without modification.
The model learned to generate short reasoning-like text before tool calls, a phenomenon called ‘reasoning leakage’, which improves efficiency but requires further study for hybrid thinking models.
FAQ
How do the harness adapters perform on tasks outside the training harness?
On AutomationBench tasks with a different agent loop, the adapters stay close to the base model, with Pi and OpenCode slightly ahead and Hermes slightly behind, indicating no clear transfer or degradation.
What did the model learn during RL training?
The model learned to generate short reasoning-like text before tool calls, a 'reasoning leakage' that improves token efficiency and performance compared to the base non-thinking model.
Can the recipe be reproduced for other models and harnesses?
Yes, the post provides a fully reusable recipe with all artifacts (adapters, GGUFs, RL tasks, safeagents plugin) available in a Hugging Face collection, and invites builders to apply it to their own models and harnesses.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.