Safetensors
GGUF
qwen3
cybersecurity
agentic
red-team
blue-team
distillation
glm-5.2
kimi-k3
function-calling
tool-calling
tool-use
conversational
Instructions to use bebrws/security-8b 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 bebrws/security-8b 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 bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bebrws/security-8b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bebrws/security-8b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf bebrws/security-8b:Q4_K_M
Use Docker
docker model run hf.co/bebrws/security-8b:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use bebrws/security-8b with Ollama:
ollama run hf.co/bebrws/security-8b:Q4_K_M
- Unsloth Desktop
- Pi
How to use bebrws/security-8b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bebrws/security-8b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bebrws/security-8b with Docker Model Runner:
docker model run hf.co/bebrws/security-8b:Q4_K_M
- Lemonade
How to use bebrws/security-8b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bebrws/security-8b:Q4_K_M
Run and chat with the model
lemonade run user.security-8b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bebrws/security-8b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b: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 bebrws/security-8b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bebrws/security-8b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b: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 "bebrws/security-8b: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"
model card for k3-sec-8b-v4 (branch main)
Browse files
README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3-8B
|
| 4 |
+
tags: [cybersecurity, agentic, red-team, blue-team, distillation, glm-5.2, kimi-k3]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# k3-sec-8b (v4)
|
| 8 |
+
|
| 9 |
+
An 8B cybersecurity agent (offense + defense) fine-tuned from `Qwen/Qwen3-8B` on
|
| 10 |
+
**699 verified agentic + Q&A traces**, distilled from GLM-5.2 (round 4) and Kimi K3/K2.6
|
| 11 |
+
(rounds 1–3). Trained to operate an autonomous security harness — plan, run bash, read
|
| 12 |
+
observations, write files, finish — not just answer security questions.
|
| 13 |
+
|
| 14 |
+
Pipeline per iteration: failure analysis on eval traces → parameterized, decontaminated
|
| 15 |
+
seed factory → teacher best-of-3 rejection-sampled agentic transcripts (judged +
|
| 16 |
+
artifact-checked) → full-FT SFT → multi-run attack/defend eval → next round.
|
| 17 |
+
|
| 18 |
+
## Version 4 highlights
|
| 19 |
+
|
| 20 |
+
- **Data**: 699 unique rows (605 agentic harness transcripts + 94 Q&A). Round 4 added
|
| 21 |
+
564 GLM-5.2 traces targeting the five v3 tasks that never passed, generated from 580
|
| 22 |
+
parameterized seeds with decontamination-by-construction (every eval-graded string is
|
| 23 |
+
blacklisted and asserted absent). Best-of-3 rejection with a glm-4.7-flash judge
|
| 24 |
+
(kept 97%). Note: v3's advertised 157 rows contained only 135 unique after legacy
|
| 25 |
+
merge duplicates; v4 is a genuine 5.2× data increase.
|
| 26 |
+
- **Training**: full FT bf16, 2 epochs, lr 1e-5 cosine, eff. batch 32, seq 8192,
|
| 27 |
+
adamw_8bit, 5.37M tokens, ~42 min on 1× A100-80GB. **train_loss 0.977 · token-acc
|
| 28 |
+
80.0%** (v3: 1.395 / 69.1%). Ships with Qwen3 YaRN `rope_scaling` for 131072-token
|
| 29 |
+
serving.
|
| 30 |
+
- **Eval** (fixed 10-task synthetic attack/defend lab, agentic harness, 3 runs):
|
| 31 |
+
**mean 6.67/10** (runs: 9, 6, 5) vs v3 mean 4.0/10 (4 runs). Peak run met the
|
| 32 |
+
promotion gate (≥8/10, both sides ≥4/5) once in three.
|
| 33 |
+
|
| 34 |
+
### Per-task pass rates (P across runs)
|
| 35 |
+
|
| 36 |
+
| Task | v3 (4 runs) | v4 (3 runs) |
|
| 37 |
+
|---|---|---|
|
| 38 |
+
| atk-sqli | 0/4 | 0/3 |
|
| 39 |
+
| atk-hash | 4/4 | 3/3 |
|
| 40 |
+
| atk-re | 3/4 | 2/3 |
|
| 41 |
+
| atk-dns | 0/4 | 1/3 |
|
| 42 |
+
| atk-jwt | 0/4 | **3/3** |
|
| 43 |
+
| def-bruteforce | 3/4 | 3/3 |
|
| 44 |
+
| def-webshell | 2/4 | 2/3 |
|
| 45 |
+
| def-harden | 4/4 | 3/3 |
|
| 46 |
+
| def-detect-dns | 0/4 | 1/3 |
|
| 47 |
+
| def-ioc | 0/4 | 2/3 |
|
| 48 |
+
|
| 49 |
+
Run-to-run variance is significant at temperature 0.7; single-run scores are not
|
| 50 |
+
meaningful for this suite. Known v4 gap: `atk-sqli` — the model prefers to start the
|
| 51 |
+
staged vulnerable app and fuzz it over HTTP instead of reading the offline artifacts
|
| 52 |
+
(trace-verified behavioral prior, targeted in round 5).
|
| 53 |
+
|
| 54 |
+
## Usage
|
| 55 |
+
|
| 56 |
+
vLLM, short-task/eval serving (disable static YaRN):
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
python3 -m vllm.entrypoints.openai.api_server \
|
| 60 |
+
--model bebrws/k3-sec-8b --revision v4 \
|
| 61 |
+
--port 8000 --hf-overrides '{"rope_scaling":null}' --max-model-len 32768
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
Long-context serving: omit `--hf-overrides` and set `--max-model-len 131072`.
|
| 65 |
+
Recommended sampling for agentic loops (non-thinking): `temperature=0.7 top_p=0.8
|
| 66 |
+
top_k=20 min_p=0`, `chat_template_kwargs.enable_thinking=false`, per-step completion
|
| 67 |
+
cap ~4096 tokens.
|
| 68 |
+
|
| 69 |
+
## Intended use & limitations
|
| 70 |
+
|
| 71 |
+
Defensive/offensive **security research artifact**, evaluated on a small synthetic lab.
|
| 72 |
+
Not for: real intrusion activity, exploit weaponization, unsupervised security
|
| 73 |
+
decisions, or non-security tasks. Outputs require qualified human review. Attack-side
|
| 74 |
+
competence is deliberately scoped to CTF/lab-grade tasks.
|
| 75 |
+
|
| 76 |
+
## Version history (8B lineage)
|
| 77 |
+
|
| 78 |
+
| Version | Data | Eval mean | Notes |
|
| 79 |
+
|---|---|---|---|
|
| 80 |
+
| v1 | 135 traces | 4/10 single | first 8B run |
|
| 81 |
+
| v2 | 149 traces | 6/10 single | failure-targeted r2 |
|
| 82 |
+
| v3 | 157 (135 unique) | 4.0/10 (4 runs) | parser-fixed harness baseline |
|
| 83 |
+
| **v4** | **699** | **6.67/10 (3 runs)** | GLM-5.2 scale-up, jwt fixed |
|
| 84 |
+
|
| 85 |
+
Weights are Apache-2.0 per the Qwen3 base; training traces were generated by GLM-5.2
|
| 86 |
+
and Kimi teachers and filtered by automated judging.
|