Results

Table with columns: Benchmark, Qwen3.8-27B, Qwen3.8-27B, thinking, Qwen3.8-27B-pi-adapted, Qwen3.8-27B-pi-adapted, thinking, Qwen3.8-27B-think-pi-adapted| Benchmark | Qwen3.8-27B | Qwen3.8-27B, thinking | Qwen3.8-27B-pi-adapted | Qwen3.8-27B-pi-adapted, thinking | Qwen3.8-27B-think-pi-adapted |
|---|
| SWE-bench Pro (hard 51) | 39.2% | 74.5% | 64.7% | 74.5% | 76.5% |
| Terminal-Bench 2.1 (87 tasks) | – | 60.9% | – | 59.8% | 57.5% |
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.
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.
Table with columns: Benchmark, Difference (points), 95% interval, Newly solved / lost, Tool calls, Output tokens| Benchmark | Difference (points) | 95% interval | Newly solved / lost | Tool calls | Output tokens |
|---|
| SWE-bench Pro (hard 51) | +2.0 | −9.5 to +13.5 | 5 / 4 (p = 1.0) | −7% | −31% |
| Terminal-Bench 2.1 (87 tasks) | −2.3 | −10.7 to +6.1 | 6 / 8 (p = 0.79) | −15%* | −35%* |
*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).
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.
Table with columns: Benchmark, Tasks, Qwen3.8-27B, thinking, Qwen3.8-27B-pi-adapted, thinking, This adapter, vs pi adapter| Benchmark | Tasks | Qwen3.8-27B, thinking | Qwen3.8-27B-pi-adapted, thinking | This adapter | vs pi adapter |
|---|
| SWE-bench Pro (hard 51) | 28 | 45.8k | 46.0k | 26.7k | −42% |
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.

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%.

On the 18 SWE-bench Pro tasks all three solved and have a full trajectory for:
Table with columns: Qwen3.8-27B, thinking, Qwen3.8-27B-pi-adapted, thinking, This adapter | Qwen3.8-27B, thinking | Qwen3.8-27B-pi-adapted, thinking | This adapter |
|---|
| Turns per task (median) | 70 | 60 | 47 |
| Output tokens per task (median) | 54k | 54k | 33k |
| Model calls over 1k output tokens | 20% | 24% | 18% |
| Model calls over 8k output tokens | 0.9% | 1.3% | 0.6% |
The adapter still thinks, but in shorter blocks and over fewer turns.
- 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).
Use with pi
1. Serve the adapter with vLLM
vllm serve Qwen/Qwen3.8-27B \ --enable-lora --max-lora-rank 32 \ --lora-modules qwen3.8-think-pi=harness-hub/Qwen3.8-27B-think-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": true}' \ --max-model-len 131072
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):
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
Add the server to ~/.pi/agent/models.json:
{ "providers": { "local": { "baseUrl": "http://localhost:8000/v1", "api": "openai-completions", "apiKey": "dummy", "models": [{ "id": "qwen3.8-think-pi", "reasoning": true, "maxTokens": 32768 }] } }}
"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.
pi --provider local --model qwen3.8-think-pi --print "Find out why the tests in tests/test_parser.py fail and fix the bug."
Merge the adapter into the base model
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:
import torchfrom peft import PeftModelfrom transformers import AutoModelForImageTextToText, AutoTokenizer base = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.8-27B", dtype=torch.bfloat16, device_map="cpu")model = PeftModel.from_pretrained(base, "harness-hub/Qwen3.8-27B-think-pi-adapted").merge_and_unload()model.save_pretrained("Qwen3.8-27B-think-pi-merged")AutoTokenizer.from_pretrained("harness-hub/Qwen3.8-27B-think-pi-adapted").save_pretrained("Qwen3.8-27B-think-pi-merged")
Then serve it like the base model, without the LoRA flags and with thinking on.
Training
Table | |
|---|
| Method | AsyncGRPO (TRL, experimental), LoRA |
| Environment | Harbor tasks served by OpenEnv, rollouts in HF sandboxes, tool calls screened by safeagents |
| Harness | pi |
| Tasks | 750 scale800 tasks interleaved with 300 TermGrade tasks |
| Reward | the task verifier's correctness (falls back to reward), plus a tool-efficiency bonus of weight 0.1; no length penalty |
| Steps | 90 (this checkpoint) |
| Learning rate | 2e-5 |
| LoRA | r = 32, alpha = 64, on q, k, v, o, gate, up and down projections |
| Rollouts | 8 per task, temperature 0.8, thinking on (xhigh), up to 32,768 output tokens per model call, 50 agent steps and 1,800 s per rollout |
| Batch | 16 micro-batches of up to 65,536 tokens per step, rollouts up to 16 policy versions stale |
| Hardware | 2× NVIDIA H200 (HF Jobs): vLLM on one, the trainer on the other |
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.