Update model card for javascript
Browse files
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- code-review
|
| 5 |
+
- javascript
|
| 6 |
+
- mlx
|
| 7 |
+
- gguf
|
| 8 |
+
- qwen2.5-coder
|
| 9 |
+
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# AI Code Review Model - Javascript
|
| 13 |
+
|
| 14 |
+
This is a fine-tuned code review model specialized for **Javascript** code analysis.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
- **Base Model**: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 19 |
+
- **Training Method**: LoRA fine-tuning with MLX
|
| 20 |
+
- **Format**: GGUF (Q4_K_M quantization)
|
| 21 |
+
- **Target Language**: Javascript
|
| 22 |
+
- **Purpose**: Automated code review for CI/CD pipelines
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
### Docker (Recommended)
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
docker pull ghcr.io/iq2i/ai-code-review:javascript-latest
|
| 30 |
+
docker run --rm -v $(pwd):/workspace ghcr.io/iq2i/ai-code-review:javascript-latest /workspace/src
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
### llama.cpp
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
# Download the model
|
| 37 |
+
wget https://huggingface.co/loicsapone/ai-code-review-javascript/resolve/main/model-Q4_K_M.gguf
|
| 38 |
+
|
| 39 |
+
# Run inference
|
| 40 |
+
./llama-cli -m model-Q4_K_M.gguf -p "Review this code: ..."
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### Python (llama-cpp-python)
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from llama_cpp import Llama
|
| 47 |
+
|
| 48 |
+
llm = Llama(model_path="model-Q4_K_M.gguf")
|
| 49 |
+
output = llm("Review this code: ...", max_tokens=512)
|
| 50 |
+
print(output)
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Output Format
|
| 54 |
+
|
| 55 |
+
The model outputs JSON structured code reviews:
|
| 56 |
+
|
| 57 |
+
```json
|
| 58 |
+
{
|
| 59 |
+
"summary": "Brief overview of code quality",
|
| 60 |
+
"score": 8,
|
| 61 |
+
"issues": [
|
| 62 |
+
{
|
| 63 |
+
"type": "bug",
|
| 64 |
+
"severity": "medium",
|
| 65 |
+
"line": 42,
|
| 66 |
+
"description": "Potential null pointer",
|
| 67 |
+
"suggestion": "Add null check"
|
| 68 |
+
}
|
| 69 |
+
],
|
| 70 |
+
"positive_points": [
|
| 71 |
+
"Good error handling",
|
| 72 |
+
"Clear variable names"
|
| 73 |
+
]
|
| 74 |
+
}
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
## Training
|
| 78 |
+
|
| 79 |
+
This model was trained on curated Javascript code review examples using:
|
| 80 |
+
- MLX framework for Apple Silicon acceleration
|
| 81 |
+
- LoRA adapters (r=8, alpha=16)
|
| 82 |
+
- Custom dataset of real-world code issues
|
| 83 |
+
|
| 84 |
+
For training details, see the [GitHub repository](https://github.com/iq2i/ai-code-review).
|
| 85 |
+
|
| 86 |
+
## Limitations
|
| 87 |
+
|
| 88 |
+
- Optimized for Javascript syntax and best practices
|
| 89 |
+
- May not catch all edge cases or security vulnerabilities
|
| 90 |
+
- Should be used as a supplementary tool, not a replacement for human review
|
| 91 |
+
|
| 92 |
+
## License
|
| 93 |
+
|
| 94 |
+
Apache 2.0
|
| 95 |
+
|
| 96 |
+
## Citation
|
| 97 |
+
|
| 98 |
+
```bibtex
|
| 99 |
+
@software{ai_code_review_javascript,
|
| 100 |
+
title = {AI Code Review Model for Javascript},
|
| 101 |
+
author = {IQ2i Team},
|
| 102 |
+
year = {2025},
|
| 103 |
+
url = {https://github.com/iq2i/ai-code-review}
|
| 104 |
+
}
|
| 105 |
+
```
|