初始化项目,由ModelHub XC社区提供模型
Model: Euraika/VulnLLM-R-7B-GGUF Source: Original Platform
This commit is contained in:
37
.gitattributes
vendored
Normal file
37
.gitattributes
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
VulnLLM-R-7B-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
VulnLLM-R-7B-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
132
README.md
Normal file
132
README.md
Normal file
@@ -0,0 +1,132 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
base_model: Virtue-AI-HUB/VulnLLM-R-7B
|
||||
base_model_relation: quantized
|
||||
library_name: gguf
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- gguf
|
||||
- llama.cpp
|
||||
- ollama
|
||||
- quantized
|
||||
- security
|
||||
- vulnerability-detection
|
||||
- reasoning
|
||||
- qwen2
|
||||
language:
|
||||
- en
|
||||
---
|
||||
|
||||
# VulnLLM-R-7B — GGUF
|
||||
|
||||
GGUF conversions of [**Virtue-AI-HUB/VulnLLM-R-7B**](https://huggingface.co/Virtue-AI-HUB/VulnLLM-R-7B),
|
||||
a **reasoning** model for software **vulnerability detection**, fine-tuned from
|
||||
[Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct).
|
||||
Paper: [arXiv:2512.07533](https://arxiv.org/abs/2512.07533).
|
||||
|
||||
These files run the model locally with [`llama.cpp`](https://github.com/ggerganov/llama.cpp),
|
||||
[Ollama](https://ollama.com), [LM Studio](https://lmstudio.ai), and any GGUF runtime.
|
||||
|
||||
## Files
|
||||
|
||||
| File | Quant | Size | Notes |
|
||||
|------|-------|------|-------|
|
||||
| `VulnLLM-R-7B-f16.gguf` | F16 | ~15 GB | Full-precision GGUF; best quality, largest. |
|
||||
| `VulnLLM-R-7B-Q8_0.gguf` | Q8_0 | ~8 GB | 8-bit; near-lossless, recommended for most use. |
|
||||
|
||||
## Model specs
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| Architecture | `qwen2` (Qwen2.5-7B-Instruct base) |
|
||||
| Parameters | ~7.6 B |
|
||||
| **Max context length** | **32,768 tokens (32K)** — native |
|
||||
| Layers | 28 |
|
||||
| Embedding dim | 3584 |
|
||||
| Attention | GQA, 28 Q heads / 4 KV heads |
|
||||
| Chat template | ChatML (embedded in GGUF metadata) |
|
||||
|
||||
**Context notes:** 32K is the native maximum (`max_position_embeddings` / `qwen2.context_length`).
|
||||
This fine-tune ships **no `rope_scaling`**, so there is no supported YaRN path beyond 32K — pushing
|
||||
past it degrades quality. Set your runtime window (`num_ctx` / `-c`) as high as 32768; higher windows
|
||||
cost more KV-cache memory (roughly: 8K ≈ 4 GB, 16K ≈ 7 GB, 32K ≈ 15 GB on top of the ~8 GB Q8_0 weights).
|
||||
|
||||
## ⚠️ This is a reasoning model — use the system prompt
|
||||
|
||||
VulnLLM-R generates a step-by-step **chain-of-thought** (inside a `</think>`-delimited block)
|
||||
before its final answer. If you prompt it with a bare question and **no framing**, it can drift
|
||||
out-of-distribution and produce noisy output. Always give it the analysis framing below — ideally
|
||||
as the **system** message so it triggers reliably.
|
||||
|
||||
**Recommended system prompt:**
|
||||
|
||||
```
|
||||
You are an advanced vulnerability detection model. Analyze the following code
|
||||
step-by-step to determine whether it contains a security vulnerability. Reason
|
||||
about data flow, control flow, and security context, then give a final answer
|
||||
that names the vulnerability, its CWE, and how to fix it. If the code is safe, say so.
|
||||
```
|
||||
|
||||
Then send the code snippet as the user message.
|
||||
|
||||
**Suggested sampling:** `temperature 0.3`, `top_p 0.8` (deterministic-leaning analysis).
|
||||
|
||||
## Usage
|
||||
|
||||
### Ollama
|
||||
|
||||
```bash
|
||||
# Pull directly from this repo (Q8_0):
|
||||
ollama pull hf.co/Euraika/VulnLLM-R-7B-GGUF:Q8_0
|
||||
|
||||
# Recommended: bake in the system prompt, sampling, and full 32K context via a Modelfile:
|
||||
cat > Modelfile <<'MF'
|
||||
FROM hf.co/Euraika/VulnLLM-R-7B-GGUF:Q8_0
|
||||
SYSTEM """You are an advanced vulnerability detection model. Analyze the following code step-by-step to determine whether it contains a security vulnerability. Reason about data flow, control flow, and security context, then give a final answer that names the vulnerability, its CWE, and how to fix it. If the code is safe, say so."""
|
||||
PARAMETER temperature 0.3
|
||||
PARAMETER top_p 0.8
|
||||
PARAMETER num_ctx 32768
|
||||
MF
|
||||
ollama create vulnllm-r-7b -f Modelfile
|
||||
ollama run vulnllm-r-7b "<paste code here>"
|
||||
```
|
||||
|
||||
### llama.cpp
|
||||
|
||||
```bash
|
||||
llama-cli -hf Euraika/VulnLLM-R-7B-GGUF:Q8_0 --temp 0.3 --top-p 0.8 -c 32768 \
|
||||
-sys "You are an advanced vulnerability detection model. Analyze the code step-by-step, reason about data/control flow and security context, then give a final answer with the vulnerability, its CWE, and a fix." \
|
||||
-p "<paste code here>"
|
||||
```
|
||||
|
||||
### Chat format (ChatML)
|
||||
|
||||
```
|
||||
<|im_start|>system
|
||||
{system}<|im_end|>
|
||||
<|im_start|>user
|
||||
{code}<|im_end|>
|
||||
<|im_start|>assistant
|
||||
```
|
||||
|
||||
## Conversion
|
||||
|
||||
Converted from the original `safetensors` weights to GGUF and quantized to Q8_0.
|
||||
The F16 GGUF is the intermediate full-precision conversion; Q8_0 is quantized from it.
|
||||
|
||||
## License & attribution
|
||||
|
||||
Released under **Apache-2.0**, inherited from the base model
|
||||
[Virtue-AI-HUB/VulnLLM-R-7B](https://huggingface.co/Virtue-AI-HUB/VulnLLM-R-7B)
|
||||
(derived from Qwen2.5-7B-Instruct, Apache-2.0). All credit for the model belongs to
|
||||
the original authors; this repository only provides GGUF conversions. Please cite the
|
||||
[paper](https://arxiv.org/abs/2512.07533) and follow the upstream terms.
|
||||
|
||||
```bibtex
|
||||
@article{nie2025vulnllmr,
|
||||
title={VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detection},
|
||||
author={Nie, Yuzhou and Li, Hongwei and Guo, Chengquan and Jiang, Ruizhe and Wang, Zhun and Li, Bo and Song, Dawn and Guo, Wenbo},
|
||||
journal={arXiv preprint arXiv:2512.07533},
|
||||
year={2025}
|
||||
}
|
||||
```
|
||||
3
VulnLLM-R-7B-Q8_0.gguf
Normal file
3
VulnLLM-R-7B-Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f01cba28d4741057b6b497744f988bf4fd1b09158e18836d31388387e6c0de44
|
||||
size 8099131840
|
||||
3
VulnLLM-R-7B-f16.gguf
Normal file
3
VulnLLM-R-7B-f16.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c2fcdb2a81840be39bf8c2118fe0b45e6c9997069cc488ff84b9f8ca43009fbe
|
||||
size 15238459840
|
||||
Reference in New Issue
Block a user