SecureLLM is a cybersecurity focused language model framework built using public vulnerability, exploit, malware, and threat intelligence sources. The project combines domain adaptation and retrieval augmented generation (RAG) to support cybersecurity question answering and intelligence analysis.
This repository contains the code used to reproduce the SecureLLM data ingestion, corpus construction, training, retrieval, and benchmarking pipeline. Public datasets must be obtained separately from their original sources.
The framework consists of:
- Data ingestion and normalization
- Unified cybersecurity corpus construction
- Domain adaptation of Qwen2.5 1.5B Instruct
- FAISS based retrieval augmentation
- Automated benchmark evaluation
├── benchmark/
│ ├── Benchmark evaluation scripts
│
├── corpus/
│ ├── Benchmark prompt datasets
│
├── ingest/
│ ├── Data collection and preprocessing scripts
│
├── rag/
│ ├── Chunking, indexing, retrieval, and inference scripts
│
├── training/
│ ├── Domain adaptation training scripts
│
└── requirements.txt
Generated artifacts such as corpus files, FAISS indexes, benchmark outputs, logs, and model checkpoints are intentionally excluded from this repository and can be regenerated using the provided pipeline.
The SecureLLM corpus was constructed from the following public cybersecurity resources:
-
National Vulnerability Database (NVD)
-
CISA Known Exploited Vulnerabilities (KEV)
-
ExploitDB
-
MalwareBazaar
Some datasets used by SecureLLM are not redistributed through this repository.
Before running the ingestion pipeline:
- Download the ExploitDB repository and update the local paths in
exploitdb_crawler_r2.py. - Download the MalwareBazaar CSV export (
full.csv.zip) and update the local path inmalwareb_batch.py.
NVD and CISA KEV data are collected directly through their public APIs.
python ingest/nvd_crawler_r2.py
python ingest/cisa_kev_ingest_r2.py
python ingest/exploitdb_crawler_r2.py
python ingest/malwareb_batch.pyBuild the unified corpus
python ingest/securellm_v1_corpus.pyOutput:
corpus/securellm_v1_corpus.jsonl
Build document chunks
python rag/build_securellm_chunks_v1.pyBuild the FAISS index
python rag/build_securellm_faiss_v1.pyOutputs
index/securellm_chunks.pkl
index/securellm_index.faiss
Train the domain adapted model
python training/train_securellm_domain_v1.pyThe model is based on
Qwen/Qwen2.5-1.5B-Instruct
Standard inference
python rag/inference_securellm_v1.pyRAG enabled inference
python rag/inference_securellm_rag_v1.pyNon RAG Benchmarking
python benchmark/benchmark_securellm_nonRag_v1.pyRAG Benchmark
python benchmark/benchmark_securellm_rag_v1.pyPrompt file:
corpus/benchmark_1000prompts.txt
The SecureLLM model weights are not included in this repository. Update the model path variables in the benchmark and inference scripts to point to a local model directory or a separately hosted model release.
The repository contains the complete data processing, retrieval, training, and benchmarking pipeline used to reproduce the SecureLLM framework.
If you use SecureLLM in academic work, please cite:
Redhouse, S. (2026)., Alsmadi, I. SecureLLM: A Retrieval Augmented Framework for Cybersecurity Intelligence Analysis.