attacklm 0.8.4__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. {attacklm-0.8.4 → attacklm-0.9.0}/CHANGELOG.md +31 -0
  2. {attacklm-0.8.4 → attacklm-0.9.0}/PKG-INFO +305 -80
  3. attacklm-0.9.0/README.md +499 -0
  4. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/presets.py +17 -0
  5. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/screens/train_form.py +86 -4
  6. attacklm-0.9.0/presets/deepspeed/README.md +34 -0
  7. attacklm-0.9.0/presets/deepspeed/zero2_cpu_offload.json +19 -0
  8. attacklm-0.9.0/presets/deepspeed/zero3_cpu_offload.json +27 -0
  9. attacklm-0.9.0/presets/deepspeed/zero3_gpu_only.json +17 -0
  10. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/train_all.py +68 -0
  11. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/train_template.py +318 -2
  12. attacklm-0.9.0/src/attacklm/__version__.py +1 -0
  13. attacklm-0.9.0/tests/test_memory_optimization.py +544 -0
  14. attacklm-0.8.4/README.md +0 -274
  15. attacklm-0.8.4/src/attacklm/__version__.py +0 -1
  16. {attacklm-0.8.4 → attacklm-0.9.0}/.github/workflows/release.yml +0 -0
  17. {attacklm-0.8.4 → attacklm-0.9.0}/.gitignore +0 -0
  18. {attacklm-0.8.4 → attacklm-0.9.0}/ATTRIBUTION.md +0 -0
  19. {attacklm-0.8.4 → attacklm-0.9.0}/CONTRIBUTING.md +0 -0
  20. {attacklm-0.8.4 → attacklm-0.9.0}/EVALUATION.md +0 -0
  21. {attacklm-0.8.4 → attacklm-0.9.0}/LICENSE +0 -0
  22. {attacklm-0.8.4 → attacklm-0.9.0}/MANIFEST.in +0 -0
  23. {attacklm-0.8.4 → attacklm-0.9.0}/Makefile +0 -0
  24. {attacklm-0.8.4 → attacklm-0.9.0}/NOTICE +0 -0
  25. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/README.md +0 -0
  26. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/pyproject.toml +0 -0
  27. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/__init__.py +0 -0
  28. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/app.py +0 -0
  29. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/cli.py +0 -0
  30. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/runner.py +0 -0
  31. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/screens/__init__.py +0 -0
  32. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/screens/command_forms.py +0 -0
  33. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/screens/main_menu.py +0 -0
  34. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/screens/train_live.py +0 -0
  35. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/src/attacklm_gui/widgets/__init__.py +0 -0
  36. {attacklm-0.8.4 → attacklm-0.9.0}/attacklm-gui/tests/test_gui.py +0 -0
  37. {attacklm-0.8.4 → attacklm-0.9.0}/data/ATTRIBUTION.md +0 -0
  38. {attacklm-0.8.4 → attacklm-0.9.0}/data/LEGAL.md +0 -0
  39. {attacklm-0.8.4 → attacklm-0.9.0}/data/REMOVAL.md +0 -0
  40. {attacklm-0.8.4 → attacklm-0.9.0}/data/bench/questions.jsonl +0 -0
  41. {attacklm-0.8.4 → attacklm-0.9.0}/data/bench/speed_context.txt +0 -0
  42. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/acquisition_report.json +0 -0
  43. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/manifest.json +0 -0
  44. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/README.md +0 -0
  45. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/_index.json +0 -0
  46. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/LICENSE.md +0 -0
  47. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/SOURCE.md +0 -0
  48. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/base/collection/data.jsonl +0 -0
  49. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/base/discovery/data.jsonl +0 -0
  50. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/base/execution/data.jsonl +0 -0
  51. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/base/exfiltration/data.jsonl +0 -0
  52. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/atomic-red-team/base/persistence/data.jsonl +0 -0
  53. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/attacklm-synthetic/LICENSE.md +0 -0
  54. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/attacklm-synthetic/SOURCE.md +0 -0
  55. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/attacklm-synthetic/orchestrator/data.jsonl +0 -0
  56. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/azure-pyrit/LICENSE.md +0 -0
  57. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/azure-pyrit/SOURCE.md +0 -0
  58. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/cyberark-fuzzyai/LICENSE.md +0 -0
  59. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/cyberark-fuzzyai/SOURCE.md +0 -0
  60. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/elastic-rules/LICENSE.md +0 -0
  61. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/elastic-rules/SOURCE.md +0 -0
  62. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/elastic-rules/defensive/detection_engineering/data.jsonl +0 -0
  63. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/LICENSE.md +0 -0
  64. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/SOURCE.md +0 -0
  65. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/cloud/attacks/data_llm.jsonl +0 -0
  66. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/ics/attacks/data_llm.jsonl +0 -0
  67. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/social_engineering/phishing/data_llm.jsonl +0 -0
  68. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/llm-generated/wireless/attacks/data_llm.jsonl +0 -0
  69. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/LICENSE.md +0 -0
  70. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/SOURCE.md +0 -0
  71. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/collection/data.jsonl +0 -0
  72. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/credential_access/data.jsonl +0 -0
  73. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/defense_evasion/data.jsonl +0 -0
  74. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/discovery/data.jsonl +0 -0
  75. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/execution/data.jsonl +0 -0
  76. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/lateral_movement/data.jsonl +0 -0
  77. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/persistence/data.jsonl +0 -0
  78. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/base/privilege_escalation/data.jsonl +0 -0
  79. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/metasploit-framework/tools/metasploit/data.jsonl +0 -0
  80. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-atlas-arsenal/LICENSE.md +0 -0
  81. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-atlas-arsenal/SOURCE.md +0 -0
  82. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-atlas-arsenal/base/discovery/data.jsonl +0 -0
  83. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/LICENSE.md +0 -0
  84. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/SOURCE.md +0 -0
  85. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/base/collection/data.jsonl +0 -0
  86. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/base/discovery/data.jsonl +0 -0
  87. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/base/execution/data.jsonl +0 -0
  88. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/base/exfiltration/data.jsonl +0 -0
  89. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mitre-stockpile/base/persistence/data.jsonl +0 -0
  90. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mordor/LICENSE.md +0 -0
  91. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mordor/SOURCE.md +0 -0
  92. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/mordor/defensive/threat_hunting/data.jsonl +0 -0
  93. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nist-ir/LICENSE.md +0 -0
  94. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nist-ir/SOURCE.md +0 -0
  95. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nist-ir/defensive/incident_response/data.jsonl +0 -0
  96. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nvidia-garak/LICENSE.md +0 -0
  97. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nvidia-garak/SOURCE.md +0 -0
  98. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/nvidia-garak/ai/jailbreaking/data.jsonl +0 -0
  99. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptfoo/LICENSE.md +0 -0
  100. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptfoo/SOURCE.md +0 -0
  101. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptfoo/ai/prompt-injection/data.jsonl +0 -0
  102. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptmap/LICENSE.md +0 -0
  103. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptmap/SOURCE.md +0 -0
  104. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/promptmap/ai/prompt-injection/data.jsonl +0 -0
  105. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/LICENSE.md +0 -0
  106. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/SOURCE.md +0 -0
  107. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/base/replay/data_code.jsonl +0 -0
  108. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/base/replay/data_conversation.jsonl +0 -0
  109. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/base/replay/data_factual.jsonl +0 -0
  110. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/replay-general/base/replay/data_reasoning.jsonl +0 -0
  111. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/sigma-hq/LICENSE.md +0 -0
  112. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/sigma-hq/SOURCE.md +0 -0
  113. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/sigma-hq/defensive/detection_engineering/data.jsonl +0 -0
  114. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/splunk-content/LICENSE.md +0 -0
  115. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/splunk-content/SOURCE.md +0 -0
  116. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/splunk-content/defensive/detection_engineering/data.jsonl +0 -0
  117. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/threathunter-playbook/LICENSE.md +0 -0
  118. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/threathunter-playbook/SOURCE.md +0 -0
  119. {attacklm-0.8.4 → attacklm-0.9.0}/data/datasets/buckets/sources/threathunter-playbook/defensive/threat_hunting/data.jsonl +0 -0
  120. {attacklm-0.8.4 → attacklm-0.9.0}/data/golden/prompts.jsonl +0 -0
  121. {attacklm-0.8.4 → attacklm-0.9.0}/data/reference/prompts.jsonl +0 -0
  122. {attacklm-0.8.4 → attacklm-0.9.0}/data/steering/prompts/opsec_aware.txt +0 -0
  123. {attacklm-0.8.4 → attacklm-0.9.0}/data/steering/prompts/opsec_unaware.txt +0 -0
  124. {attacklm-0.8.4 → attacklm-0.9.0}/data/steering/prompts/succinct.txt +0 -0
  125. {attacklm-0.8.4 → attacklm-0.9.0}/data/steering/prompts/verbose.txt +0 -0
  126. {attacklm-0.8.4 → attacklm-0.9.0}/experiments/README.md +0 -0
  127. {attacklm-0.8.4 → attacklm-0.9.0}/experiments/synthetic_dataset_mutator_evol_instruct.py +0 -0
  128. {attacklm-0.8.4 → attacklm-0.9.0}/hf/.gitattributes +0 -0
  129. {attacklm-0.8.4 → attacklm-0.9.0}/hf/README.md +0 -0
  130. {attacklm-0.8.4 → attacklm-0.9.0}/hf/data/manifest.json +0 -0
  131. {attacklm-0.8.4 → attacklm-0.9.0}/hf/dataset_infos.json +0 -0
  132. {attacklm-0.8.4 → attacklm-0.9.0}/hf/scripts/build_hf_dataset.py +0 -0
  133. {attacklm-0.8.4 → attacklm-0.9.0}/hf/scripts/push_to_hf.py +0 -0
  134. {attacklm-0.8.4 → attacklm-0.9.0}/hpo_runs/.gitkeep +0 -0
  135. {attacklm-0.8.4 → attacklm-0.9.0}/hpo_runs/hpo_state.json +0 -0
  136. {attacklm-0.8.4 → attacklm-0.9.0}/hpo_runs/hpo_trial_dataset.jsonl +0 -0
  137. {attacklm-0.8.4 → attacklm-0.9.0}/logs/.gitkeep +0 -0
  138. {attacklm-0.8.4 → attacklm-0.9.0}/pipeline.example.yaml +0 -0
  139. {attacklm-0.8.4 → attacklm-0.9.0}/presets/blue-team.json +0 -0
  140. {attacklm-0.8.4 → attacklm-0.9.0}/presets/purple-team.json +0 -0
  141. {attacklm-0.8.4 → attacklm-0.9.0}/presets/red-team.json +0 -0
  142. {attacklm-0.8.4 → attacklm-0.9.0}/pyproject.toml +0 -0
  143. {attacklm-0.8.4 → attacklm-0.9.0}/requirements.txt +0 -0
  144. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/_eval_loader.py +0 -0
  145. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_cloud_attack_dataset.py +0 -0
  146. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_ics_dataset.py +0 -0
  147. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_phishing_dataset.py +0 -0
  148. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_red_team_tactics.py +0 -0
  149. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_replay_general.py +0 -0
  150. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_supply_chain_dataset.py +0 -0
  151. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_web_attack_dataset.py +0 -0
  152. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/acquire_wireless_dataset.py +0 -0
  153. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/audit_dataset.py +0 -0
  154. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/balance_buckets.py +0 -0
  155. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/bucket_loader.py +0 -0
  156. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/build.py +0 -0
  157. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/clone_repos.sh +0 -0
  158. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/collect_reference.py +0 -0
  159. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/compare_scores.py +0 -0
  160. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/convert_to_gguf.py +0 -0
  161. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/demo.py +0 -0
  162. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/device_utils.py +0 -0
  163. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/domain_bench.py +0 -0
  164. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/eval_retention.py +0 -0
  165. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/evolve_pairs.py +0 -0
  166. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/evolved_mixer.py +0 -0
  167. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_ai_tools_to_jsonl.py +0 -0
  168. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_atomic_red_team_to_jsonl.py +0 -0
  169. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_by_tactic.py +0 -0
  170. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_caldera_plugins_to_jsonl.py +0 -0
  171. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_elastic_rules.py +0 -0
  172. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_infection_monkey_to_jsonl.py +0 -0
  173. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_mordor.py +0 -0
  174. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_nist_ir.py +0 -0
  175. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_rta_to_jsonl.py +0 -0
  176. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_sigma_defensive.py +0 -0
  177. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_splunk_content.py +0 -0
  178. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/extract_threathunter_playbook.py +0 -0
  179. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/filter_evolved.py +0 -0
  180. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/generate_synthetic_scarce.py +0 -0
  181. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/golden_vectors.py +0 -0
  182. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/hpo_runner.py +0 -0
  183. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/import_gguf.sh +0 -0
  184. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/import_to_lmstudio.sh +0 -0
  185. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/infer.py +0 -0
  186. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/init_pipeline.py +0 -0
  187. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/merge_adapter.py +0 -0
  188. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/mitre_tactic_lookup.py +0 -0
  189. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/package_dataset.py +0 -0
  190. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/parse_metasploit_to_jsonl.py +0 -0
  191. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/pipeline.py +0 -0
  192. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/rebuild_manifest.py +0 -0
  193. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/register_ollama.py +0 -0
  194. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/reorganize_buckets.py +0 -0
  195. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/replay_mixer.py +0 -0
  196. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/score_candidates.py +0 -0
  197. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/setup_buckets.py +0 -0
  198. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/speed_bench.py +0 -0
  199. {attacklm-0.8.4 → attacklm-0.9.0}/scripts/steering.py +0 -0
  200. {attacklm-0.8.4 → attacklm-0.9.0}/src/attacklm/__init__.py +0 -0
  201. {attacklm-0.8.4 → attacklm-0.9.0}/src/attacklm/_project_root.py +0 -0
  202. {attacklm-0.8.4 → attacklm-0.9.0}/src/attacklm/cli.py +0 -0
  203. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_balance_buckets.py +0 -0
  204. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_collect_reference.py +0 -0
  205. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_compare_scores.py +0 -0
  206. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_domain_bench.py +0 -0
  207. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_eval_loader.py +0 -0
  208. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_eval_retention.py +0 -0
  209. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_evolve_pairs.py +0 -0
  210. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_golden_vectors.py +0 -0
  211. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_init_pipeline.py +0 -0
  212. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_replay_mixer.py +0 -0
  213. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_score_candidates.py +0 -0
  214. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_speed_bench.py +0 -0
  215. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_steering.py +0 -0
  216. {attacklm-0.8.4 → attacklm-0.9.0}/tests/test_thinking_models.py +0 -0
  217. {attacklm-0.8.4 → attacklm-0.9.0}/uv.lock +0 -0
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0] — 2026-07-01 — Memory optimization: DeepSpeed, torch.compile, LOMO
4
+
5
+ ### Added
6
+ - **DeepSpeed ZeRO integration**: Train models 3-5x larger than GPU VRAM using system RAM
7
+ - `--use-deepspeed` flag with auto-generated ZeRO-3 + CPU offload config
8
+ - `--deepspeed-stage {1,2,3}` for ZeRO stage selection
9
+ - `--deepspeed-config` for custom JSON configs
10
+ - `--no-deepspeed-offload` for GPU-only ZeRO
11
+ - Pre-built config templates in `presets/deepspeed/` (zero3_cpu_offload, zero3_gpu_only, zero2_cpu_offload)
12
+ - **torch.compile**: `--compile` flag for 20-40% training speedup and 10-20% memory reduction
13
+ - `--compile-mode {default,reduce-overhead,max-autotune}` for tuning
14
+ - **LOMO optimizer**: `--use-lomo` for full-parameter fine-tuning of 7B models on 8GB GPUs
15
+ - **GUI updated**: Hardware tab now exposes DeepSpeed, torch.compile, and LOMO controls
16
+ - **train_all.py**: All new flags forwarded for multi-bucket training
17
+
18
+ ### Changed
19
+ - **Tagline updated**: Now lists DeepSpeed alongside QLoRA, GaLore, Q-GaLore, Spectrum, PiSSA
20
+ - **README**: Added DeepSpeed configuration section with hardware reference table, new workflows, and CLI flag documentation
21
+
22
+ ---
23
+
24
+ ## [0.8.5] — 2026-07-01 — Comprehensive CLI documentation
25
+
26
+ ### Changed
27
+ - **CLI Reference completely rewritten**: Every command now has its own subsection with all flags documented, defaults listed, and practical examples
28
+ - **Usage section overhauled**: Replaced flat list with 4 end-to-end workflows (Quick Start, Maximum Quality, HPO→Deploy, Evolve→Train)
29
+ - **Training Methods Explained**: New table comparing QLoRA, GaLore, Q-GaLore, Spectrum, and PiSSA by VRAM usage and use case
30
+ - **README grew from 274 to 443 lines** with 24 sections and 36 code examples
31
+
32
+ ---
33
+
3
34
  ## [0.8.4] — 2026-07-01 — Documentation overhaul
4
35
 
5
36
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: attacklm
3
- Version: 0.8.4
3
+ Version: 0.9.0
4
4
  Summary: QLoRA-fine-tuned Qwen2.5-Coder for offensive/defensive security and AI red-teaming
5
5
  Project-URL: Homepage, https://github.com/Veedubin/AttackLM
6
6
  Project-URL: Repository, https://github.com/Veedubin/AttackLM
@@ -203,7 +203,7 @@ Description-Content-Type: text/markdown
203
203
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
204
204
  [![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](#)
205
205
 
206
- **A high-performance fine-tuning pipeline (QLoRA, GaLore, Q-GaLore, Spectrum, PiSSA) for creating MITRE ATT&CK-grounded security AI assistants.**
206
+ **A high-performance fine-tuning pipeline (QLoRA, GaLore, Q-GaLore, Spectrum, PiSSA, DeepSpeed) for creating MITRE ATT&CK-grounded security AI assistants.**
207
207
 
208
208
  ---
209
209
 
@@ -295,6 +295,11 @@ By default, AttackLM leverages PyTorch's built-in `torch.backends.cuda.enable_me
295
295
  | **Multi-turn** | Decomposes Q&A into interactive conversations | Improved conversational flow and context |
296
296
  | **CoT Injection** | Adds explicit "Chain-of-Thought" reasoning steps | Higher logical consistency in complex tasks |
297
297
 
298
+ - **Memory Optimization**: Three new techniques to train larger models on consumer hardware:
299
+ - **DeepSpeed ZeRO-3 + CPU Offload** — Shards parameters, gradients, and optimizer states across GPU VRAM + system RAM. Train 40B+ parameter models on a 16GB GPU with 64GB system RAM.
300
+ - **torch.compile** — PyTorch 2.x JIT compilation. 20-40% training speedup with 10-20% memory reduction. One flag: `--compile`.
301
+ - **LOMO Optimizer** — Full-parameter fine-tuning (not just adapters) of 7B models on 8GB GPUs.
302
+
298
303
  - **Zero-Config Setup**: One-shot `init` command that handles dataset retrieval, extraction, and bucket organization.
299
304
  - **Anti-Bias Balancing**: Integrated balancing engine to ensure the model learns diverse tactics rather than just the most voluminous sources.
300
305
  - **Provenance Tracking**: Strict per-source attribution and license tracking for every record in the dataset.
@@ -310,97 +315,93 @@ By default, AttackLM leverages PyTorch's built-in `torch.backends.cuda.enable_me
310
315
 
311
316
  ---
312
317
 
313
- ## Usage
318
+ ## Usage & Workflows
319
+
320
+ AttackLM provides a set of curated workflows to take you from raw data to a deployed security model.
314
321
 
315
- ### Dataset Management
316
- `attacklm init`
317
- Initialize the environment. Downloads the pre-built dataset for instant use.
322
+ ### Common Workflows
323
+
324
+ **Workflow 1: Quick Start (5 minutes to training)**
318
325
  ```bash
326
+ # 1. Install the full training stack
327
+ pip install "attacklm[all]"
328
+
329
+ # 2. Initialize the MITRE-grounded dataset
319
330
  attacklm init --yes
320
- ```
321
331
 
322
- `attacklm balance`
323
- Create a balanced training subset to ensure tactical coverage.
324
- ```bash
332
+ # 3. Balance the dataset for your hardware (e.g., 7B model on 16GB VRAM)
325
333
  attacklm balance --profile 7b-16gb --preset red-team
326
- ```
327
334
 
328
- ### Model Training
329
- `attacklm train`
330
- The core training engine. Supports Qwen2.5-Coder 3B and 7B base models.
331
-
332
- **Standard Training**
333
- ```bash
334
- # Train a single model on the entire balanced dataset
335
- attacklm train -- --dataset all --epochs 10 --lora-r 16 --use-galore
335
+ # 4. Launch training on Qwen2.5-Coder
336
+ attacklm train -- --dataset data/datasets/balanced/balanced_7b-16gb.jsonl --epochs 10 --train
336
337
  ```
337
338
 
338
- **Training with Evolved Pairs**
339
- Use the `--evolved-ratio` flag to mix synthetically evolved high-reasoning pairs into your training set.
339
+ **Workflow 2: Maximum Quality (GaLore + Spectrum + Evolved Pairs)**
340
340
  ```bash
341
- # Train with 20% evolved pairs for better reasoning depth
342
- attacklm train -- --dataset all --evolved-ratio 0.2 --epochs 10
341
+ attacklm init --yes
342
+ attacklm balance --profile 7b-16gb
343
+ attacklm train --all -- --single-model --use-galore --spectrum --evolved-ratio 0.2 --epochs 20 --train
343
344
  ```
344
345
 
345
- ### Deployment & Testing
346
- `attacklm build`
347
- Merge LoRA adapters and convert to GGUF for local deployment.
346
+ **Workflow 3: HPO $\rightarrow$ Train $\rightarrow$ Deploy**
348
347
  ```bash
349
- attacklm build -- --adapter models/attacklm-single_TIMESTAMP --name attacklm-security
350
- ```
348
+ # 1. Run Hyper-Parameter Optimization sweep to find best settings
349
+ attacklm train --hpo -- --dataset data/datasets/balanced/balanced_7b-16gb.jsonl
351
350
 
352
- `attacklm infer`
353
- Perform a smoke-test of the trained model against representative security prompts.
354
- ```bash
355
- attacklm infer -- --adapter models/attacklm-single_TIMESTAMP
351
+ # 2. Train with optimized parameters
352
+ attacklm train -- --dataset data/datasets/balanced/balanced_7b-16gb.jsonl --lora-r 64 --lora-alpha 128 --epochs 15 --train
353
+
354
+ # 3. Merge adapter and convert to GGUF for local deployment
355
+ attacklm build -- --adapter models/attacklm_TIMESTAMP --name attacklm-v1
356
356
  ```
357
357
 
358
- ### Terminal GUI
358
+ **Workflow 4: Evolve Pairs $\rightarrow$ Filter $\rightarrow$ Train**
359
+ ```bash
360
+ # 1. Synthetically expand short pairs into complex reasoning examples
361
+ python scripts/evolve_pairs.py --strategy all --source metasploit-framework --count 500
359
362
 
360
- `attacklm gui`
363
+ # 2. Filter evolved pairs for quality
364
+ python scripts/filter_evolved.py --input data/datasets/evolved/ --all
361
365
 
362
- Launch the Textual-based Terminal GUI for an interactive training experience. No memorizing 40+ CLI flags.
366
+ # 3. Train with a high ratio of evolved pairs
367
+ attacklm train --all -- --single-model --evolved-ratio 0.3 --epochs 10 --train
368
+ ```
363
369
 
370
+ **Workflow 5: Train 40B+ on 16GB GPU (DeepSpeed + CPU offload)**
364
371
  ```bash
365
- attacklm gui
372
+ # Workflow 5: Train 40B+ on 16GB GPU (DeepSpeed + CPU offload)
373
+ attacklm init --yes
374
+ attacklm balance --profile 7b-16gb
375
+ attacklm train -- --dataset data/datasets/balanced/balanced_7b-16gb.jsonl \
376
+ --base-model Qwen/Qwen2.5-32B-Instruct \
377
+ --use-deepspeed --deepspeed-stage 3 \
378
+ --compile --epochs 5 --train
366
379
  ```
367
380
 
368
- The GUI provides:
381
+ ### Training Methods Explained
369
382
 
370
- | Screen | What it does |
371
- |--------|-------------|
372
- | **Train** | Tabbed form (Basic, LoRA, GaLore, Advanced, Hardware) with 5 built-in presets |
373
- | **Init** | One-click dataset initialization (download, extract, organize) |
374
- | **Balance** | Build balanced training subsets with configurable caps |
375
- | **Inference** | Smoke-test trained models against security prompts |
376
- | **Build** | Merge adapter → GGUF conversion → install to LM Studio/Ollama |
377
- | **Eval** | Retention evaluation, reference collection, scoring, comparison |
383
+ Choose your training method based on your available VRAM and quality requirements:
378
384
 
379
- **Live Training Monitor** Once training starts, you get a real-time dashboard:
385
+ | Method | Description | VRAM | Best For |
386
+ | :--- | :--- | :--- | :--- |
387
+ | **QLoRA** | 4-bit quantized base + LoRA adapters. Only trains small adapter matrices. | Lowest (~8GB for 3B) | Quick experiments, limited VRAM |
388
+ | **GaLore** | Full-parameter training with gradient low-rank projection. | Medium (~16GB for 3B) | Best quality on consumer GPUs |
389
+ | **Q-GaLore** | GaLore with quantization. Balances quality and VRAM. | Medium-Low | High quality on 16GB GPUs |
390
+ | **Spectrum** | SNR-based layer freezing. Freezes low-SNR layers, trains high-SNR. | Medium | Reduces VRAM, speeds training |
391
+ | **PiSSA** | Principal Singular Values initialization for LoRA. | Same as QLoRA | Better convergence than standard LoRA |
392
+ | **DeepSpeed ZeRO-3** | Shards model across GPU + CPU RAM. Offloads params and optimizer to system memory. | Lowest (model 3-5x VRAM) | Training 40B+ on 16GB GPU |
393
+ | **torch.compile** | PyTorch 2.x JIT compilation. Fuses operations for speed + memory. | 10-20% less than baseline | Any model, free performance |
394
+ | **LOMO** | Fuses gradient computation + parameter update. Never materializes full gradient. | Lowest (7B full-param on 8GB) | Full-parameter quality on tiny GPUs |
380
395
 
381
- ```
382
- ┌─────────────────────────────────────────────────────┐
383
- │ Training: attacklm-3b-qgalore-spectrum │
384
- │ Epoch 12/30 | Step 1896 | Elapsed: 1h 23m │
385
- ├──────────────────────┬──────────────────────────────┤
386
- │ Loss: 1.1143 ▂▃▅▆▇ │ VRAM: 5.9/15.6 GB (62%) │
387
- │ Eval Loss: 1.176 │ alloc: 5.9 cache: 4.8 │
388
- │ Trend: ↓ -0.0116 │ ████████░░░░ │
389
- ├──────────────────────┴──────────────────────────────┤
390
- │ [P]ause [S]top at checkpoint [Q]uit │
391
- └─────────────────────────────────────────────────────┘
392
- ```
396
+ ### Terminal GUI
397
+
398
+ For an interactive experience, use `attacklm gui`. This eliminates the need to memorize dozens of CLI flags and provides a real-time training dashboard with VRAM gauges and loss sparklines.
393
399
 
394
- **Built-in Presets:**
395
- - `3B Q-GaLore Spectrum` — Full-parameter training on 16GB GPU
396
- - `3B Q-GaLore Rank 128` — Higher quality variant
397
- - `3B LoRA Default` — Standard QLoRA
398
- - `7B Q-GaLore` — For 24GB GPUs
399
- - `7B QLoRA Default` — Standard QLoRA for 7B
400
+ ```bash
401
+ attacklm gui
402
+ ```
403
+ ---
400
404
 
401
- ### Other Tools
402
- - `attacklm eval`: Run the retention evaluation suite and score candidate models.
403
- - `attacklm demo`: Run the multi-agent orchestrator demo.
404
405
 
405
406
  ---
406
407
 
@@ -445,19 +446,243 @@ This hierarchy ensures that the pipeline can be rebuilt from upstream sources wi
445
446
 
446
447
  ## CLI Reference
447
448
 
448
- | Command | Description |
449
- | :--- | :--- |
450
- | `attacklm train` | Train a model (QLoRA, GaLore, Q-GaLore, Spectrum, PiSSA) |
451
- | `attacklm train --dataset all` | Train all buckets combined |
452
- | `attacklm train --evolved-ratio 0.2` | Mix evolved reasoning pairs into training |
453
- | `attacklm train --hpo` | Run Hyper-Parameter Optimization sweep |
454
- | `attacklm init` | Initialize dataset: download pre-built or clone $\rightarrow$ extract $\rightarrow$ attribute |
455
- | `attacklm balance` | Build a balanced subset of buckets to prevent overfitting |
456
- | `attacklm build` | Merge adapter $\rightarrow$ GGUF conversion $\rightarrow$ LM Studio/Ollama register |
457
- | `attacklm infer` | Smoke-test inference on trained adapters |
458
- | `attacklm eval` | Run retention evaluation and regression gates |
459
- | `attacklm gui` | Launch Terminal GUI (TUI) for all operations |
460
- | `attacklm demo` | Run multi-agent orchestrator demo |
449
+ AttackLM uses a tiered command structure. Top-level flags are handled by the dispatcher, while flags following the `--` separator are forwarded directly to the specialized training or inference scripts.
450
+
451
+ ### 1. `attacklm train` Core Training Engine
452
+ The primary entry point for fine-tuning. Supports a variety of parameter-efficient and full-parameter methods.
453
+
454
+ **Dispatcher Flags**
455
+ - `--all` Train all buckets (multi-model or single-model combined)
456
+ - `--hpo` Run hyperparameter optimization sweep instead of standard training
457
+
458
+ **Forwarded Arguments (Post-`--`)**
459
+ - `--dataset <path>` Path to JSONL dataset or `all` for all buckets
460
+ - `--base-model <model>` HuggingFace model ID (default: `Qwen/Qwen2.5-Coder-3B-Instruct`)
461
+ - `--output <dir>` Output directory for trained model
462
+ - `--epochs <n>` — Number of training epochs (default: 3)
463
+ - `--batch-size <n>` — Per-device batch size (default: 1)
464
+ - `--max-length <n>` — Maximum sequence length in tokens (default: 1024)
465
+ - `--lora-r <n>` — LoRA rank (default: 16)
466
+ - `--lora-alpha <n>` — LoRA alpha scaling (default: 32)
467
+ - `--lora-dropout <n>` — LoRA dropout rate (default: 0.05)
468
+ - `--use-galore` — Enable GaLore full-parameter training
469
+ - `--use-qgalore` — Enable Q-GaLore (quantized GaLore)
470
+ - `--spectrum` — Enable Spectrum layer freezing (SNR-based)
471
+ - `--use-pissa` — Enable PiSSA initialization
472
+ - `--packing` — Enable example packing for throughput
473
+ - `--train` — Execute training (omitting this performs a dry-run with stats)
474
+ - `--eval-split <n>` — Fraction held out for eval (default: 0.1)
475
+ - `--early-stop-steps <n>` — Early stopping patience in eval steps
476
+ - `--save-steps <n>` — Save checkpoint every N steps
477
+ - `--gradient-accumulation-steps <n>` — Gradient accumulation steps
478
+ - `--evolved-ratio <n>` — Fraction of training pairs from evolved datasets (0.0-1.0)
479
+ - `--evolved-dir <path>` — Directory containing evolved JSONL files
480
+ - `--replay-ratio <n>` — Fraction of replay (anti-forgetting) examples
481
+ - `--replay-source <path>` — Path to replay source directory
482
+ - `--single-model` — Combine all buckets into one training set
483
+ - `--include-orchestrator` — Include orchestrator bucket
484
+ - `--model-attacks` — Include AI model attack buckets
485
+ - `--include-tools` — Include tool buckets
486
+ - `--moe-safe-target` — Disable 4-bit quantization for MoE models
487
+ - `--multi-gpu` — Enable multi-GPU training
488
+ - `--use-unsloth` — Use Unsloth for faster training
489
+ - `--resume-from-checkpoint` — Resume from last checkpoint
490
+ - `--force` — Force re-tokenization (ignore cache)
491
+ - `--dry-run` — Print what would run without executing
492
+ - `--use-deepspeed` — Enable DeepSpeed ZeRO optimization
493
+ - `--deepspeed-stage {1,2,3}` — ZeRO stage (default: 3)
494
+ - `--deepspeed-config <path>` — Path to custom DeepSpeed JSON config
495
+ - `--no-deepspeed-offload` — Disable CPU offload (GPU-only ZeRO)
496
+ - `--compile` — Enable torch.compile (20-40% speedup)
497
+ - `--compile-mode {default,reduce-overhead,max-autotune}` — torch.compile mode (default: reduce-overhead)
498
+ - `--use-lomo` — Enable LOMO full-parameter optimizer
499
+
500
+ **Examples**
501
+ ```bash
502
+ # Single dataset, QLoRA
503
+ attacklm train -- --dataset data/balanced.jsonl --epochs 10 --train
504
+
505
+ # All buckets, GaLore + Spectrum, single model
506
+ attacklm train --all -- --single-model --use-galore --spectrum --epochs 20 --train
507
+
508
+ # With 20% evolved pairs
509
+ attacklm train --all -- --single-model --evolved-ratio 0.2 --epochs 10 --train
510
+
511
+ # HPO sweep
512
+ attacklm train --hpo -- --analyze-only
513
+
514
+ # Dry-run stats only
515
+ attacklm train -- --dataset data/balanced.jsonl
516
+ ```
517
+
518
+ ### DeepSpeed Configuration
519
+
520
+ AttackLM ships with pre-built DeepSpeed configs in `presets/deepspeed/`:
521
+
522
+ | Config | ZeRO Stage | CPU Offload | Best For |
523
+ |--------|-----------|-------------|----------|
524
+ | `zero3_cpu_offload.json` | 3 | Params + Optimizer | Single GPU, model > VRAM |
525
+ | `zero3_gpu_only.json` | 3 | None | Multi-GPU setups |
526
+ | `zero2_cpu_offload.json` | 2 | Optimizer only | Faster, model ~2x VRAM |
527
+
528
+ Auto-generate a config (defaults to ZeRO-3 + CPU offload):
529
+ ```bash
530
+ attacklm train -- --use-deepspeed --dataset data/balanced.jsonl --train
531
+ ```
532
+
533
+ Use a custom config:
534
+ ```bash
535
+ attacklm train -- --use-deepspeed --deepspeed-config presets/deepspeed/zero2_cpu_offload.json --train
536
+ ```
537
+
538
+ ### Hardware Reference
539
+
540
+ | GPU VRAM | System RAM | Recommended Config | Max Model |
541
+ |----------|-----------|-------------------|-----------|
542
+ | 8 GB | 32 GB | ZeRO-2 + CPU offload | ~13B |
543
+ | 16 GB | 64 GB | ZeRO-3 + CPU offload | ~40B |
544
+ | 24 GB | 64 GB | ZeRO-3 + CPU offload | ~70B |
545
+ | 24 GB | 128 GB | ZeRO-3 + CPU offload | ~70B+ |
546
+ ```
547
+
548
+ ---
549
+
550
+ ### 2. `attacklm init` — Dataset Initialization
551
+ Handles the retrieval and organization of the security corpus.
552
+
553
+ **Flags**
554
+ - `--yes` — Skip confirmation prompts
555
+ - `--from-source` — Build from upstream git repos instead of downloading pre-built tarball
556
+ - `--dataset-url <url>` — Override download URL
557
+ - `--extract-only` — Run data extractors only
558
+ - `--buckets-only` — Organize data into buckets only
559
+ - `--attribute-only` — Add source/license attribution only
560
+ - `--clone-only` — Clone upstream repos only
561
+
562
+ **Examples**
563
+ ```bash
564
+ # Default: download pre-built dataset
565
+ attacklm init --yes
566
+
567
+ # Build from source (clone repos, extract, attribute, bucket)
568
+ attacklm init --from-source
569
+
570
+ # Re-extract only (after updating extractors)
571
+ attacklm init --extract-only
572
+ ```
573
+
574
+ ---
575
+
576
+ ### 3. `attacklm balance` — Subset Generation
577
+ Builds balanced training subsets to prevent overfitting to high-volume sources.
578
+
579
+ **Flags**
580
+ - `--profile <name>` — Hardware profile (`3b-16gb`, `7b-16gb`, `7b-24gb`, `7b-128gb`, `custom`)
581
+ - `--preset <name>` — Team preset (`red-team`, `blue-team`, `purple-team`)
582
+ - `--target-total <n>` — Target total pairs (for `custom` profile)
583
+ - `--strategy <name>` — Sampling strategy (`head` for highest quality first, `random`)
584
+ - `--dry-run` — Preview balancing without writing files
585
+
586
+ **Examples**
587
+ ```bash
588
+ # Red-team preset for 7B on 16GB
589
+ attacklm balance --profile 7b-16gb --preset red-team
590
+
591
+ # Custom: 12,000 pairs, head strategy
592
+ attacklm balance --profile custom --target-total 12000 --strategy head
593
+
594
+ # Preview without writing
595
+ attacklm balance --profile 7b-16gb --dry-run
596
+ ```
597
+
598
+ ---
599
+
600
+ ### 4. `attacklm build` — Model Deployment
601
+ Pipeline to merge adapters and export for local LLM runtimes.
602
+
603
+ **Flags**
604
+ - `--merge-only` — Merge LoRA adapter into base model only
605
+ - `--gguf-only` — Convert to GGUF format only
606
+ - `--register-ollama` — Register with local Ollama instance
607
+ - `--adapter <path>` — Path to trained adapter directory
608
+ - `--name <name>` — Output model name
609
+ - `--quant <type>` — Quantization: `q4_k_m`, `q5_k_m`, `q8_0`, `f16`
610
+
611
+ **Examples**
612
+ ```bash
613
+ # Full build pipeline: Merge $\rightarrow$ GGUF $\rightarrow$ Ollama
614
+ attacklm build -- --adapter models/attacklm-single_TIMESTAMP --name attacklm-security
615
+
616
+ # Merge only
617
+ attacklm build --merge-only -- --adapter models/attacklm-single_TIMESTAMP
618
+
619
+ # GGUF only
620
+ attacklm build --gguf-only -- --adapter models/attacklm-single_TIMESTAMP --quant q4_k_m
621
+ ```
622
+
623
+ ---
624
+
625
+ ### 5. `attacklm infer` — Inference & Smoke Testing
626
+ Test trained models against representative security prompts.
627
+
628
+ **Flags**
629
+ - `--adapter <path>` — Path to trained adapter
630
+ - `--base-model <model>` — Base model (default: `Qwen2.5-Coder-3B`)
631
+ - `--prompt <text>` — Single prompt to test
632
+ - `--prompts-file <path>` — JSONL file of prompts
633
+ - `--max-new-tokens <n>` — Max tokens to generate
634
+ - `--temperature <n>` — Sampling temperature
635
+
636
+ **Examples**
637
+ ```bash
638
+ # Single prompt
639
+ attacklm infer -- --adapter models/attacklm-single_TIMESTAMP --prompt "How do I perform T1059.001?"
640
+
641
+ # Batch from file
642
+ attacklm infer -- --adapter models/attacklm-single_TIMESTAMP --prompts-file prompts.jsonl
643
+ ```
644
+
645
+ ---
646
+
647
+ ### 6. `attacklm eval` — Evaluation Suite
648
+ Run retention evaluation and regression gates.
649
+
650
+ **Flags**
651
+ - `--collect-ref` — Generate reference continuations from base model
652
+ - `--score` — Score candidate models against references
653
+ - `--compare` — Compare two score TSV files
654
+ - `--golden` — Golden vector generation/validation
655
+ - `--adapter <path>` — Path to trained adapter
656
+ - `--base-model <model>` — Base model for reference collection
657
+
658
+ **Examples**
659
+ ```bash
660
+ # Full retention evaluation
661
+ attacklm eval -- --adapter models/attacklm-single_TIMESTAMP
662
+
663
+ # Collect reference outputs
664
+ attacklm eval --collect-ref -- --base-model Qwen/Qwen2.5-Coder-3B-Instruct
665
+
666
+ # Score a candidate
667
+ attacklm eval --score -- --adapter models/attacklm-single_TIMESTAMP
668
+ ```
669
+
670
+ ---
671
+
672
+ ### 7. `attacklm gui` — Terminal Interface
673
+ Launch the professional Textual-based TUI. Requires `pip install attacklm-gui`.
674
+
675
+ ```bash
676
+ attacklm gui
677
+ ```
678
+
679
+ ### 8. `attacklm demo` — Orchestrator Demo
680
+ Run a demonstration of the AttackLM multi-agent orchestrator.
681
+
682
+ ```bash
683
+ attacklm demo
684
+ ```
685
+
461
686
 
462
687
  ---
463
688