GGUF
English
code
security
python
ollama
llama-cpp
cybersecurity
secure-coding
quantized
conversational
Instructions to use ivitopow/SecuCoder-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ivitopow/SecuCoder-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ivitopow/SecuCoder-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ivitopow/SecuCoder-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ivitopow/SecuCoder-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ivitopow/SecuCoder-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Use Docker
docker model run hf.co/ivitopow/SecuCoder-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use ivitopow/SecuCoder-GGUF with Ollama:
ollama run hf.co/ivitopow/SecuCoder-GGUF:Q4_K_M
- Unsloth Studio
How to use ivitopow/SecuCoder-GGUF 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 ivitopow/SecuCoder-GGUF 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 ivitopow/SecuCoder-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ivitopow/SecuCoder-GGUF to start chatting
- Pi
How to use ivitopow/SecuCoder-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ivitopow/SecuCoder-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ivitopow/SecuCoder-GGUF with Docker Model Runner:
docker model run hf.co/ivitopow/SecuCoder-GGUF:Q4_K_M
- Lemonade
How to use ivitopow/SecuCoder-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ivitopow/SecuCoder-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.SecuCoder-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ivitopow/SecuCoder-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ivitopow/SecuCoder-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ivitopow/SecuCoder-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ivitopow/SecuCoder-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ivitopow/SecuCoder-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- Modelfile +7 -0
- README.md +116 -0
- secucoder-q4_k_m.gguf +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
secucoder-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
Modelfile
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM secucoder-q4_k_m.gguf
|
| 2 |
+
|
| 3 |
+
PARAMETER temperature 0.1
|
| 4 |
+
PARAMETER top_p 0.9
|
| 5 |
+
PARAMETER num_ctx 4096
|
| 6 |
+
|
| 7 |
+
SYSTEM """You are a secure Python assistant. Help identify, explain, and fix security issues in Python code. Prefer safe, practical, and production-ready solutions."""
|
README.md
CHANGED
|
@@ -1,3 +1,119 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: ivitopow/secucoder
|
| 6 |
+
tags:
|
| 7 |
+
- code
|
| 8 |
+
- security
|
| 9 |
+
- python
|
| 10 |
+
- gguf
|
| 11 |
+
- ollama
|
| 12 |
+
- llama-cpp
|
| 13 |
+
- cybersecurity
|
| 14 |
+
- secure-coding
|
| 15 |
+
- quantized
|
| 16 |
+
task_categories:
|
| 17 |
+
- text-generation
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
# SecuCoder — GGUF
|
| 21 |
+
|
| 22 |
+
Quantized GGUF version of [SecuCoder](https://huggingface.co/ivitopow/secucoder), a fine-tuned Llama 3.1 8B Instruct model for secure Python code generation and vulnerability remediation.
|
| 23 |
+
|
| 24 |
+
For full model details, training methodology, and evaluation results, see the [main model card](https://huggingface.co/ivitopow/secucoder).
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## Available Files
|
| 29 |
+
|
| 30 |
+
| File | Quantization | Size | Use case |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| `secucoder-Q4_K_M.gguf` | Q4_K_M | ~4.6 GB | Recommended — best balance of quality and size |
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Usage with Ollama
|
| 37 |
+
|
| 38 |
+
**1. Download the Modelfile from this repo and create the model:**
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
ollama create secucoder -f Modelfile
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
**2. Run it:**
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
ollama run secucoder
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**3. Or via API:**
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
curl http://localhost:11434/api/generate -d '{
|
| 54 |
+
"model": "secucoder",
|
| 55 |
+
"prompt": "Fix the security vulnerability in this Python code.\n\n```python\nname = request.args.get(\"name\")\nresp = make_response(\"Your name is \" + name)\n```\n\nCWE: CWE-079",
|
| 56 |
+
"stream": false
|
| 57 |
+
}'
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## Usage with llama.cpp
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
./llama-cli \
|
| 66 |
+
-m secucoder-Q4_K_M.gguf \
|
| 67 |
+
--ctx-size 4096 \
|
| 68 |
+
--temp 0.1 \
|
| 69 |
+
--top-p 0.9 \
|
| 70 |
+
-p "You are a secure Python assistant. Fix the vulnerability in this code: ..."
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## Recommended Parameters
|
| 76 |
+
|
| 77 |
+
| Parameter | Value |
|
| 78 |
+
|---|---|
|
| 79 |
+
| `temperature` | 0.1 |
|
| 80 |
+
| `top_p` | 0.9 |
|
| 81 |
+
| `num_ctx` | 4096 |
|
| 82 |
+
| `num_predict` | 3072 |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## System Prompt
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
You are a secure Python assistant. Help identify, explain, and fix security issues in Python code. Prefer safe, practical, and production-ready solutions.
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## Evaluation
|
| 95 |
+
|
| 96 |
+
The full SecuCoder system (Q4 + structured prompting + RAG) achieves an overall score of **77.11** vs **60.34** for the untuned Llama 3.1 8B baseline — a **+27.8% improvement** measured by weighted static analysis findings (Bandit + Semgrep).
|
| 97 |
+
|
| 98 |
+
| Variant | Overall Score |
|
| 99 |
+
|---|---|
|
| 100 |
+
| Llama 3.1 8B Instruct (baseline) | 60.34 |
|
| 101 |
+
| SecuCoder Q4 (this model) | 61.46 |
|
| 102 |
+
| SecuCoder Q4 + structured prompt | 64.46 |
|
| 103 |
+
| SecuCoder Q4 + structured prompt + RAG | **77.11** |
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## Related
|
| 108 |
+
|
| 109 |
+
| Resource | Link |
|
| 110 |
+
|---|---|
|
| 111 |
+
| Full model (safetensors) | [ivitopow/secucoder](https://huggingface.co/ivitopow/secucoder) |
|
| 112 |
+
| Training dataset | [ivitopow/secucoder](https://huggingface.co/datasets/ivitopow/secucoder) |
|
| 113 |
+
| Base model | [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) |
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## License
|
| 118 |
+
|
| 119 |
+
Released under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/). Built on Llama 3.1, subject to [Meta's Llama 3 Community License](https://llama.meta.com/llama3/license/).
|
secucoder-q4_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6762a5a2a0294e7c683dfc61119147857c37dc9777bda7d0b605b33156f6b0f1
|
| 3 |
+
size 4920738976
|