Update model card for multi-language model
Browse files
README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- code-review
|
| 5 |
+
- multi-language
|
| 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
|
| 13 |
+
|
| 14 |
+
Multi-language code review model optimized for automated code review in CI/CD pipelines.
|
| 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 |
+
- **Purpose**: Automated code review for CI/CD pipelines
|
| 22 |
+
|
| 23 |
+
## Usage
|
| 24 |
+
|
| 25 |
+
### Docker (Recommended)
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
docker pull ghcr.io/iq2i/ai-code-review:latest
|
| 29 |
+
|
| 30 |
+
# Review your codebase
|
| 31 |
+
docker run --rm -v $(pwd):/workspace ghcr.io/iq2i/ai-code-review:latest /workspace/src
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### llama.cpp
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
# Download the model
|
| 38 |
+
wget https://huggingface.co/iq2i/ai-code-review/resolve/main/model-Q4_K_M.gguf
|
| 39 |
+
|
| 40 |
+
# Run inference
|
| 41 |
+
./llama-cli -m model-Q4_K_M.gguf -p "Review this code: ..."
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
### Python (llama-cpp-python)
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
from llama_cpp import Llama
|
| 48 |
+
|
| 49 |
+
llm = Llama(model_path="model-Q4_K_M.gguf")
|
| 50 |
+
output = llm("Review this code: ...", max_tokens=512)
|
| 51 |
+
print(output)
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Output Format
|
| 55 |
+
|
| 56 |
+
The model outputs JSON structured code reviews:
|
| 57 |
+
|
| 58 |
+
```json
|
| 59 |
+
{
|
| 60 |
+
"summary": "Brief overview of code quality",
|
| 61 |
+
"score": 8,
|
| 62 |
+
"issues": [
|
| 63 |
+
{
|
| 64 |
+
"category": "security",
|
| 65 |
+
"severity": "medium",
|
| 66 |
+
"title": "Potential SQL injection",
|
| 67 |
+
"description": "User input not sanitized",
|
| 68 |
+
"suggestion": {
|
| 69 |
+
"type": "code_change",
|
| 70 |
+
"content": "Use prepared statements"
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
],
|
| 74 |
+
"positive_points": [
|
| 75 |
+
{
|
| 76 |
+
"title": "Good error handling",
|
| 77 |
+
"description": "Comprehensive try-catch blocks"
|
| 78 |
+
}
|
| 79 |
+
]
|
| 80 |
+
}
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Training
|
| 84 |
+
|
| 85 |
+
- **Training examples**: 70+ real-world code issues
|
| 86 |
+
- **Framework**: MLX for Apple Silicon acceleration
|
| 87 |
+
- **Method**: LoRA adapters (r=4, alpha=8)
|
| 88 |
+
- **Iterations**: 200
|
| 89 |
+
|
| 90 |
+
For training details, see the [GitHub repository](https://github.com/iq2i/ai-code-review).
|
| 91 |
+
|
| 92 |
+
## Limitations
|
| 93 |
+
|
| 94 |
+
- Should be used as a supplementary tool, not a replacement for human review
|
| 95 |
+
- May not catch all edge cases or security vulnerabilities
|
| 96 |
+
- Best results on common programming patterns and frameworks
|
| 97 |
+
|
| 98 |
+
## License
|
| 99 |
+
|
| 100 |
+
Apache 2.0
|
| 101 |
+
|
| 102 |
+
## Citation
|
| 103 |
+
|
| 104 |
+
```bibtex
|
| 105 |
+
@software{ai_code_review,
|
| 106 |
+
title = {AI Code Review Model},
|
| 107 |
+
author = {IQ2i Team},
|
| 108 |
+
year = {2025},
|
| 109 |
+
url = {https://github.com/iq2i/ai-code-review}
|
| 110 |
+
}
|
| 111 |
+
```
|