Instructions to use mehul945/frappe-coder-3b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mehul945/frappe-coder-3b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mehul945/frappe-coder-3b-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mehul945/frappe-coder-3b-lora", device_map="auto") - PEFT
How to use mehul945/frappe-coder-3b-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mehul945/frappe-coder-3b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mehul945/frappe-coder-3b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mehul945/frappe-coder-3b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mehul945/frappe-coder-3b-lora
- SGLang
How to use mehul945/frappe-coder-3b-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mehul945/frappe-coder-3b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mehul945/frappe-coder-3b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mehul945/frappe-coder-3b-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mehul945/frappe-coder-3b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mehul945/frappe-coder-3b-lora with Docker Model Runner:
docker model run hf.co/mehul945/frappe-coder-3b-lora
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.