Run this model with HF Jobs

Run akashps/Qwen3-4B-CyberSec on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/akashps/Qwen3-4B-CyberSec. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/akashps/Qwen3-4B-CyberSec on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/akashps/Qwen3-4B-CyberSec. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/akashps/Qwen3-4B-CyberSec. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Qwen3-4B-CyberSec

Security-focused reasoning fine-tune of Qwen3-4B for cybersecurity / ethical-hacking agents, sized to run smoothly on a 12 GB machine.

LoRA fine-tune (r=32) of Qwen/Qwen3-4B on ~57M tokens (73,547 samples) of security SFT data, then merged and quantized to three GGUF variants: Q4_K_M (2.33 GiB, speed), Q8_0 (4.0 GiB, quality/speed balance), and BF16 (7.5 GiB, reference quality) โ€” load any of them in Ollama or llama.cpp.

Every variant carries the same authorized-practitioner SYSTEM prompt with a hard boundary: ransomware/encryptor/wipers are refused in 1โ€“2 sentences with a defensive redirect; every other security question is answered directly.

Results

Metric Value
SecQA v2 test accuracy (100 held-out MCQs) 98.0 % (98/100)
Final training loss (1 epoch) 0.7387
Mean token accuracy (final) 82.6 %
Training tokens 45.6 M
Wall-clock (1ร— RTX 5090) 2 h 09 m

Scope (in / out)

In scope: vulnerability analysis, authorized exploit & PoC discussion, pentest methodology, recon & bug-hunting, phishing simulation for authorized campaigns, ransomware defense (detection / YARA / incident response), browser automation, defensive security reasoning. Out of scope: ransomware generation, mass-targeting or unauthorized attack automation.

"Low over-refusal on security topics" โ€” it answers authorized-practitioner security questions directly (scanning, exploits, payloads-as-examples, phishing simulation, AV-evasion testing, priv-esc, reverse shells). The one hard rule: ransomware/encryptor/wiper generation is refused briefly and redirected to defense. It is not a malware factory.

Files

File Purpose Published?
Qwen3-4B.Q4_K_M.gguf Q4_K_M โ€” fastest on CPU (2.33 GiB) yes
Modelfile Ollama Modelfile for the Q4_K_M build โ€” chat template + uncensored SYSTEM (boundary-first) yes
Modelfile.Q4_K_M Same Modelfile, named explicitly (FROM Qwen3-4B.Q4_K_M.gguf) yes
Modelfile.Q8_0 For the Q8_0 build (FROM Qwen3-4B.Q8_0.gguf) โ€” use once that gguf is uploaded yes (modelfile only)
Modelfile.BF16 For the BF16 build (FROM Qwen3-4B.BF16.gguf) โ€” use once that gguf is uploaded yes (modelfile only)
Qwen3-4B.Q8_0.gguf Q8_0 โ€” near-lossless vs source (4.0 GiB) not yet uploaded
Qwen3-4B.BF16.gguf BF16 โ€” reference precision (7.5 GiB) not yet uploaded
ADAPTER-NOT-PUBLISHED.txt Why there is no LoRA adapter here yes
README.md This model card yes

The Q4_K_M gguf is the only weight file in this repo. Modelfile (the default) points at Qwen3-4B.Q4_K_M.gguf, so ollama create cyber4b -f Modelfile works with a plain hf download akashps/Qwen3-4B-CyberSec Modelfile Qwen3-4B.Q4_K_M.gguf. The Modelfile.Q8_0 / Modelfile.BF16 variants are there for when those weights are added.

Measured performance (Intel Core 7 240H, 16 threads, CPU-only, think:false)

Tag tok/s (decode) Load Notes
cyber4b:latest (Q4_K_M) 3.25 ~7 s daily driver
cyber4b:q80 (Q8_0) 2.91 ~9 s quality pick
cyber4b:bf16 (BF16) 2.01 ~14 s reference
  • PARAMETER num_thread 16 is baked into the Modelfile โ€” measured 2ร— faster (1.37 โ†’ 2.80 tok/s) than the default thread count on this CPU.
  • Pass "think": false to /api/chat|/api/generate to skip Qwen3 reasoning traces (~2โ€“3ร— lower latency). PARAMETER think false is not a valid Modelfile key (rejected at ollama create).

Note: the raw LoRA adapter (r=32) was not published โ€” the GGUF above is the distribution artifact. Training produced it on a rented GPU whose container storage did not survive the session; the quantized model itself is complete and verified.

SHA-256:

dc7dd2bf8729ae7436afaed099719dafe31bcc035face51dcdfc5514154c8be  Qwen3-4B.Q4_K_M.gguf
36e6bcb200616db2337dcf0bb08661fdac951cea4a3df3afddbffef2e96c18b7  Modelfile
36e6bcb200616db2337dcf0bb08661fdac951cea4a3df3afddbffef2e96c18b7  Modelfile.Q4_K_M
72eeb29a2eb2e2e93e73d0266c1963fe43cda3d2001e1dfc7484791f0f13bce5  Modelfile.Q8_0
cd5858fcc7cb6e6b176e938db66c523f028585c860da05eada092aa112988dd3  Modelfile.BF16

Quick start

Ollama

# repo id is `akashps/Qwen3-4B-CyberSec` (not akashps3693)
hf download akashps/Qwen3-4B-CyberSec Modelfile Qwen3-4B.Q4_K_M.gguf --local-dir .
ollama create cyber4b -f Modelfile
ollama run cyber4b "Walk me through an authorized SQL injection assessment of a login form."

If you already have the gguf and only need the Modelfile, it is one plain-text file โ€” download Modelfile from the repo page, save it next to your .gguf, and run ollama create cyber4b -f Modelfile. The FROM line must name the gguf file that is actually sitting next to it.

Served tags (this machine): cyber4b:latest (Q4), cyber4b:q80, cyber4b:bf16.

HTTP API (OpenAI-compatible)

curl http://<host>:11434/v1/chat/completions -H 'Content-Type: application/json' \
  -d '{"model":"cyber4b:q80","think":false,"messages":[{"role":"user","content":"scan the ip"}]}'

llama.cpp

llama-cli -m Qwen3-4B.Q4_K_M.gguf -c 8192 --chat-template-file <(python3 - <<'PY'
from transformers import AutoTokenizer
print(AutoTokenizer.from_pretrained("Qwen/Qwen3-4B").chat_template)
PY
)

Training

  • Method: LoRA via unsloth (r=32, lora_alpha=32, target q/k/v/o/gate/up/down)
  • Base: Qwen/Qwen3-4B (Apache-2.0), bf16, seq 2048
  • Optimization: 1 epoch, batch 6 ร— grad-accum 4 (effective 24), AdamW-8bit, cosine 2e-4, warmup 30, seed 42, 3,065 steps, checkpoints every 350
  • Data mix: cyberstrike-sft-120k (25k), cybersecdata (15k), cybersec-master-dataset (20k), oi-uae/cyber-security (13.5k) โ€” every dataset's system message rewritten to a single authorized-practitioner persona
  • Stack: unsloth 2026.11.13, trl 1.15.0, transformers 5.17.0, torch 2.11.0+cu128
  • Hardware: 1ร— NVIDIA RTX 5090 (Race Engineering), 2 h 09 m

License & data caveats

  • Model weights: Apache-2.0 (inherits Qwen3-4B).
  • oi-uae/cyber-security (โ‰ˆ18 % of the mix) carries a research-only, non-commercial dataset license โ€” do not use this model for commercial purposes unless that dataset component is removed/re-licensed by its owner.
  • Intended for authorized security work, education, and defensive research only.
Downloads last month
569
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for akashps/Qwen3-4B-CyberSec

Finetuned
Qwen/Qwen3-4B
Adapter
(1,312)
this model