Hugging Face has published a recipe for training a language model inside the exact software harness that will run it in production. The team created separate reinforcement-learning LoRA adapters for Pi, OpenCode and Hermes Agent, then merged them into one adapter that works across all three.

In one reported result, Qwen3.8-27B scored 39 percent on Terminal-Bench 2.1 through the Pi harness and used about 2,900 tokens per task. Adding the Pi-specific adapter raised pass@1 to 55 percent while reducing average usage to 1,500 tokens. Hugging Face attributes the improvement to shorter reasoning, fewer tool calls and more tasks completed on the first attempt.

The training setup keeps the real agent loop in place and records its tokens through a proxy. That matters because a model trained against a simplified imitation may behave differently when deployed with another tool format, context policy or system prompt.

Task quality remains a major constraint. The team filtered out benchmark repositories and used controls that reject tasks whose tests accept known-wrong answers. Of 1,127 initial Hub candidates, 858 passed semantic validation, and further difficulty checks removed tasks the base model always solved or never solved. Hugging Face released the adapters, tasks and tooling so other teams can test whether the gains transfer to their own workloads.