Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 21 min read Research hardMaster

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

RL-training a LoRA adapter for a specific agent harness and task distribution makes a frozen base model both more accurate and cheaper: Qwen3.8-27B under the pi harness rises from 39% to 55% pass@1 on Terminal-Bench 2.1 while average token usage drops from 2.9K to 1.5K per task, mostly because the model reasons less and calls fewer tools. The recipe trains one adapter per harness (pi, OpenCode, Hermes Agent) inside the unmodified harness, using a proxy to vLLM and TRL's AsyncGRPOTrainer. It builds a validated, difficulty-filtered task set from SWE-smith, SWE-Gym and Tasksmith-generated PR tasks using openenv validate, keeping only tasks the base model solves sometimes. The post also covers learning-rate sweeps (settling on 2e-5), a small tool-efficiency reward bonus, safeagents guardrails during rollouts, and merging the three nearly orthogonal adapters into one super-adapter that works across all harnesses.

Related posts

  • Improving Deep Agents with harness engineering

    LangChain mediumAdept

    Changing only the harness around a fixed model (gpt-5.2-codex) raised deepagents-cli from 52.8% to 66.5% on Terminal Bench 2.0, moving it from outside the top 30 to the top 5. The gains came from an automated trace-analysis loop over LangSmith traces and targeted changes to the system prompt and middleware. These included a pre-completion checklist that forces a verification pass, injected directory and tool context, time-budget warnings, and loop detection after repeated edits to the same file. A high-xhigh "reasoning sandwich" that spends more compute on planning and verification beat running at xhigh throughout, which scored 53.9% because of timeouts. Harnesses also need tailoring per model: Claude Opus 4.6 scored 59.6% on an earlier harness that had not been through the same improvement loop.

  • Async GRPO with LoRA across HF Jobs: a bucket, a proxy, and no NCCL

    Hugging Face hardMaster

    TRL v1.14's AsyncGRPOTrainer can train a LoRA adapter and sync only that adapter to vLLM, which lets the trainer and inference replicas run as separate Hugging Face Jobs on separate machines without NCCL. A rank-1 adapter for a 1.5B model is a few megabytes, so it travels through a Storage Bucket mounted at the same path in every Job, and vLLM loads it via /v1/load_lora_adapter. Versioned adapter names and max_staleness+2 adapter slots keep in-flight rollouts on their original policy and stop prefix-cache reuse across weight versions. A small proxy adds the auth header, broadcasts adapter loads, pause and resume to every replica, and routes the G=8 rollouts of each prompt to the replica holding their KV prefix using adapter-seeded chained block hashes. Using the AsyncGRPO metrics to find bottlenecks, five runs cut the same 500-step recipe from 3 h 27 min to 53 min.

  • StackLLaMA: A hands-on guide to train LLaMA with RLHF

    Hugging Face hardMaster

    A 7B LLaMA model is trained to answer Stack Exchange questions with the full RLHF pipeline: supervised fine-tuning on packed Stack Exchange text, a pairwise reward model trained on upvote-derived preference scores, and PPO with a KL penalty against a frozen reference model. Memory is kept manageable by loading the model in 8-bit and training only LoRA adapters via peft, which needs roughly 1.2-1.4GB per billion parameters. The same frozen base serves as both policy and reference model, and data parallelism through accelerate or torchrun speeds up training. The reward model reaches 67% accuracy, and the RL run takes about 20 hours on 24 A100s. The post closes with practical notes on reward hacking and training instabilities.

  • DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency

    Hugging Face hardMaster

    DaisyRose-27B is an RL post-trained version of Qwen3.8-27B, trained with the Miles framework on about 1,200 curated long-horizon agent tasks over 18 days on 144 H200s. It raises Terminal-Bench 4.1 pass@1 from 5.6% to 12.0% and improves every other reported benchmark, including SWE and reasoning suites. Fully asynchronous training split the GPUs into 128 for agent rollouts and 16 for the trainer. The internal backend reached 37% MFU versus 16% for the open-source Megatron-based trainer, cutting GPU time by 57% and doubling end-to-end throughput. A sandbox service built on AgentENV ran about 944K sandboxes at above 99.95% success, and memory allocation that grows and shrinks with usage cut costs about 80% versus commercial sandbox providers.

  • Harness, Scaffold, and the AI Agent Terms Worth Getting Right

    Hugging Face easyNovice

    A glossary of AI agent terms that are often conflated. The model is a stateless LLM. Scaffolding is the behavior-defining layer around it: system prompt, tool descriptions, output parsing and context management. The harness is the execution loop that calls the model, runs tool calls and decides when to stop, and an agent is model plus harness. Further entries cover context engineering, policy, tool use, skills and sub-agents, plus RL training terms (environment, trainer, rollout, reward and rubrics), with pointers to TRL's GRPOTrainer, OpenEnv and Verifiers.

The quest for software engineering knowledge.

Look:
Layout: