[Image blocked: No description]
A LoRA adapter for Qwen/Qwen3.8-27B, trained with reinforcement learning
with thinking on to work as the model behind the pi coding agent on
software-engineering and terminal tasks.
It is the thinking counterpart of harness-hub/Qwen3.8-27B-pi-adapted,
which was trained with thinking off.
[!Tip]
The same accuracy as thinking with the base model or the pi adapter, at 35–42% fewer tokens. On the tasks all
three solve, this adapter needs 26.7k output tokens per SWE-bench Pro task where the pi adapter with thinking needs
46.0k (−42%, mean), and 6.9k per Terminal-Bench 2.1 task against 10.7k (−35%, median).
- SWE-bench Pro (hard 51): 76.5%, against 74.5% for both references.
- Terminal-Bench 2.1: 57.5%, against 59.8% for the pi adapter with thinking and 60.9% for the base model with
thinking, all three run on the same hardware at the same time: on par within noise (6 tasks won, 8 lost against the
pi adapter), with 35% fewer tokens and 15% fewer tool calls on the tasks all three solve.
- Less thinking per call: fewer long reasoning blocks, fewer turns per task.
[!Note]
All results are under the pi harness: one attempt per task, a 100-step budget, thinking on at the chat template's
default effort (xhigh) with up to 32k output tokens per model call, text only (the vision tower is not served),
sampling at temperature 0.8 with top-p 1.0 (the training sampling). These numbers are not comparable with the ones on
the Qwen3.8-27B card, which uses other harnesses, larger budgets and the
full SWE-bench Pro.
[blocked]
Results
[Image blocked: No description]
On Terminal-Bench 2.1, the three thinking runs were evaluated together on the same hardware (see
Evaluation checks) and are compared on the 87 tasks all three graded; the runs without thinking were not part
of that re-run. "Thinking" is the chat template's thinking mode at its default reasoning effort (xhigh). This adapter is always
evaluated with thinking on.
Paired results (against the pi adapter with thinking)
One attempt per task, both with thinking on, on the same tasks. Score is pass@1 on the tasks both graded; tool calls
and tokens are compared on the tasks both solved, so they measure only how much work each needed. The p-value is an
exact sign test on the tasks that changed outcome; the interval is the paired 95% interval on the difference.
*Medians on the 41 Terminal-Bench tasks all three models solved.
Against the base model with thinking: on SWE-bench Pro, +2.0 points, −40% tool calls, −34% output tokens; on
Terminal-Bench 2.1, −3.4 points (6 won, 9 lost), −35% tool calls and −19% output tokens (medians).
Output tokens on the tasks all three solve
Mean output tokens per task (thinking included) on the tasks the base model with thinking, the pi adapter with thinking
and this adapter all solved.
On Terminal-Bench 2.1, on the 41 tasks all three solved in the matched re-run, the medians are 8.5k (base), 10.7k (pi
adapter) and 6.9k for this adapter (−35%). On SWE-bench Pro the medians are 25.3k against 38.8k.
How it thinks
[Image blocked: No description]
One SWE-bench Pro task both models solved with thinking on (gravitational/teleport): each bar is one model call, its
height the call's output tokens, thinking included. This adapter solves it in 47 calls and 28.6k tokens, the pi adapter
in 82 calls and 82.1k. It is the task with the largest saving among those both solved; across the tasks all three
solved, the saving is about 40%.
[Image blocked: No description]
On the 18 SWE-bench Pro tasks all three solved and have a full trajectory for:
The adapter still thinks, but in shorter blocks and over fewer turns.
[blocked]
Evaluation checks
- Terminal-Bench 2.1 was re-measured on matched hardware. Our first Terminal-Bench evaluation put this adapter
10.8 points ahead of the pi adapter with thinking, but the runs were days apart and on different hardware (the
references on NVIDIA B200, this adapter on B300), and most of the gap came from the references running out of the
1 h wall-clock limit. We re-ran all three models on B300 at the same time, twice (sandbox outages cost tasks in both),
and pooled the two per task: a task's grade is the first run's, or the second's where the first had none. On the 87
tasks all three graded, this adapter is 2.3 points behind the pi adapter and 3.4 behind the base model, both within
noise. The Terminal-Bench numbers on this card are from that re-run.
- Checkpoint choice. Checkpoints 70, 90, 120 and 150 were evaluated on these same benchmarks and 90 was picked: it
was the best on our first Terminal-Bench 2.1 evaluation (65.0%, 71.2%, 63.7%, 57.5%) and is second on SWE-bench Pro
(78.4%, 76.5%, 68.6%, 51.0%). Later checkpoints get cheaper but lose accuracy, so the scores above carry some
selection bias. The differences between checkpoints 70 and 90 are within the run-to-run noise described below.
- Contamination. We compared the Terminal-Bench 2.1 instructions with the training tasks and found no overlap.
- Thinking runaways. In about 7 of its runs, one model call reaches the 32k-token cap, mostly on failed tasks.
- Single attempt, and what it can resolve. With one attempt per task, only the tasks whose outcome changes carry
information (9 on SWE-bench Pro, 14 on Terminal-Bench), so neither the SWE-bench Pro gain (+2.0 points) nor the
Terminal-Bench gap (−2.3 points) is significant, and differences smaller than about 9 points in either direction
cannot be resolved: a true change of a few points would look the same. Whole runs also vary: the same checkpoint 90
scored 71.2% in our first Terminal-Bench evaluation and 57.5% in the matched re-run, on the same hardware but on a
different set of graded tasks (80 and 87) and different days. Several attempts per task would narrow this (about
±5 points with three).
[blocked]
Use with pi
Serve the adapter with vLLM and point pi at it
1. Serve the adapter with vLLM
This is the configuration of the evaluations. Thinking on is what this adapter was trained for. Prefix caching on this
hybrid model needs --mamba-cache-mode align; without it, every agent turn re-reads its whole history.
2. Point pi at it
Install pi (Node.js 22.19 or newer):
Add the server to ~/.pi/agent/models.json:
"api": "openai-completions": without it pi uses the Responses API, which this adapter was not trained or evaluated
with.
"maxTokens": 32768: the per-call output cap of training and evaluation. A lower cap cuts long reasoning short.
[blocked]
Merge the adapter into the base model
Get a standalone model, with no LoRA at serving time
The adapter can be merged into the base weights with PEFT. The result is a regular Qwen3.8-27B checkpoint (about 54 GB
in BF16) that any engine serves without LoRA support:
Then serve it like the base model, without the LoRA flags and with thinking on.
[blocked]
Training
Method, data, hyperparameters and hardware
The only change from Qwen3.8-27B-pi-adapted's recipe is
thinking on during rollouts, with the larger per-call output cap it needs. The training script is
examples/async_grpo_harbor in TRL.