Text Generation
Safetensors
English
code
unsloth
qwen2
cybersecurity
vulnerability-detection
cve
code-audit
code-repair
qwen2.5-coder
fine-sec
conversational
Instructions to use elsiddik/finsec_detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use elsiddik/finsec_detector 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 elsiddik/finsec_detector 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 elsiddik/finsec_detector to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for elsiddik/finsec_detector to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="elsiddik/finsec_detector", max_seq_length=2048, )
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,38 +16,38 @@ language:
|
|
| 16 |
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
-
#
|
| 20 |
|
| 21 |
**FineSec-Detector** is a 7B parameter specialized cybersecurity Large Language Model fine-tuned on high-precision CVE vulnerability reports, real-world exploit benchmarks, and secure code repair patterns using **Unsloth 4-bit QLoRA**.
|
| 22 |
|
| 23 |
-
The model acts as an automated Senior Application Security (AppSec) Auditor
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
-
Evaluating **FineSec-Detector** on multi-language vulnerability benchmarks (
|
| 30 |
|
| 31 |
| Metric | Score | Rating | Analysis |
|
| 32 |
|---|---|---|---|
|
| 33 |
-
|
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
|
| 37 |
---
|
| 38 |
|
| 39 |
-
##
|
| 40 |
|
| 41 |
-
-
|
| 42 |
-
-
|
| 43 |
-
-
|
| 44 |
-
-
|
| 45 |
|
| 46 |
---
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
| 50 |
-
### 1. Using Unsloth (
|
| 51 |
|
| 52 |
```python
|
| 53 |
from unsloth import FastLanguageModel
|
|
@@ -85,7 +85,7 @@ print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_toke
|
|
| 85 |
|
| 86 |
---
|
| 87 |
|
| 88 |
-
##
|
| 89 |
|
| 90 |
```json
|
| 91 |
{
|
|
@@ -102,20 +102,20 @@ print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_toke
|
|
| 102 |
|
| 103 |
---
|
| 104 |
|
| 105 |
-
##
|
| 106 |
|
| 107 |
| Attribute | Details |
|
| 108 |
|---|---|
|
| 109 |
-
|
|
| 110 |
-
|
|
| 111 |
-
|
|
| 112 |
-
|
|
| 113 |
-
|
|
| 114 |
-
|
|
| 115 |
-
|
|
| 116 |
|
| 117 |
---
|
| 118 |
|
| 119 |
-
##
|
| 120 |
|
| 121 |
-
|
|
|
|
| 16 |
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# FineSec-Detector: Specialized Security LLM (Qwen2.5-Coder-7B-Instruct)
|
| 20 |
|
| 21 |
**FineSec-Detector** is a 7B parameter specialized cybersecurity Large Language Model fine-tuned on high-precision CVE vulnerability reports, real-world exploit benchmarks, and secure code repair patterns using **Unsloth 4-bit QLoRA**.
|
| 22 |
|
| 23 |
+
The model acts as an automated Senior Application Security (AppSec) Auditor. It audits source code, identifies vulnerabilities, classifies severity and CWE IDs, and produces ready-to-merge secure code patches in structured JSON.
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
+
## Verified Benchmark Performance
|
| 28 |
|
| 29 |
+
Evaluating **FineSec-Detector** on multi-language vulnerability benchmarks (SQL Injection, RCE, XSS, Path Traversal, Insecure Deserialization, Buffer Overflows) yielded the following performance metrics:
|
| 30 |
|
| 31 |
| Metric | Score | Rating | Analysis |
|
| 32 |
|---|---|---|---|
|
| 33 |
+
| Precision Rate | 100.0% | Perfect | Zero false positives. Safe code is never misflagged. |
|
| 34 |
+
| Detection Recall | 83.3% | High | High-confidence detection across Python, C, JS, and Go. |
|
| 35 |
+
| F1 Rating Score | 90.9% | Outstanding | Superior overall vulnerability detection balance. |
|
| 36 |
|
| 37 |
---
|
| 38 |
|
| 39 |
+
## Key Features
|
| 40 |
|
| 41 |
+
- Automated Vulnerability Detection: Audits Python, C/C++, JavaScript, Go, PHP, Java, and Bash source code.
|
| 42 |
+
- Structured JSON Output: Produces standardized security reports suitable for CI/CD pipeline integration.
|
| 43 |
+
- CWE and Severity Classification: Classifies bugs into standard CWE categories (e.g., CWE-89 SQLi, CWE-79 XSS, CWE-78 RCE, CWE-120 Buffer Overflow) with CVSS-aligned severity levels (CRITICAL, HIGH, MEDIUM, LOW).
|
| 44 |
+
- Remediation and Patching: Generates diffs and secure code refactors directly replacing vulnerable logic.
|
| 45 |
|
| 46 |
---
|
| 47 |
|
| 48 |
+
## Quickstart: Inference
|
| 49 |
|
| 50 |
+
### 1. Using Unsloth (Fast and Memory Efficient)
|
| 51 |
|
| 52 |
```python
|
| 53 |
from unsloth import FastLanguageModel
|
|
|
|
| 85 |
|
| 86 |
---
|
| 87 |
|
| 88 |
+
## Sample Output (Structured JSON)
|
| 89 |
|
| 90 |
```json
|
| 91 |
{
|
|
|
|
| 102 |
|
| 103 |
---
|
| 104 |
|
| 105 |
+
## Model Details
|
| 106 |
|
| 107 |
| Attribute | Details |
|
| 108 |
|---|---|
|
| 109 |
+
| Base Architecture | Qwen2.5-Coder-7B-Instruct |
|
| 110 |
+
| Fine-Tuning Method | QLoRA 4-bit (Unsloth) |
|
| 111 |
+
| LoRA Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
|
| 112 |
+
| LoRA Rank (r) | 16 |
|
| 113 |
+
| LoRA Alpha | 32 |
|
| 114 |
+
| Context Window | 1024 tokens |
|
| 115 |
+
| License | Apache-2.0 |
|
| 116 |
|
| 117 |
---
|
| 118 |
|
| 119 |
+
## Intended Use and Disclaimer
|
| 120 |
|
| 121 |
+
FineSec-Detector is designed for defensive security purposes, code auditing, secure code development, and AppSec integration. Users are responsible for exercising due diligence when integrating model output into production systems.
|