A QLoRA fine-tune of Qwen2.5-Coder-7B on 29,588 exploit and security samples.
ZeroSec-7B is a specialist language model trained exclusively on offensive security data:
It's designed to assist with legitimate penetration testing, vulnerability research, and security education.
1# 1. Download the LoRA adapter
2git lfs install
3git clone https://huggingface.co/ezradixon/ZeroSec-7B
4
5# 2. Merge with base model
6python merge_and_export.py
7
8# 3. Quantize for local inference (Mac/CPU)
9llama-quantize merged-model-f16.gguf Q4_K_M zerosect-7b-Q4_K_M.gguf
10
11# 4. Run
12llama-server -m zerosect-7b-Q4_K_M.gguf -ngl 99
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5base_model = "Qwen/Qwen2.5-Coder-7B-Instruct"
6model = AutoModelForCausalLM.from_pretrained(
7 base_model,
8 torch_dtype=torch.float16,
9 device_map="auto",
10 trust_remote_code=True,
11)
12model = PeftModel.from_pretrained(model, "ezradixon/ZeroSec-7B")
13model = model.merge_and_unload()
14
15tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
16
17prompt = "Write a Python script to check for SQL injection in a login form"
18inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
19outputs = model.generate(**inputs, max_new_tokens=512)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The Zero Project and the model's creator are not responsible for any misuse.
Built on Modal cloud GPUs. 🇦🇺