Instructions to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct") model = AutoModelForCausalLM.from_pretrained("Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct
- SGLang
How to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct 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 "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct" \ --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": "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct", "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 "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct" \ --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": "Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct 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 Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct 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 Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct", max_seq_length=2048, ) - Docker Model Runner
How to use Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct with Docker Model Runner:
docker model run hf.co/Mohamedabul/Qwen2.5-3B-CyberSecurity-Instruct
Qwen2.5-3B-CyberSec-Instruct
A fine-tuned version of Qwen2.5-3B-Instruct specifically designed for advanced cybersecurity analysis. This model is built to bridge the gap between high-level vulnerability descriptions and low-level exploit code execution.
- Developed by: Mohamedabul
- License: apache-2.0
- Finetuned from model: unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit
- Architecture: 3B parameters (4-bit QLoRA)
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Model Capabilities
This LLM acts as an expert cybersecurity analyst and reverse engineer. It is capable of:
- Vulnerability Triage: Automatically generating structured severity, attack vector, and mitigation reports for any CVE.
- Exploit Reverse-Engineering: Analyzing raw exploit code (C, Python, Bash) to provide an immediate technical breakdown of how the exploit works and what vulnerabilities it targets.
- Attack Chain Reasoning: Combining a CVE with raw exploit code to generate a step-by-step kill-chain analysis, from initial access to system compromise.
Training Data
To achieve maximum accuracy, the model was fine-tuned on an expansive historical corpus of modern vulnerabilities and exploits, completely uncapped and unfiltered:
- NVD CVE Database: Vulnerabilities published between 2020 through 2025.
- Exploit-DB: Over 45,000+ real-world exploits directly from Offensive Security.
- MITRE CWE: Full weakness classifications, likelihood of exploit, and abstractions.
- Total Dataset Size: ~187,700 structured instruction samples.
Evaluation Metrics
The fine-tuned model was evaluated against an unseen hold-out test dataset to mathematically verify its understanding of cybersecurity concepts and generation quality.
| Metric | Score | Interpretation |
|---|---|---|
| Perplexity | 7.61 | Excellent. Reflects high confidence and deep vocabulary retention for security concepts. |
| METEOR | 0.4084 | Very Good. The model captures semantic meaning effectively, correctly utilizing security synonyms. |
| ROUGE-1 | 0.3496 | High structural and unigram overlap with security researcher standards. |
| ROUGE-L | 0.2044 | Consistent sentence-level alignment for technical vulnerability reports. |
Usage & Inference
To load the model quickly using Unsloth for 2x faster inference:
from unsloth import FastLanguageModel
# Load the model directly from this Hugging Face repository
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="Mohamedabul/Qwen2.5-3B-CyberSec-Instruct", # or your exact repo name
max_seq_length=1024,
dtype=None,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
# Example Prompt
instruction = "Analyze this vulnerability: CVE-2021-44228 (Log4Shell). Provide attack vectors, severity, and mitigation."
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": instruction}], tokenize=False, add_generation_prompt=True
)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, use_cache=True)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0])
- Downloads last month
- 53