Coding Assistant (Fine-tuned Qwen2.5-1.5B-Instruct)

Model Description

This is a LoRA fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct, specialized to answer Coding questions only. It was trained on a synthetic instruction dataset generated using the Groq API (Llama 3.3 70B as the data-generation model), and explicitly trained to politely decline questions outside the coding domain rather than answering them.

  • Developed by: [Dhwanit Rawat / joyboy5656n]
  • Model type: Causal decoder-only language model (LoRA fine-tune, merged into base weights)
  • Language(s): English (code examples in Python/JavaScript/SQL)
  • License: Apache 2.0
  • Finetuned from model: Qwen/Qwen2.5-1.5B-Instruct

Uses

Direct Use

Answering programming-related questions: Python fundamentals, JavaScript basics, data structures, algorithms, debugging techniques, REST APIs, SQL basics, Git and version control, OOP concepts, web development basics, code optimization, unit testing, software design patterns, error handling, and recursion.

Out-of-Scope Use

This model is intentionally trained to refuse questions unrelated to coding (e.g. cooking, sports, medical advice, general trivia). It is not intended as a replacement for a full code assistant/IDE tool, production code review, or security auditing — it's a small (1.5B parameter) educational/demo model.

How to Get Started with the Model

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "your-hf-username/coding-assistant-llm"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)

messages = [
    {"role": "system", "content": "You are a specialized Coding assistant. You ONLY answer questions related to Coding. If a question is not about Coding, politely decline."},
    {"role": "user", "content": "Explain the difference between a list and a tuple in Python."},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
output = model.generate(inputs, max_new_tokens=300)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Training Details

Training Data

A synthetic dataset of instruction-response pairs generated via the Groq API, covering common programming topics, plus a set of refusal examples (~15% of the dataset) pairing off-domain questions with polite declines. Generated under a fixed daily API call budget to stay within Groq's free-tier limits.

Training Procedure

  • Method: LoRA (Low-Rank Adaptation) fine-tuning, adapters merged into the base model after training
  • Base model: Qwen2.5-1.5B-Instruct, loaded in 4-bit (NF4) for training
  • LoRA config: r=16, alpha=32, dropout=0.05, applied to attention and MLP projection layers
  • Epochs: 3
  • Effective batch size: 16 (batch size 2 × gradient accumulation 8)
  • Learning rate: 2e-4
  • Training regime: fp16 mixed precision

Speeds, Sizes, Times

  • Trained on a single Kaggle T4 GPU
  • Dataset size: 450 examples (380 domain + ~70 refusal examples)

Evaluation

Manual qualitative evaluation was performed by prompting the model with in-domain coding questions and out-of-domain questions (e.g. sports, trivia) to verify it answers the former and declines the latter. No formal benchmark scores are reported.

Bias, Risks, and Limitations

  • Trained on a small (~450 example) synthetic dataset, so coverage of advanced/niche programming topics is limited.
  • Synthetic training data was generated by another LLM (Llama 3.3 70B via Groq), so any biases, inaccuracies, or outdated practices in that model's outputs may be inherited here.
  • Code generated by this model should always be reviewed and tested before use — it is not guaranteed to be correct, secure, or production-ready.

Environmental Impact

  • Hardware Type: NVIDIA T4 GPU (Kaggle free tier)
  • Hours used: < 1 hour
  • Cloud Provider: Kaggle
  • Compute Region: Unknown

Technical Specifications

  • Architecture: Qwen2 (Qwen2.5 reuses the Qwen2 architecture class), ~1.5B parameters
  • Software: transformers, peft, bitsandbytes, datasets, accelerate

Model Card Authors

[Dhwanit Rawat / joyboy5656n]

Model Card Contact

[dhwanitrawat10@gmail.com]

Downloads last month
-
Safetensors
Model size
2B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for joyboy5656n/coding-assistant-llm

Adapter
(1270)
this model