Downloads Β· 30 days
0
Kethanvr/my_nextjs_assistant
my_nextjs_assistant is a text generation model from Kethanvr. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
A custom AI coding assistant finetuned on Qwen2.5-Coder-3B using QLoRA, specialized in Next.js, React, TypeScript, and modern web development.
Downloads Β· 30 days
0
Access
Public
Updated Jan 24, 2026
Repo size
131 MB
Likes
5
Public
Click a slice to open those files.
.safetensors120 MB Β· 88%
From the Hugging Face model README
A custom AI coding assistant finetuned on Qwen2.5-Coder-3B using QLoRA, specialized in Next.js, React, TypeScript, and modern web development.
This project demonstrates parameter-efficient finetuning of a large language model (LLM) using QLoRA (Quantized Low-Rank Adaptation). The resulting model provides accurate, context-aware coding assistance specifically for:
Key Achievement: Trained a production-quality model in ~40 minutes using free Google Colab resources (T4 GPU).
{
"messages": [
{
"role": "system",
"content": "You are a Next.js, React, and TypeScript expert assistant."
},
{
"role": "user",
"content": "How do I use useState in React with TypeScript?"
},
{
"role": "assistant",
"content": "You should define an interface for the object..."
}
]
}
# LoRA Configuration
r = 16 # LoRA rank
lora_alpha = 16 # LoRA scaling
lora_dropout = 0 # Dropout (0 for speed)
# Training Configuration
max_steps = 200 # Training steps
learning_rate = 2e-4 # Learning rate
batch_size = 2 # Per-device batch size
gradient_accumulation = 4 # Effective batch size = 8
warmup_steps = 5 # LR warmup
max_seq_length = 2048 # Context window
# 1. Data Preparation
python prepare_data.py
# 2. Training
python train.py
# 3. Evaluation
python test_model.py
from unsloth import FastLanguageModel
from peft import PeftModel
# Load base model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit",
max_seq_length=2048,
dtype=None,
load_in_4bit=True,
)
# Load finetuned adapters
model = PeftModel.from_pretrained(model, "path/to/model")
# Enable inference mode
FastLanguageModel.for_inference(model)
# Ask a question
messages = [
{"role": "user", "content": "How do I use Server Components in Next.js?"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to("cuda")
outputs = model.generate(
input_ids=inputs,
max_new_tokens=256,
use_cache=True
)
print(tokenizer.decode(outputs[0]))
# If uploaded to HuggingFace
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="YOUR_USERNAME/nextjs-assistant",
max_seq_length=2048,
load_in_4bit=True,
)
# Clone the repository
git clone https://github.com/YOUR_USERNAME/nextjs-ai-assistant.git
cd nextjs-ai-assistant
# Install dependencies
pip install -r requirements.txt
# Optional: Install Unsloth for faster training
pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
nextjs_assistant_training.ipynbtraining_data.jsonl when promptedβ Strengths:
β οΈ Limitations:
Question: "How do I use useState in React with TypeScript?"
Response:
interface User {
id: number;
name: string;
}
const [users, setUsers] = useState<User[]>([]);
nextjs-ai-assistant/
β
βββ data/
β βββ training_data.jsonl # Training dataset
β βββ prepare_data.py # Data preparation script
β
βββ notebooks/
β βββ training_notebook.ipynb # Complete training notebook
β
βββ scripts/
β βββ train.py # Training script
β βββ test_model.py # Testing script
β βββ convert_to_jsonl.py # Data conversion utility
β
βββ model/
β βββ my_nextjs_assistant/ # Saved model (not in git)
β
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # MIT License
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.
Your Name - @kethan_vr
Project Link: https://github.com/Kethanvr/qwen-fine-tuning
Portfolio: kethanvr.me
If you find this project useful, please consider giving it a star!
Made with β€οΈ by Kethan VR
If this project helped you, consider buying me a coffee β
</div>