Instructions to use micymike/codemate-qwen-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use micymike/codemate-qwen-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen2.5-coder-1.5b-instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "micymike/codemate-qwen-lora") - Transformers
How to use micymike/codemate-qwen-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="micymike/codemate-qwen-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("micymike/codemate-qwen-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use micymike/codemate-qwen-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "micymike/codemate-qwen-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": "micymike/codemate-qwen-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/micymike/codemate-qwen-lora
- SGLang
How to use micymike/codemate-qwen-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 "micymike/codemate-qwen-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": "micymike/codemate-qwen-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 "micymike/codemate-qwen-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": "micymike/codemate-qwen-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use micymike/codemate-qwen-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for micymike/codemate-qwen-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for micymike/codemate-qwen-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for micymike/codemate-qwen-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="micymike/codemate-qwen-lora", max_seq_length=2048, ) - Docker Model Runner
How to use micymike/codemate-qwen-lora with Docker Model Runner:
docker model run hf.co/micymike/codemate-qwen-lora
CodeMate-Qwen 1.5B LoRA
CodeMate-Qwen 1.5B is a lightweight coding assistant fine-tuned from Qwen2.5-Coder-1.5B-Instruct using LoRA/QLoRA with Unsloth.
The goal of this project is to create a small, efficient, domain-focused assistant for Python engineering, frontend development, debugging, refactoring, and production-minded code explanations.
This is a LoRA adapter, not a fully merged standalone model.
Project Motivation
Most small coding models can generate code, but they often struggle with structured debugging, practical explanations, and production-oriented guidance.
CodeMate was fine-tuned to respond like a senior engineering assistant by encouraging outputs such as:
- Clear implementation plans
- Self-contained code
- Root-cause debugging
- Practical explanations
- Frontend-focused React/Next.js/Tailwind examples
- Pythonic, readable, type-aware solutions
Base Model
Qwen/Qwen2.5-Coder-1.5B-Instruct
Training Method
The model was fine-tuned using:
- Unsloth
- QLoRA / 4-bit loading
- PEFT LoRA adapters
- SFTTrainer
- Cosine learning rate schedule
- AdamW 8-bit optimizer
LoRA configuration:
rank: 16
lora_alpha: 32
target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
Usage
Install dependencies:
pip install unsloth transformers peft accelerate bitsandbytes
Load the LoRA adapter:
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="micymike/codemate-qwen-lora",
max_seq_length=2048,
load_in_4bit=True,
)
Example Output
Prompt:
Write a Python function to safely merge two dictionaries by summing matching numeric values.
Example response:
def safe_merge(dict1: dict, dict2: dict) -> dict:
"""Safely merges two dictionaries by summing values of keys that exist in both."""
merged_dict = {}
for key in set(dict1.keys()).union(set(dict2.keys())):
if key in dict1 and key in dict2:
merged_dict[key] = dict1[key] + dict2[key]
elif key in dict1:
merged_dict[key] = dict1[key]
else:
merged_dict[key] = dict2[key]
return merged_dict
Author
Built by Michael Moses / micymike as part of a practical AI engineering project focused on LLM fine-tuning, coding assistants, dataset curation, and deployment.
- Downloads last month
- 79
Model tree for micymike/codemate-qwen-lora
Base model
Qwen/Qwen2.5-1.5B