Qwen3.8-27B Pi-Adapted LoRA: Async-GRPO RL for Coding Agent Harnesses

Qwen3.8-27B-pi-adapted (`harness-hub/Qwen3.8-27B-pi-adapted`) is an Apache-2.0 LoRA adapter trained via TRL Async-GRPO on 1,050 Harbor coding tasks to optimize Qwen3.8-27B specifically for the `pi` agent harness. With thinking disabled, it jumps from 39.2% to 64.7% on SWE-bench Pro (hard 51) while cutting generated tokens 4.5x.
Qwen3.8-27B Pi-Adapted LoRA: Async-GRPO RL for Coding Agent Harnesses: Qwen3.8-27B-pi-adapted (`harness-hub/Qwen3.8-27B-pi-adapted`) is an Apache-2.0 LoRA adapter trained via TRL Async-GRPO on 1,050 Harbor coding tasks to optimize Qwen3.8-27B specifically for the `pi` agent harness. With thinking disabled, it jumps from 39.2% to 64.7% on SWE-bench Pro (hard 51) while cutting generated tokens 4.5x. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Massive Pass@1 Gains Without Thinking: Jumps from 39.2% to 64.7% on SWE-bench Pro (hard 51) and 39.5% to 55.8% on Terminal-Bench 2.1 with `enable_thinking: false`.
- 4.5x Token Reduction vs xhigh Thinking: Solves Terminal-Bench 2.1 at 56.6% vs 54.2% for base `xhigh` thinking while generating 3.7k median tokens instead of 16.5k.
- Less Than Half the Agent Turns: Cuts median SWE-bench Pro turns from 59 to 23 (and model calls from 61 to 21) via a 0.1 tool-efficiency RL reward.
- Drop-In vLLM & GGUF Serving: Deploys via vLLM `--enable-lora --mamba-cache-mode align` or `llama.cpp` `Q8_0` + `Qwen3.8-27B-pi-lora-F16.gguf`.
import { createAgent } from '@smoke-monkey/harness';const codingAgent = createAgent({agentId: 'qwen38-pi-adapted-coder',provider: 'custom',baseUrl: 'http://localhost:8000/v1',model: 'qwen3.8-pi',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},sampling: {temperature: 0.8,topP: 1.0,extra_body: {chat_template_kwargs: { enable_thinking: false },},},});async function fixParserBug() {const result = await codingAgent.run('Locate failing unit tests in tests/test_parser.py, patch the root cause, and run pytest to confirm zero regressions.');console.log('Harness Output:', result.summary);}fixParserBug().catch(console.error);
Watch: Related Video Guides
DeepSeek's GRPO (Group Relative Policy Optimization) | Reinforcement Learning for LLMs
I Trained Qwen3-0.6B with GRPO — Building an Open Post-Training System
What Is Qwen3.8-27B-pi-adapted? Harness-Specific RL Fine-Tuning
Qwen3.8-27B-pi-adapted (harness-hub/Qwen3.8-27B-pi-adapted) is a rank-32 PEFT LoRA adapter trained with TRL Async-GRPO on 1,050 containerized coding and terminal tasks (scale800-harbor and termgrade-train-harbor) inside OpenEnv sandboxes. Rather than changing general knowledge, it adapts Qwen3.8-27B's tool-calling policy directly to the pi coding harness.
Instead of burning 34.8K hidden reasoning tokens per issue, the adapter learns concise ~160-token inter-call planning messages paired with targeted shell and edit tool calls. On SWE-bench Pro (hard 51), it prevents the 100-step budget exhaustion that caused 20 of the base model's 31 failures.
Paired Accuracy & Token-Efficiency Benchmarks
Evaluated under identical 100-step, 131,072-token context limits (temperature=0.8, top_p=1.0, text-only, enable_thinking: false), checkpoint step 160 matches or approaches maximum-effort xhigh thinking at a fraction of the compute.
| Metric / Benchmark | Qwen3.8-27B (No Think) | Qwen3.8-27B (xhigh Think) | Pi-Adapted (No Think) | Delta vs Base (No Think) |
|---|---|---|---|---|
| SWE-bench Pro (hard 51) | 39.2% | 74.5% | 64.7% | +25.5 pts (p=0.0023) |
| Terminal-Bench 2.1 (86 tasks) | 39.5% | — | 55.8% | +16.3 pts (p=0.0013) |
| Terminal-Bench 2.1 (83 matched) | 41.0% | 54.2% | 56.6% | +15.6 pts |
| SWE-bench Pro Median Turns | 59 (paired 18) | 74 (paired 27) | 23 / 27 | -61% turns |
| SWE-bench Pro Median Tokens | 9.6k | 48.8k | 6.9k / 9.4k | 4.5x fewer vs `xhigh` |
| Terminal-Bench Median Tokens | 2.9k | 16.5k | 1.5k / 3.7k | 4.5x fewer vs `xhigh` |
On Terminal-Bench 2.1, enabling xhigh thinking on the adapted checkpoint yields the exact same 56.6% score while generating ~4x more tokens, proving the policy already internalized optimal trajectory selection into direct tool calls.
Critical vLLM Flag for Hybrid Attention Prefix Caching
Qwen3.8-27B uses hybrid linear/attention layers; serving with vLLM requires `--mamba-cache-mode align` alongside `--enable-prefix-caching`. Without it, every agent turn re-prefills the entire conversation history.
Production Serving with vLLM LoRA, PEFT Merge & llama.cpp GGUF
Engineers can load the LoRA dynamically in vLLM, run the F16 LoRA (Qwen3.8-27B-pi-lora-F16.gguf) over a Q8_0 base GGUF in llama.cpp, or merge weights into a 54GB BF16 checkpoint via PeftModel.merge_and_unload().
# 1. Serve dynamically with vLLM + aligned Mamba prefix caching
vllm serve Qwen/Qwen3.8-27B \
--enable-lora --max-lora-rank 32 \
--lora-modules qwen3.8-pi=harness-hub/Qwen3.8-27B-pi-adapted \
--language-model-only --enable-prefix-caching --mamba-cache-mode align \
--enable-auto-tool-choice --tool-call-parser qwen3_xml --reasoning-parser qwen3 \
--default-chat-template-kwargs '{"enable_thinking": false}' \
--max-model-len 131072
# 2. Or serve locally with llama.cpp Q8_0 + F16 LoRA
hf download ggml-org/Qwen3.8-27B-GGUF Qwen3.8-27B-Q8_0.gguf --local-dir .
hf download harness-hub/Qwen3.8-27B-pi-adapted-GGUF Qwen3.8-27B-pi-lora-F16.gguf --local-dir .
llama serve -m Qwen3.8-27B-Q8_0.gguf --lora Qwen3.8-27B-pi-lora-F16.gguf \
--chat-template-kwargs '{"enable_thinking": false}' -c 65536 --port 9931 --alias qwen3.8-piWhy Harness-Adapted LoRAs Matter for Smoke Monkey Workflows
Open-weights 27B models often stall in multi-step coding harnesses because base RL optimizes for verbose chain-of-thought rather than concise read_file / edit_file / run_command loops. Pairing Qwen3.8-27B-pi-adapted with Smoke Monkey Harness cuts per-issue wall-clock time and token bills by over 4x while keeping execution strictly inside the OpenAI Completions API (openai-completions) rather than stateful Responses endpoints.
Frequently Asked Questions
Q:Should I enable thinking mode when running Qwen3.8-27B-pi-adapted?
No. The adapter was trained with thinking off (`enable_thinking: false`). Enabling thinking generates ~4x more tokens on Terminal-Bench 2.1 with zero accuracy gain (both score 56.6%).
Q:Why does vLLM need --mamba-cache-mode align for Qwen3.8-27B?
Qwen3.8-27B combines hybrid recurrent/Mamba-style state with attention. Passing `--mamba-cache-mode align` enables prefix caching across multi-turn agent tool calls instead of recomputing the full history every turn.
Q:Which GGUF quantization should I pair with Qwen3.8-27B-pi-lora-F16.gguf?
The authors recommend `Q8_0` (`Qwen3.8-27B-Q8_0.gguf`) because the LoRA was trained against BF16 weights; lower-bit quants exhibit progressively larger policy drift.
Q:How was Qwen3.8-27B-pi-adapted trained?
It was trained for 160 steps using TRL Async-GRPO over 750 `scale800-harbor` and 300 `termgrade-train-harbor` tasks in Harbor/OpenEnv sandboxes, combining verifier correctness with a 0.1 tool-efficiency reward.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.