Qwen3.8-27B-pi — SVD-LoRA (base: Qwen3.8-27B)
The weight difference between bytkim/Qwen3.8-27B-pi and stock Qwen/Qwen3.8-27B, compressed by exact truncated SVD into a rank-64 LoRA. Load it on any Qwen3.8-27B GGUF with --lora to get the Pi coding-agent behaviour without shipping a second 55 GB model.
What is Qwen3.8-27B-pi?
A Qwen3.8-27B fine-tune built for the Pi agent harness: the iterative loop of reading a repository, editing files, running tools, and responding to their feedback. From the source card:
- Supervised fine-tuning on filtered, successful Pi sessions — complete coding workflows, not isolated snippets.
- GRPO (reinforcement learning) on top, emphasising completed, checked implementations over generated text.
- MTP (multi-token prediction) head, vision support, adjustable reasoning effort.
How this LoRA was made
- Download both
bytkim/Qwen3.8-27B-piandQwen/Qwen3.8-27B(both 1,199 tensors, identicalqwen3_5architecture — no key remapping needed). - Compute
Δ = W_pi − W_baseper tensor; 496 of 1,199 tensors have a non-zero delta (≥ 0.001 norm).lm_headandembed_tokensare untouched by the fine-tune and are excluded. - Run an exact truncated SVD of every delta at rank 64 (rank 48 where the matrix is only 48×5120 — the GDN
in_proj_a/in_proj_bgates, which reconstruct exactly). - Store
lora_A = Σ_r^½ V_rᵀ,lora_B = U_r Σ_r^½in PEFT format.
Nothing is trained; no dataset is used. The adapter is a pure compression of the fine-tune's weight delta.
Measured fidelity
| property | value |
|---|---|
| tensor pairs | 496 |
| rank | 64 (48 for GDN gate pairs) |
| alpha | 64 (scale 1.0 at inference) |
| energy retained (mean) | 0.549 |
| energy retained (min / max) | 0.286 / 1.000 |
| relative reconstruction error (mean) | 0.598 |
| target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, in_proj_qkv, in_proj_z, in_proj_a, in_proj_b, out_proj |
| dtype | float32 |
The fine-tune's delta is broad and low-amplitude (max Δ-norm 0.139), so rank 64 captures roughly half the delta energy on average. Expect the Pi behaviour — terser, tool-driven coding — not a bit-exact copy of the source model.
Files
| File | Format | Notes |
|---|---|---|
adapter_model.safetensors |
PEFT LoRA | 496 pairs, r=64, alpha=64, fp32 |
adapter_config.json |
JSON | base_model: Qwen/Qwen3.8-27B |
pi_qwen3.8-27B_svd_lora.gguf |
llama.cpp LoRA GGUF | 800 tensors; GDN in_proj_a/in_proj_b pairs omitted (see note) |
Note on the GGUF file:
convert_lora_to_gguf.pydoes not map the GDNin_proj_a/in_proj_btensors, so the GGUF carries 800 of the 992 adapter tensors. The PEFT adapter is complete (all 496 pairs). If you need the GDN gates, use the PEFT adapter in Python.
Usage
llama.cpp
llama-cli -m Qwen3.8-27B.gguf \
--lora pi_qwen3.8-27B_svd_lora.gguf \
-p "Refactor this function and run the tests."
Python (PEFT)
from peft import PeftModel
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B",
torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, "hotdogs/qwen3.8-27B-pi_svd_lora")
License
Apache-2.0 (upstream Qwen3.8-27B-pi). Base model Qwen3.8-27B is Apache-2.0. Credit: bytkim for Qwen3.8-27B-pi.