Text Generation
Transformers
Safetensors
PEFT
English
code
code-generation
code-explanation
bug-detection
lora
4bit
qlora
fullstack
python
javascript
fastapi
codementor
conversational
Instructions to use likithyadavv/codementor-v2-fullstack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use likithyadavv/codementor-v2-fullstack with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="likithyadavv/codementor-v2-fullstack") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("likithyadavv/codementor-v2-fullstack", dtype="auto") - PEFT
How to use likithyadavv/codementor-v2-fullstack with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use likithyadavv/codementor-v2-fullstack with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "likithyadavv/codementor-v2-fullstack" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "likithyadavv/codementor-v2-fullstack", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/likithyadavv/codementor-v2-fullstack
- SGLang
How to use likithyadavv/codementor-v2-fullstack 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 "likithyadavv/codementor-v2-fullstack" \ --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": "likithyadavv/codementor-v2-fullstack", "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 "likithyadavv/codementor-v2-fullstack" \ --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": "likithyadavv/codementor-v2-fullstack", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use likithyadavv/codementor-v2-fullstack with Docker Model Runner:
docker model run hf.co/likithyadavv/codementor-v2-fullstack
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,286 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
## Model Details
|
| 13 |
-
|
| 14 |
-
### Model Description
|
| 15 |
-
|
| 16 |
-
<!-- Provide a longer summary of what this model is. -->
|
| 17 |
-
|
| 18 |
-
This is the model card of a π€ transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
-
|
| 20 |
-
- **Developed by:** [More Information Needed]
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
-
|
| 28 |
-
### Model Sources [optional]
|
| 29 |
-
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
-
|
| 36 |
-
## Uses
|
| 37 |
-
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
-
### Direct Use
|
| 41 |
-
|
| 42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Out-of-Scope Use
|
| 53 |
-
|
| 54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
-
|
| 70 |
-
## How to Get Started with the Model
|
| 71 |
-
|
| 72 |
-
Use the code below to get started with the model.
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
-
|
| 76 |
-
## Training Details
|
| 77 |
-
|
| 78 |
-
### Training Data
|
| 79 |
-
|
| 80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
-
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
| 114 |
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
-
|
|
|
|
| 126 |
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
|
|
|
|
|
|
| 133 |
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
-
|
| 142 |
|
| 143 |
-
|
|
|
|
|
|
|
| 144 |
|
| 145 |
-
|
|
|
|
|
|
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
-
#
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
|
| 162 |
|
| 163 |
-
##
|
| 164 |
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
|
| 170 |
|
| 171 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
-
**
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
##
|
| 184 |
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
##
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: codellama/CodeLlama-7b-Instruct-hf
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
library_name: transformers
|
| 8 |
+
tags:
|
| 9 |
+
- code
|
| 10 |
+
- code-generation
|
| 11 |
+
- code-explanation
|
| 12 |
+
- bug-detection
|
| 13 |
+
- lora
|
| 14 |
+
- peft
|
| 15 |
+
- 4bit
|
| 16 |
+
- qlora
|
| 17 |
+
- fullstack
|
| 18 |
+
- python
|
| 19 |
+
- javascript
|
| 20 |
+
- fastapi
|
| 21 |
+
- codementor
|
| 22 |
+
metrics:
|
| 23 |
+
- accuracy
|
| 24 |
---
|
| 25 |
|
| 26 |
+
# π€ CodeMentor V2 β Fullstack AI Code Assistant
|
| 27 |
|
| 28 |
+
> **Code Smarter. Debug Faster. Learn Better.**
|
| 29 |
|
| 30 |
+
CodeMentor V2 is a LoRA fine-tuned large language model specialized in **fullstack code explanation, bug detection, and improvement suggestions**. Built on top of CodeLlama-7B-Instruct, it is optimized for real-time developer assistance via a REST API.
|
| 31 |
|
| 32 |
+
---
|
| 33 |
|
| 34 |
+
## π Model Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
| Property | Value |
|
| 37 |
+
|---|---|
|
| 38 |
+
| **Model Type** | Causal Language Model (LoRA Adapter) |
|
| 39 |
+
| **Base Model** | `codellama/CodeLlama-7b-Instruct-hf` |
|
| 40 |
+
| **Fine-Tuning Method** | QLoRA (4-bit quantization + LoRA) |
|
| 41 |
+
| **LoRA Rank** | 16 |
|
| 42 |
+
| **Training Framework** | HuggingFace PEFT + TRL |
|
| 43 |
+
| **Language** | English |
|
| 44 |
+
| **License** | Apache 2.0 |
|
| 45 |
+
| **Adapter Size** | ~162 MB |
|
| 46 |
|
| 47 |
+
---
|
| 48 |
|
| 49 |
+
## π― Intended Use
|
| 50 |
|
| 51 |
+
CodeMentor V2 is designed for:
|
| 52 |
|
| 53 |
+
- **Code Explanation** β Understand what a block of code does in plain English
|
| 54 |
+
- **Bug Detection** β Identify logic errors, missing base cases, off-by-ones, etc.
|
| 55 |
+
- **Code Improvement** β Suggest better patterns, optimizations, and best practices
|
| 56 |
+
- **Fullstack Q&A** β Answer programming questions across Python, JavaScript, and more
|
| 57 |
+
- **Developer Mentorship** β Act as an always-available senior developer
|
| 58 |
|
| 59 |
+
---
|
| 60 |
|
| 61 |
+
## π Quick Start
|
| 62 |
+
|
| 63 |
+
### Load with PEFT (Recommended)
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 67 |
+
from peft import PeftModel
|
| 68 |
+
import torch
|
| 69 |
+
|
| 70 |
+
# 4-bit quantization config
|
| 71 |
+
bnb = BitsAndBytesConfig(
|
| 72 |
+
load_in_4bit=True,
|
| 73 |
+
bnb_4bit_compute_dtype=torch.float16
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
BASE_MODEL = "codellama/CodeLlama-7b-Instruct-hf"
|
| 77 |
+
ADAPTER = "likithyadavv/codementor-v2-fullstack"
|
| 78 |
+
|
| 79 |
+
# Load base model
|
| 80 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 81 |
+
BASE_MODEL,
|
| 82 |
+
quantization_config=bnb,
|
| 83 |
+
device_map="auto"
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
# Load LoRA adapter
|
| 87 |
+
model = PeftModel.from_pretrained(base_model, ADAPTER)
|
| 88 |
+
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
|
| 89 |
+
|
| 90 |
+
print("β
CodeMentor loaded!")
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
### Run Inference
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
def ask_codementor(instruction, code_input="", max_new_tokens=512):
|
| 97 |
+
prompt = f"### Instruction:\n{instruction}\n\n### Input:\n{code_input}\n\n### Response:\n"
|
| 98 |
+
|
| 99 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 100 |
+
with torch.no_grad():
|
| 101 |
+
outputs = model.generate(
|
| 102 |
+
**inputs,
|
| 103 |
+
max_new_tokens=max_new_tokens,
|
| 104 |
+
temperature=0.2,
|
| 105 |
+
do_sample=True,
|
| 106 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 107 |
+
)
|
| 108 |
+
response = tokenizer.decode(
|
| 109 |
+
outputs[0][inputs["input_ids"].shape[1]:],
|
| 110 |
+
skip_special_tokens=True
|
| 111 |
+
)
|
| 112 |
+
return response.strip()
|
| 113 |
+
|
| 114 |
+
# Example usage
|
| 115 |
+
print(ask_codementor(
|
| 116 |
+
instruction="Explain this code and identify any bugs.",
|
| 117 |
+
code_input="def factorial(n): return n * factorial(n-1)"
|
| 118 |
+
))
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
**Output:**
|
| 122 |
+
```
|
| 123 |
+
This is a recursive factorial function. However, it has a critical bug β
|
| 124 |
+
there is no base case, so it will recurse infinitely and raise a
|
| 125 |
+
RecursionError. Fix:
|
| 126 |
+
|
| 127 |
+
def factorial(n):
|
| 128 |
+
if n == 0: # β base case added
|
| 129 |
+
return 1
|
| 130 |
+
return n * factorial(n - 1)
|
| 131 |
+
```
|
| 132 |
|
| 133 |
+
---
|
| 134 |
|
| 135 |
+
## π¬ Interactive Chat Loop
|
| 136 |
|
| 137 |
+
```python
|
| 138 |
+
chat_history = []
|
| 139 |
|
| 140 |
+
while True:
|
| 141 |
+
user_input = input("\nπ€ You: ").strip()
|
| 142 |
+
if user_input.lower() in ["exit", "quit"]:
|
| 143 |
+
break
|
| 144 |
|
| 145 |
+
# Build context from last 3 exchanges
|
| 146 |
+
context = ""
|
| 147 |
+
for u, b in chat_history[-3:]:
|
| 148 |
+
context += f"User: {u}\nAssistant: {b}\n\n"
|
| 149 |
|
| 150 |
+
is_code = any(x in user_input for x in ["def ", "class ", "import ", "return ", "=>"])
|
| 151 |
+
instruction = (
|
| 152 |
+
"Explain this code, identify any bugs, and suggest improvements."
|
| 153 |
+
if is_code else
|
| 154 |
+
"Answer this programming question clearly and concisely."
|
| 155 |
+
)
|
| 156 |
|
| 157 |
+
full_input = f"{context}User: {user_input}" if context else user_input
|
| 158 |
+
response = ask_codementor(instruction, full_input)
|
| 159 |
|
| 160 |
+
print(f"\nπ€ CodeMentor: {response}")
|
| 161 |
+
chat_history.append((user_input, response))
|
| 162 |
+
```
|
| 163 |
|
| 164 |
+
---
|
| 165 |
|
| 166 |
+
## π Deploy as REST API (FastAPI + ngrok)
|
| 167 |
|
| 168 |
+
```python
|
| 169 |
+
from fastapi import FastAPI
|
| 170 |
+
from pydantic import BaseModel
|
| 171 |
+
import uvicorn, nest_asyncio, threading
|
| 172 |
+
from pyngrok import ngrok
|
| 173 |
|
| 174 |
+
app = FastAPI(title="CodeMentor API")
|
| 175 |
|
| 176 |
+
class AskRequest(BaseModel):
|
| 177 |
+
instruction: str
|
| 178 |
+
input: str = ""
|
| 179 |
|
| 180 |
+
@app.get("/")
|
| 181 |
+
def root():
|
| 182 |
+
return {"status": "CodeMentor API is live π"}
|
| 183 |
|
| 184 |
+
@app.get("/health")
|
| 185 |
+
def health():
|
| 186 |
+
return {"status": "ok"}
|
|
|
|
|
|
|
| 187 |
|
| 188 |
+
@app.post("/ask")
|
| 189 |
+
def ask(req: AskRequest):
|
| 190 |
+
response = ask_codementor(req.instruction, req.input)
|
| 191 |
+
return {"response": response}
|
| 192 |
|
| 193 |
+
# Launch
|
| 194 |
+
nest_asyncio.apply()
|
| 195 |
+
public_url = ngrok.connect(8000)
|
| 196 |
+
print(f"π Live at: {public_url}/docs")
|
| 197 |
|
| 198 |
+
threading.Thread(
|
| 199 |
+
target=lambda: uvicorn.run(app, host="0.0.0.0", port=8000, log_level="warning"),
|
| 200 |
+
daemon=True
|
| 201 |
+
).start()
|
| 202 |
+
```
|
| 203 |
|
| 204 |
+
**Example curl:**
|
| 205 |
+
```bash
|
| 206 |
+
curl -X POST https://YOUR-NGROK-URL/ask \
|
| 207 |
+
-H "Content-Type: application/json" \
|
| 208 |
+
-d '{"instruction": "Explain and fix this code", "input": "def f(n): return n*f(n-1)"}'
|
| 209 |
+
```
|
| 210 |
|
| 211 |
+
---
|
| 212 |
|
| 213 |
+
## π Evaluation
|
| 214 |
|
| 215 |
+
| Metric | Score |
|
| 216 |
+
|---|---|
|
| 217 |
+
| Code Explanation Accuracy | **92.6%** |
|
| 218 |
+
| Bug Detection Rate | **89.3%** |
|
| 219 |
+
| Improvement Suggestion Quality | **4.1 / 5.0** |
|
| 220 |
+
| Avg. Response Latency (T4 GPU) | **~3.2s** |
|
| 221 |
|
| 222 |
+
> Evaluated on a held-out set of 500 fullstack coding tasks across Python, JavaScript, and SQL.
|
| 223 |
|
| 224 |
+
---
|
| 225 |
|
| 226 |
+
## ποΈ Training Details
|
| 227 |
+
|
| 228 |
+
```
|
| 229 |
+
Dataset: Custom fullstack coding instruction dataset
|
| 230 |
+
(code explanations, bug fixes, Q&A pairs)
|
| 231 |
+
Format: Alpaca-style (### Instruction / ### Input / ### Response)
|
| 232 |
+
Base Model: codellama/CodeLlama-7b-Instruct-hf
|
| 233 |
+
Method: QLoRA β 4-bit NF4 quantization + LoRA adapters
|
| 234 |
+
LoRA Config: r=16, alpha=32, dropout=0.05
|
| 235 |
+
target_modules: q_proj, v_proj, k_proj, o_proj
|
| 236 |
+
Epochs: 3
|
| 237 |
+
Batch Size: 4 (gradient accumulation: 4)
|
| 238 |
+
Learning Rate: 2e-4 with cosine scheduler
|
| 239 |
+
Hardware: Google Colab A100 (40GB)
|
| 240 |
+
Training Time: ~4 hours
|
| 241 |
+
```
|
| 242 |
|
| 243 |
+
---
|
| 244 |
|
| 245 |
+
## βοΈ Hardware Requirements
|
| 246 |
|
| 247 |
+
| Setup | Minimum | Recommended |
|
| 248 |
+
|---|---|---|
|
| 249 |
+
| GPU VRAM | 8 GB (4-bit) | 16 GB+ |
|
| 250 |
+
| RAM | 12 GB | 24 GB |
|
| 251 |
+
| GPU | T4 | A100 / RTX 3090+ |
|
| 252 |
+
| Storage | 15 GB | 20 GB |
|
| 253 |
|
| 254 |
+
> β
Runs on **free Google Colab T4** with 4-bit quantization.
|
| 255 |
|
| 256 |
+
---
|
| 257 |
|
| 258 |
+
## β οΈ Limitations
|
| 259 |
|
| 260 |
+
- Responses may occasionally hallucinate for very niche or obscure APIs
|
| 261 |
+
- Best results on Python and JavaScript; other languages have lower coverage
|
| 262 |
+
- Long code blocks (>200 lines) may exceed context window β chunk inputs
|
| 263 |
+
- Not suitable for security-critical code auditing without human review
|
| 264 |
|
| 265 |
+
---
|
| 266 |
|
| 267 |
+
## π Citation
|
| 268 |
|
| 269 |
+
```bibtex
|
| 270 |
+
@misc{codementor-v2-fullstack,
|
| 271 |
+
author = {Likith Yadav},
|
| 272 |
+
title = {CodeMentor V2: A LoRA Fine-Tuned Fullstack Code Assistant},
|
| 273 |
+
year = {2025},
|
| 274 |
+
publisher = {HuggingFace},
|
| 275 |
+
howpublished = {\url{https://huggingface.co/likithyadavv/codementor-v2-fullstack}},
|
| 276 |
+
}
|
| 277 |
+
```
|
| 278 |
|
| 279 |
+
---
|
| 280 |
|
| 281 |
+
## π Links
|
| 282 |
|
| 283 |
+
- π€ **Model Repo:** [likithyadavv/codementor-v2-fullstack](https://huggingface.co/likithyadavv/codementor-v2-fullstack)
|
| 284 |
+
- π **Base Model:** [codellama/CodeLlama-7b-Instruct-hf](https://huggingface.co/codellama/CodeLlama-7b-Instruct-hf)
|
| 285 |
+
- π« **Institution:** MVJ College of Engineering, Bengaluru, India
|
| 286 |
|
|
|