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.
Instructions to use akashps/Qwen3-4B-CyberSec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akashps/Qwen3-4B-CyberSec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akashps/Qwen3-4B-CyberSec")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("akashps/Qwen3-4B-CyberSec", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use akashps/Qwen3-4B-CyberSec 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 akashps/Qwen3-4B-CyberSec:Q4_K_M # Run inference directly in the terminal: llama cli -hf akashps/Qwen3-4B-CyberSec:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf akashps/Qwen3-4B-CyberSec:Q4_K_M # Run inference directly in the terminal: llama cli -hf akashps/Qwen3-4B-CyberSec: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 akashps/Qwen3-4B-CyberSec:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf akashps/Qwen3-4B-CyberSec:Q4_K_M
Use Docker
docker model run hf.co/akashps/Qwen3-4B-CyberSec:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use akashps/Qwen3-4B-CyberSec with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akashps/Qwen3-4B-CyberSec" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akashps/Qwen3-4B-CyberSec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/akashps/Qwen3-4B-CyberSec:Q4_K_M
- SGLang
How to use akashps/Qwen3-4B-CyberSec with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "akashps/Qwen3-4B-CyberSec" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akashps/Qwen3-4B-CyberSec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "akashps/Qwen3-4B-CyberSec" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akashps/Qwen3-4B-CyberSec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use akashps/Qwen3-4B-CyberSec with Ollama:
ollama run hf.co/akashps/Qwen3-4B-CyberSec:Q4_K_M
- Unsloth Desktop
- Pi
How to use akashps/Qwen3-4B-CyberSec with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf akashps/Qwen3-4B-CyberSec: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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "akashps/Qwen3-4B-CyberSec:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use akashps/Qwen3-4B-CyberSec with Docker Model Runner:
docker model run hf.co/akashps/Qwen3-4B-CyberSec:Q4_K_M
- Lemonade
How to use akashps/Qwen3-4B-CyberSec with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull akashps/Qwen3-4B-CyberSec:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-CyberSec-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use akashps/Qwen3-4B-CyberSec with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf akashps/Qwen3-4B-CyberSec: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:9931/v1 hermes config set model.default akashps/Qwen3-4B-CyberSec:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use akashps/Qwen3-4B-CyberSec with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf akashps/Qwen3-4B-CyberSec: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:9931/v1 \ --custom-model-id "akashps/Qwen3-4B-CyberSec: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"
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf akashps/Qwen3-4B-CyberSec:Q4_K_M# Run inference directly in the terminal:
llama cli -hf akashps/Qwen3-4B-CyberSec:Q4_K_MBuild 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 akashps/Qwen3-4B-CyberSec:Q4_K_M# Run inference directly in the terminal:
./build/bin/llama cli -hf akashps/Qwen3-4B-CyberSec:Q4_K_MUse Docker
docker model run hf.co/akashps/Qwen3-4B-CyberSec:Q4_K_MQwen3-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 atQwen3-4B.Q4_K_M.gguf, soollama create cyber4b -f Modelfileworks with a plainhf download akashps/Qwen3-4B-CyberSec Modelfile Qwen3-4B.Q4_K_M.gguf. TheModelfile.Q8_0/Modelfile.BF16variants 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 16is baked into the Modelfile โ measured 2ร faster (1.37 โ 2.80 tok/s) than the default thread count on this CPU.- Pass
"think": falseto/api/chat|/api/generateto skip Qwen3 reasoning traces (~2โ3ร lower latency).PARAMETER think falseis not a valid Modelfile key (rejected atollama 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
systemmessage 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
4-bit
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf akashps/Qwen3-4B-CyberSec:Q4_K_M# Run inference directly in the terminal: llama cli -hf akashps/Qwen3-4B-CyberSec:Q4_K_M