frappe-coder-3b-lora

A LoRA fine-tuned version of Qwen/Qwen2.5-Coder-3B-Instruct, specialized for Frappe Framework and ERPNext code generation.


Model Details

Model Description

  • Developed by: Mehul Talpada
  • Model type: Causal LM with LoRA adapter (PEFT)
  • Language: English
  • License: Apache 2.0
  • Base model: Qwen/Qwen2.5-Coder-3B-Instruct
  • Fine-tuning method: LoRA (Low-Rank Adaptation)
  • Domain: Frappe Framework / ERPNext application development

This model is fine-tuned to assist developers working with the Frappe Framework and ERPNext ERP platform โ€” generating DocTypes, controllers, server scripts, REST API handlers, hooks, fixtures, and other Frappe-specific Python/JS code.


Uses

Direct Use

  • Generating Frappe DocType definitions and controller logic
  • Writing ERPNext server scripts and scheduled tasks
  • Auto-completing Frappe Python APIs (frappe.get_doc, frappe.db.*, etc.)
  • Generating REST API endpoints and whitelisted methods
  • Writing Frappe hooks, fixtures, and patch files

Out-of-Scope Use

  • General-purpose coding outside the Frappe/ERPNext ecosystem (may still work, but not optimized)
  • Production use without human review of generated code
  • Security-sensitive code without manual audit

How to Get Started

Load the adapter (requires base model)

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

BASE_MODEL = "Qwen/Qwen2.5-Coder-3B-Instruct"
ADAPTER    = "your-username/frappe-coder-3b-lora"

tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
model     = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype="auto")
model     = PeftModel.from_pretrained(model, ADAPTER)
model.eval()

Run inference

prompt = """### Instruction:
Write a Frappe controller method that sends an email notification when a Sales Order is submitted.

### Response:
"""

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Training Details

Training Data

Fine-tuned on a custom dataset (frappe_dataset) built from:

  • Frappe Framework source repositories
  • ERPNext application source code
  • Instruction-response pairs covering common Frappe development tasks

Training Procedure

Parameter Value
Base model Qwen2.5-Coder-3B-Instruct
Fine-tune method LoRA (PEFT)
Precision bf16 mixed precision
Framework Hugging Face Transformers + PEFT
Hardware Kaggle GPU (T4/P100)

LoRA Configuration

Parameter Value
r (rank) 16
lora_alpha 32
target_modules q_proj, v_proj
lora_dropout 0.05
bias none

Update these values with your actual training config.


Limitations

  • The model may hallucinate Frappe API methods that don't exist โ€” always verify against Frappe docs
  • Trained on a limited dataset; rare or advanced Frappe patterns may not be handled well
  • Not tested on Frappe v15+ specific APIs (verify compatibility with your version)

Citation

If you use this model, please cite the base model:

@misc{qwen2.5coder,
  title  = {Qwen2.5-Coder},
  author = {Qwen Team, Alibaba Cloud},
  year   = {2024},
  url    = {https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct}
}

---

**To use this:** paste it into the `README.md` at the root of your HF repo. Fill in your actual LoRA hyperparameters (rank, alpha, target modules) from your training config โ€” those are the most important fields to get right.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for mehul945/frappe-coder-3b-lora

Base model

Qwen/Qwen2.5-3B
Adapter
(78)
this model