Qwen2.5-Coder-1.5B-Instruct โ€” Python self-distill (GGUF)

A tiny, Python-focused QLoRA fine-tune of Qwen2.5-Coder-1.5B-Instruct, distilled from a Qwen2.5-Coder-14B-Instruct teacher on locally-generated, execution-verified Python data. Quantized to Q4_K_M โ€” 941 MB โ€” so it runs comfortably on CPU on old / low-power hardware (built to run on a 2014 ThinkPad W541, no GPU needed).

TL;DR โ€” 81.5% Python pass@1 in under 1 GB. That's +7.4 points over the stock 1.5B, and it beats a stock 7B at Python while being ~5ร— smaller โ€” plus it now writes complete, interactive programs, not just bare functions.

Results (execution-based pass@1, Python)

Same 54-sample held-out Python eval, same Q4_K_M quant. Base = the exact weights this was fine-tuned from.

Model Python pass@1
Qwen2.5-Coder-1.5B-Instruct (base) 74.1% (40/54)
This model 81.5% (44/54)

For context, on the same eval the stock 7B scored 77.8% at Python โ€” this 941 MB model edges it out for Python.

pass@1 = the model's code was executed against held-out tests and had to pass. Carries ยฑ1โ€“2 samples of sampling noise.

How it was made

Teacher (Qwen2.5-Coder-14B) generates Python tasks + solutions + tests โ†’ each is executed, only passing samples kept โ†’ QLoRA SFT of the 1.5B student (Unsloth, r=16, 3 epochs) โ†’ merged 16-bit โ†’ GGUF Q4_K_M. Same pipeline as the 7B sibling, Python-only.

Training data mixes two styles (~566 samples): execution-verified functions and complete, runnable programs from natural requests (calculators, CLIs, games, file tools โ€” teacher-generated + hand-authored gold, each run-verified). The complete-program half is what makes it write whole interactive programs (using input(), menus, etc.) rather than bare functions.

โš ๏ธ Run it right or it feels dumb

A 1.5B must be run with the chat template applied and low temperature, or it rambles. Use llama-server (applies the template automatically) or llama-cli -cnv with --temp 0.2. Do not use plain llama-cli -p "..." (raw completion, temp 0.8) โ€” that's the usual reason a small local model seems broken.

Evaluation methodology

Execution-based pass@1 on a dedicated eval set disjoint from training (exact + fuzzy dedup). Deliberately not HumanEval/MBPP โ€” the goal was an honest, contamination-controlled comparison against the base, not a leaderboard number.

Honest limitations

  • Python only. It was trained and evaluated on Python; don't expect other languages to benefit.
  • Modest, specialized gain. +3.7 points over an already-decent base, on a same-distribution eval โ€” a neutral benchmark would likely show less.
  • Small model: fine for functions, scripts, and everyday Python help; not a reasoning-heavy or large-context coder.

Usage (CPU-friendly)

Q4_K_M GGUF, 941 MB. On CPU (e.g. an old laptop):

# llama.cpp on CPU โ€” no GPU offload
llama-cli   -m qwen-coder-1.5b-py-Q4_K_M.gguf -p "Write a Python function to ..."
llama-server -m qwen-coder-1.5b-py-Q4_K_M.gguf -c 4096          # OpenAI-compatible API
# or load the .gguf in LM Studio

Provenance & license

  • License: Apache-2.0. Base (Qwen2.5-Coder-1.5B) and teacher (Qwen2.5-Coder-14B) are both Apache-2.0 โ€” no restriction on training from model outputs โ€” and the data is fully self-generated (no scraped corpus, no ToS-restricted API).
  • Base model: Qwen/Qwen2.5-Coder-1.5B-Instruct
  • Teacher: Qwen/Qwen2.5-Coder-14B-Instruct
  • Full pipeline: https://github.com/h0n3y-badger/code-distill

A companion to the 7B Python/C distill โ€” see the repo for the reproducible pipeline.

Downloads last month
63
GGUF
Model size
2B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for h0ney-badger/qwen2.5-coder-1.5b-python-distill

Quantized
(145)
this model