AI Development

Qwen3.8-27B pi-adapted: the Hugging Face LoRA that takes a local model from 39% to 65% on the hardest bugs

Hugging Face trained a 0.6 GB LoRA that lifts Qwen3.8-27B from 39.2% to 64.7% on the hardest SWE-bench Pro bugs inside pi. It is free and runs locally.

Luca Di Domenico

Luca Di Domenico

· 5 min read

In short

Hugging Face used reinforcement learning to train a LoRA of about 0.6 GB that specializes Qwen3.8-27B for the open source coding agent pi. On the 51 hardest SWE-bench Pro tasks the model goes from 39.2% to 64.7%, and with reasoning off it generates about 4.5 times fewer tokens. The gain only holds inside pi and against the regular Qwen: it is not comparable with Anthropic or OpenAI models.

Hugging Face took Qwen3.8-27B, an open source model that runs on your own computer, and trained it to work inside pi, an open source coding agent. On the 51 hardest bugs of SWE-bench Pro the model goes from 39.2% to 64.7% of tasks solved. You pay no subscription and your code never leaves your computer.

What did Hugging Face do to Qwen3.8-27B?

Hugging Face left the original model untouched. On top of Qwen3.8-27B it trained a LoRA, a small layer of corrections that plugs into the base model: it weighs about 0.6 GB and is called Qwen3.8-27B-pi-adapted. Think of it as an extension that specializes the model for a single coding agent, pi.

The training is reinforcement learning: the model solved more than a thousand real tasks inside pi (750 tasks from the scale800 dataset and 300 from TermGrade) and was rewarded every time it succeeded, with a small bonus when it used fewer tool calls. That is all in the model card on Hugging Face.

Why do local models get lost inside a coding agent?

The problem with local models in coding agents is that they spin in circles: they search for files, retry the same commands and burn steps without reaching a solution. Every coding agent has its own tools, its own prompt and its own way of working, and a generic model does not know them.

The model card shows it with numbers. On the SWE-bench Pro tasks the regular Qwen fails, the base model runs out of its 100 available steps in 20 cases out of 31. The adapted model never hits the limit. On the tasks both solve, the adapted model needs less than half the turns: on SWE-bench Pro the median is 23 against 59.

What are the numbers for Qwen3.8-27B pi-adapted?

These are the results published by Hugging Face, all measured inside pi with extended reasoning turned off:

  • SWE-bench Pro (the 51 hardest tasks): from 39.2% to 64.7%, +25.5 points. 15 more tasks solved, 2 lost.
  • Terminal-Bench 2.1: from 39.5% to 55.8%, +16.3 points.
  • Reasoning off versus reasoning at maximum: on Terminal-Bench 2.1 the adapted model without reasoning reaches 56.6%, while the regular Qwen reasoning at maximum effort (xhigh) stops at 54.2%. On SWE-bench Pro it stays 10 points behind (64.7% against 74.5%).
  • Tokens: it gets there generating about 4.5 times fewer tokens, so it also answers faster.

For me this is the most interesting part: a small model, adapted to a specific harness, becomes much more capable without changing its size. It is the same idea behind agentic coding: the tool matters as much as the model.

What are the limits of this model?

The improvement needs to be read correctly. The comparison is between the regular Qwen3.8-27B and the same Qwen3.8-27B with the pi extension. If you use the adapted model inside another coding agent, for example Claude Code, the result will be no better than with the regular Qwen: the LoRA was trained only on pi’s tools.

The second limit is the comparison with paid models. Hugging Face measured everything with its own rules: one attempt per task, a maximum of 100 steps, only the 51 hardest SWE-bench Pro tasks. The model card itself warns that these numbers are not comparable with the ones on the official Qwen3.8-27B card. So you cannot compare it with Anthropic or OpenAI models, and we do not know how close it gets to paid models.

If you want to understand which open weight model to pick for your computer, I compared the three hardware tiers for coding with local AI.

How do you install Qwen3.8-27B pi-adapted in 3 steps?

You need 32 GB of RAM on your Mac. There are three steps:

  1. Install pi, the coding agent (it needs Node.js 22.19 or newer): npm install -g --ignore-scripts @earendil-works/pi-coding-agent
  2. Download the Qwen3.8-27B model and the LoRA Qwen3.8-27B-pi-adapted, which you find on Hugging Face, also as GGUF.
  3. Start it with llama.cpp (or with Llama.app on macOS) and connect pi to the local server with the pi-llama extension.

These are the model card’s commands for the GGUF version with llama.cpp:

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-pi

pi install git:github.com/huggingface/pi-llama
pi --model llama-cpp/qwen3.8-pi

Keep thinking off: the model was trained that way, and with reasoning on it generates about 4 times more tokens for a few extra solved tasks at most. The instructions for vLLM, transformers and Llama.app are on the model page.

Who is Qwen3.8-27B pi-adapted for?

It is for people who code with AI, have no special requirements and pay a subscription just for that. With a 32 GB Mac you get a free, open source coding agent that works locally and sends your code to no one. The price is a bit of setup and a model that performs best only inside pi.

If you are weighing whether local AI is worth it compared with cloud models, I covered it here, with numbers on model sizes. Now is a good time to try a coding agent on your own computer: three commands are enough to see whether it fits your work.

Sources

Want to know what this means for your product?

If you're building software with AI and want a second opinion on how you're working, tell me about your project.

Tell me about your project
AI AgentsLocal AIVibe codingAI Development

Follow the blog

One email for every new article

I only write when an article is out: title, summary and link. You can unsubscribe with one click from any email.

RSS feed

An RSS feed is the up-to-date list of articles: add it to a reader app like Feedly or Inoreader and new articles show up there, no email needed.

lucadidomenico.studio/en/blog/rss.xml