BlitzKode LoRA Adapter (0.5B)

BlitzKode is a local AI coding assistant fine-tuned from Qwen/Qwen2.5-0.5B-Instruct using LoRA (Low-Rank Adaptation). This repository contains the PEFT adapter β€” the research-friendly version that can be hot-loaded on top of the base model.

Creator: Sajad (neuralbroker) GitHub: https://github.com/neuralbroker/blitzkode Production GGUF: neuralbroker/blitzkode


Model Details

Property Value
Adapter version 2.1
Base model Qwen/Qwen2.5-0.5B-Instruct
LoRA rank (r) 16
LoRA alpha 32
LoRA dropout 0.05
Target modules v_proj, up_proj, down_proj, q_proj, o_proj, gate_proj, k_proj
Training steps 50
Final loss ~0.48
Library PEFT
License MIT

Training Pipeline

This adapter was produced by a 4-stage fine-tuning pipeline applied to the Qwen2.5 family:

Stage Method Purpose
1 SFT Supervised fine-tuning on 71 curated algorithmic coding problems
2 Reward-SFT Continued SFT with heuristic reward signals for code correctness and formatting
3 DPO Direct Preference Optimization on handcrafted chosen/rejected pairs
4 LoRA SFT (this adapter) Final LoRA fine-tune (r=16) on 99 samples; base model Qwen2.5-0.5B

Training Dataset (199 total samples)

Subset Count Source License
Curated algorithmic problems 71 Custom (local) β€” arrays, strings, trees, DP, graphs MIT
MetaMathQA samples 100 meta-math/MetaMathQA CC BY 4.0
Python/JavaScript patterns 28 Custom (local) β€” decorators, context managers, data classes MIT
Total 199

Usage

Load with PEFT

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "Qwen/Qwen2.5-0.5B-Instruct"
adapter_repo  = "neuralbroker/blitzkode-lora-0.5b"

tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_repo)
model.eval()

Generate code

prompt = (
    "<|im_start|>system\n"
    "You are BlitzKode, a precise AI coding assistant created by Sajad.\n"
    "<|im_end|>\n"
    "<|im_start|>user\n"
    "Write a Python function for binary search with full edge-case handling.\n"
    "<|im_end|>\n"
    "<|im_start|>assistant\n"
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=300,
    temperature=0.7,
    do_sample=True,
    repetition_penalty=1.1,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Merge adapter into base model (for export)

merged = model.merge_and_unload()
merged.save_pretrained("blitzkode-0.5b-merged")
tokenizer.save_pretrained("blitzkode-0.5b-merged")

Prompt Format

BlitzKode uses the ChatML template standard for Qwen models:

<|im_start|>system
You are BlitzKode, a precise AI coding assistant created by Sajad.<|im_end|>
<|im_start|>user
{your question}<|im_end|>
<|im_start|>assistant

Limitations

  • Text-only β€” no image/multimodal support.
  • 0.5B parameters β€” smaller and faster than the 1.5B GGUF variant; may be less accurate on complex algorithmic tasks.
  • 2048-token context β€” not suitable for long repository-level analysis.
  • Review all outputs β€” generated code must be tested before use in production.
  • Not security-audited β€” do not use for cryptographic or safety-critical code without thorough expert review.
  • Math reasoning β€” MetaMathQA training improves basic reasoning but does not substitute a dedicated math model.

Relation to the Production Model

Variant Repo Size Runtime Use case
GGUF (1.5B, F16) neuralbroker/blitzkode ~3 GB llama.cpp / llama-cpp-python Production; CPU/GPU, no Python ML stack needed
LoRA adapter (0.5B) neuralbroker/blitzkode-lora-0.5b (this repo) ~100 MB PEFT + Transformers Research; merging, further fine-tuning, quantization

License

MIT β€” see LICENSE.

You must also comply with the upstream Qwen/Qwen2.5-0.5B-Instruct license when redistributing any derived weights.


Citation

@software{blitzkode2025,
  author  = {Sajad},
  title   = {BlitzKode: A Local AI Coding Assistant},
  year    = {2025},
  url     = {https://github.com/neuralbroker/blitzkode}
}
Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for neuralbroker/blitzkode-lora-0.5b

Adapter
(576)
this model