AttackLM
AttackLM — QLoRA fine-tuning pipeline for a MITRE ATT&CK-grounded security AI assistant. 24,652 training pairs · Qwen2.5-Coder base · 16GB+ VRAM.
GUI (New in v0.7.1)
AttackLM now includes a terminal-based GUI for all commands. No more memorizing 40+ CLI flags.
pip install attacklm-gui
attacklm-gui
Features:
- Training form with 40+ params in 5 tabs (Basic, LoRA, GaLore, Advanced, Hardware)
- Live training monitor with loss sparkline, VRAM gauge, progress bar, and log viewer
- One-click screens for extract, balance, infer, merge, build, pipeline, and init
- 5 built-in presets (3B Q-GaLore, 3B LoRA, 7B Q-GaLore, 7B QLoRA, etc.)
- Pause/resume/quit controls during training
- Works in terminal-only environments — no X11, no browser, no GPU required. Works over SSH and WSL.
The CLI still works exactly as before. The GUI is a thin wrapper that constructs and runs CLI commands.
Install
The recommended way to install the full CUDA training stack:
pip install attacklm[all]
Alternative: Use uv pip install "attacklm[all]" for faster installation.
Note: flash-attn is optional and not included by default to avoid heavy compilation requirements.
Init
Initialize the dataset by cloning upstream repositories, extracting data, adding attribution, and organizing into buckets:
attacklm-init --yes
Balance (Optional)
Because Metasploit accounts for ~64% of the raw data, balancing is recommended to prevent overfitting and ensure broad tactical coverage.
attacklm-balance --profile 7b-16gb --output data/datasets/balanced/balanced.jsonl
- Presets: Use
--preset red-team,purple-team, orblue-teamto control the offensive/defensive mix. - Profiles: Use profiles like
3b-16gbor7b-16gbto automatically set per-bucket caps based on your VRAM.
Train
Train the model using the orchestrated pipeline. The default base model is Qwen/Qwen2.5-Coder-3B-Instruct.
attacklm-train-all --single-model --dataset all --epochs 5 --max-length 2048
Key Training Flags
| Flag | Default | Description |
|---|---|---|
--single-model |
off | Train one model on all buckets combined |
--dataset |
none | Path to dataset or alias (all, base/, tools/, ai/, orchestrator) |
--epochs |
10 | Total training epochs |
--max-length |
1024 | Max sequence length (use 2048 for richer context) |
--lora-r |
16 | LoRA rank |
--use-galore |
off | Use Q-GaLore for full-parameter training on low VRAM |
--spectrum |
off | SNR-based layer freezing to reduce VRAM |
Multi-round SFT: AttackLM supports iterative training. You can train on tactics first, then tools, then a final general pass. Each round automatically backs up the previous state and uses the merged weights of the prior run as the new base.
Build
Perform a one-shot merge of the LoRA adapter and conversion to GGUF format for local deployment.
attacklm-build --adapter models/attacklm-single_TIMESTAMP --name attacklm
Infer
Smoke-test your trained adapter with a set of representative security prompts.
attacklm-infer --adapter models/attacklm-single_TIMESTAMP
Bucket Reference Table
The dataset is split into buckets to allow for granular control over training composition.
| Bucket | Pairs | Category | Description |
|---|---|---|---|
| base/collection | 634 | MITRE Tactic | TA0009 - Collection techniques |
| base/command_and_control | 0 | MITRE Tactic | TA0011 - C2 techniques (no data yet) |
| base/credential_access | 589 | MITRE Tactic | TA0006 - Credential access |
| base/defense_evasion | 1,375 | MITRE Tactic | TA0005 - Defense evasion |
| base/discovery | 1,846 | MITRE Tactic | TA0007 - Discovery |
| base/execution | 767 | MITRE Tactic | TA0002 - Execution |
| base/exfiltration | 53 | MITRE Tactic | TA0010 - Exfiltration |
| base/lateral_movement | 252 | MITRE Tactic | TA0008 - Lateral movement |
| base/persistence | 1,120 | MITRE Tactic | TA0003 - Persistence |
| base/privilege_escalation | 537 | MITRE Tactic | TA0004 - Privilege escalation |
| tools/metasploit | 8,349 | Tools | Metasploit module knowledge |
| ai/jailbreaking | 50 | AI Security | Jailbreak techniques (garak) |
| ai/prompt-injection | 63 | AI Security | Prompt injection (promptfoo, promptmap) |
| orchestrator | 380 | Meta | Agent routing decisions |
| cloud/attacks | 10 | Extended | Cloud attack techniques |
| ics/attacks | 290 | Extended | ICS/SCADA attacks |
| social_engineering/phishing | 440 | Extended | Phishing techniques |
| wireless/attacks | 197 | Extended | Wireless attacks |
| defensive/detection_engineering | 7,154 | Defensive | Sigma + Elastic + Splunk detection rules |
| defensive/threat_hunting | 366 | Defensive | Mordor + ThreatHunter playbooks |
| defensive/incident_response | 168 | Defensive | NIST SP 800-61r3 IR procedures |
Note: 6 defensive buckets (detection_engineering, threat_hunting, incident_response, plus sigma/elastic/splunk/mordor/threathunter/nist sources) are planned but have 0 records currently.
Data Sources
| Source | Pairs | License |
|---|---|---|
| Metasploit Framework | 13,997 | BSD-3-Clause |
| Atomic Red Team | 1,115 | MIT |
| MITRE Caldera/Stockpile | 390 | Apache-2.0 |
| LLM-generated | 937 | GPL-3.0 |
| NVIDIA Garak / Promptfoo | 113 | Mixed MIT/Apache-2.0 |
| Sigma | 3,132 | DRL-1.1 |
| Elastic | 1,908 | Elastic-2.0 |
| Splunk | 2,114 | Apache-2.0 |
| Mordor | 339 | Apache-2.0 |
| ThreatHunter | 27 | Apache-2.0 |
| NIST IR | 168 | Public Domain |
Architecture
Data is organized in a per-source hierarchy to ensure provenance and attribution.
AttackLM/
├── data/
│ └── datasets/
│ └── buckets/
│ └── sources/
│ └── <source>/
│ └── <bucket>/
│ └── <tactic>/
│ └── data.jsonl
This layout allows the pipeline to deterministically extract data from upstream sources without introducing hallucinations or API dependencies.
CLI Reference
v0.8.0: The 21 hyphenated commands are consolidated into a single
attacklmcommand with subcommands. The old commands still work but print a deprecation warning. They will be removed in v0.9.0.
Unified Command (v0.8.0+)
| Command | Description |
|---|---|
attacklm train |
Train a model (QLoRA, GaLore, Q-GaLore, Spectrum, PiSSA) |
attacklm train --dataset all |
Train all buckets (replaces attacklm-train-all) |
attacklm train --hpo |
Run HPO sweep (replaces attacklm-hpo) |
attacklm init |
One-shot init: clone → extract → attribute → buckets |
attacklm init --extract-only |
Extract data only (replaces attacklm-extract) |
attacklm init --buckets-only |
Organize into buckets only (replaces attacklm-buckets) |
attacklm init --attribute-only |
Add attribution only (replaces attacklm-attribute) |
attacklm init --clone-only |
Clone repos only (replaces attacklm-clone) |
attacklm balance |
Build a balanced subset of buckets |
attacklm build |
One-shot merge → GGUF → install to LM Studio |
attacklm build --merge-only |
Merge adapter only (replaces attacklm-merge) |
attacklm build --gguf-only |
Convert to GGUF only (replaces attacklm-gguf) |
attacklm build --register-ollama |
Register GGUF with Ollama (replaces attacklm-register-ollama) |
attacklm infer |
Smoke-test inference |
attacklm eval |
Run retention evaluation suite |
attacklm eval --collect-ref |
Collect reference model outputs |
attacklm eval --score |
Score candidate models against reference |
attacklm eval --compare |
Compare multiple candidate model scores |
attacklm eval --golden |
Execute golden vector regression gates |
attacklm gui |
Terminal GUI for all commands |
attacklm demo |
Multi-agent orchestrator demo |
Legacy Commands (Deprecated, removed in v0.9.0)
| Old Command | New Command |
|---|---|
attacklm-train |
attacklm train |
attacklm-train-all |
attacklm train --dataset all |
attacklm-train-lora |
attacklm train |
attacklm-hpo |
attacklm train --hpo |
attacklm-init |
attacklm init |
attacklm-extract |
attacklm init --extract-only |
attacklm-buckets |
attacklm init --buckets-only |
attacklm-attribute |
attacklm init --attribute-only |
attacklm-clone |
attacklm init --clone-only |
attacklm-balance |
attacklm balance |
attacklm-build |
attacklm build |
attacklm-merge |
attacklm build --merge-only |
attacklm-gguf |
attacklm build --gguf-only |
attacklm-register-ollama |
attacklm build --register-ollama |
attacklm-infer |
attacklm infer |
attacklm-eval |
attacklm eval |
attacklm-collect-ref |
attacklm eval --collect-ref |
attacklm-score |
attacklm eval --score |
attacklm-compare |
attacklm eval --compare |
attacklm-golden |
attacklm eval --golden |
attacklm-demo |
attacklm demo |
License
The code in this repository is licensed under the MIT License. Training data consists of mixed licenses per source; see ATTRIBUTION.md for the full mapping.
Contributing
See CONTRIBUTING.md for guidelines on contributing to AttackLM.
Changelog
See CHANGELOG.md for the full version history.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file attacklm-0.8.1.tar.gz.
File metadata
- Download URL: attacklm-0.8.1.tar.gz
- Upload date:
- Size: 5.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644ac8a7e42d5d6843af6bae56aca88de06fccb77e3ba47f3a6cdfa80fa7ead9
|
|
| MD5 |
d2c3a409631d4cec582a0f6b76a4b838
|
|
| BLAKE2b-256 |
69032c5efa6b43676276723f312eba01e0b91a6c80d63c29600d9f783e244b8a
|
Provenance
The following attestation bundles were made for attacklm-0.8.1.tar.gz:
Publisher:
release.yml on Veedubin/AttackLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attacklm-0.8.1.tar.gz -
Subject digest:
644ac8a7e42d5d6843af6bae56aca88de06fccb77e3ba47f3a6cdfa80fa7ead9 - Sigstore transparency entry: 2027033805
- Sigstore integration time:
-
Permalink:
Veedubin/AttackLM@06222f2999ce74eebdc89c012b15465ab31dc1fc -
Branch / Tag:
refs/tags/v0.8.1 - Owner: https://github.com/Veedubin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@06222f2999ce74eebdc89c012b15465ab31dc1fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file attacklm-0.8.1-py3-none-any.whl.
File metadata
- Download URL: attacklm-0.8.1-py3-none-any.whl
- Upload date:
- Size: 492.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f05a489b5589bef72fe8334f15560c06b36edbf7067cbb3728f56ff367d4a45
|
|
| MD5 |
d9c6ed7d7d57feb4a8926a8d48e338df
|
|
| BLAKE2b-256 |
04c647fc8f26dad0b39b9e02ba76a8171334f7ffb0dda7c9801993e85a4a31e0
|
Provenance
The following attestation bundles were made for attacklm-0.8.1-py3-none-any.whl:
Publisher:
release.yml on Veedubin/AttackLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attacklm-0.8.1-py3-none-any.whl -
Subject digest:
8f05a489b5589bef72fe8334f15560c06b36edbf7067cbb3728f56ff367d4a45 - Sigstore transparency entry: 2027033911
- Sigstore integration time:
-
Permalink:
Veedubin/AttackLM@06222f2999ce74eebdc89c012b15465ab31dc1fc -
Branch / Tag:
refs/tags/v0.8.1 - Owner: https://github.com/Veedubin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@06222f2999ce74eebdc89c012b15465ab31dc1fc -
Trigger Event:
push
-
Statement type: