llm-forge-new 0.1.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 (211) hide show
  1. llm_forge_new-0.1.0/.claude/hooks/safety-check.sh +35 -0
  2. llm_forge_new-0.1.0/.claude/settings.json +26 -0
  3. llm_forge_new-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +54 -0
  4. llm_forge_new-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +42 -0
  5. llm_forge_new-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  6. llm_forge_new-0.1.0/.github/workflows/ci.yml +73 -0
  7. llm_forge_new-0.1.0/.github/workflows/gpu-tests.yml +31 -0
  8. llm_forge_new-0.1.0/.github/workflows/release.yml +58 -0
  9. llm_forge_new-0.1.0/.gitignore +88 -0
  10. llm_forge_new-0.1.0/CHANGELOG.md +54 -0
  11. llm_forge_new-0.1.0/CLAUDE.md +1816 -0
  12. llm_forge_new-0.1.0/CONTRIBUTING.md +55 -0
  13. llm_forge_new-0.1.0/LICENSE +190 -0
  14. llm_forge_new-0.1.0/Makefile +38 -0
  15. llm_forge_new-0.1.0/PKG-INFO +399 -0
  16. llm_forge_new-0.1.0/README.md +285 -0
  17. llm_forge_new-0.1.0/SECURITY_AUDIT_REPORT.md +168 -0
  18. llm_forge_new-0.1.0/configs/benchmark_llama_1b_full.yaml +62 -0
  19. llm_forge_new-0.1.0/configs/benchmark_qlora_phi2.yaml +66 -0
  20. llm_forge_new-0.1.0/configs/benchmark_smollm_135m.yaml +49 -0
  21. llm_forge_new-0.1.0/configs/benchmark_smollm_360m.yaml +57 -0
  22. llm_forge_new-0.1.0/configs/benchmark_tinyllama_1b.yaml +62 -0
  23. llm_forge_new-0.1.0/configs/demo_lora_llama.yaml +61 -0
  24. llm_forge_new-0.1.0/configs/example_cloud_aws.yaml +88 -0
  25. llm_forge_new-0.1.0/configs/example_cloud_runpod.yaml +87 -0
  26. llm_forge_new-0.1.0/configs/example_code_domain.yaml +57 -0
  27. llm_forge_new-0.1.0/configs/example_legal_domain.yaml +58 -0
  28. llm_forge_new-0.1.0/configs/example_lora.yaml +61 -0
  29. llm_forge_new-0.1.0/configs/example_medical_domain.yaml +65 -0
  30. llm_forge_new-0.1.0/configs/example_pretrain.yaml +45 -0
  31. llm_forge_new-0.1.0/configs/example_qlora.yaml +61 -0
  32. llm_forge_new-0.1.0/configs/example_rag.yaml +29 -0
  33. llm_forge_new-0.1.0/configs/finance_specialist_h100.yaml +161 -0
  34. llm_forge_new-0.1.0/configs/finance_specialist_local.yaml +88 -0
  35. llm_forge_new-0.1.0/configs/finance_specialist_v7.yaml +121 -0
  36. llm_forge_new-0.1.0/configs/finance_specialist_v7_h100.yaml +136 -0
  37. llm_forge_new-0.1.0/configs/quickstart_tiny.yaml +46 -0
  38. llm_forge_new-0.1.0/docker/Dockerfile +27 -0
  39. llm_forge_new-0.1.0/docker/Dockerfile.gpu +35 -0
  40. llm_forge_new-0.1.0/docker/docker-compose.yml +73 -0
  41. llm_forge_new-0.1.0/docs/api_reference.md +1288 -0
  42. llm_forge_new-0.1.0/docs/configuration.md +923 -0
  43. llm_forge_new-0.1.0/docs/data_preparation.md +843 -0
  44. llm_forge_new-0.1.0/docs/deployment.md +864 -0
  45. llm_forge_new-0.1.0/docs/distributed_training.md +1040 -0
  46. llm_forge_new-0.1.0/docs/evaluation_guide.md +709 -0
  47. llm_forge_new-0.1.0/docs/hopper_cluster_guide.md +569 -0
  48. llm_forge_new-0.1.0/docs/quickstart.md +415 -0
  49. llm_forge_new-0.1.0/docs/training_guide.md +910 -0
  50. llm_forge_new-0.1.0/examples/data/sample_completion.txt +13 -0
  51. llm_forge_new-0.1.0/examples/data/sample_sharegpt.jsonl +5 -0
  52. llm_forge_new-0.1.0/examples/data/sample_train.jsonl +21 -0
  53. llm_forge_new-0.1.0/pyproject.toml +180 -0
  54. llm_forge_new-0.1.0/scripts/analyze_results.py +496 -0
  55. llm_forge_new-0.1.0/scripts/debug_oom.py +83 -0
  56. llm_forge_new-0.1.0/scripts/deploy_to_hopper.sh +88 -0
  57. llm_forge_new-0.1.0/scripts/deploy_v7.sh +77 -0
  58. llm_forge_new-0.1.0/scripts/download_base_model.py +34 -0
  59. llm_forge_new-0.1.0/scripts/hopper_connect.sh +20 -0
  60. llm_forge_new-0.1.0/scripts/hopper_ssh.exp +37 -0
  61. llm_forge_new-0.1.0/scripts/monitor_job.sh +86 -0
  62. llm_forge_new-0.1.0/scripts/run_finance_specialist.sbatch +203 -0
  63. llm_forge_new-0.1.0/scripts/run_finance_specialist_v2.sbatch +308 -0
  64. llm_forge_new-0.1.0/scripts/run_finance_specialist_v7.sbatch +254 -0
  65. llm_forge_new-0.1.0/scripts/run_post_training.py +405 -0
  66. llm_forge_new-0.1.0/scripts/run_post_training.sbatch +209 -0
  67. llm_forge_new-0.1.0/scripts/setup_environment.sh +144 -0
  68. llm_forge_new-0.1.0/scripts/setup_hopper_demo.sh +123 -0
  69. llm_forge_new-0.1.0/scripts/slurm/benchmark_suite.sbatch +106 -0
  70. llm_forge_new-0.1.0/scripts/slurm/singularity_build.def +33 -0
  71. llm_forge_new-0.1.0/scripts/slurm/train_demo.sbatch +51 -0
  72. llm_forge_new-0.1.0/scripts/slurm/train_hopper.sbatch +43 -0
  73. llm_forge_new-0.1.0/scripts/slurm/train_multi_node.sbatch +45 -0
  74. llm_forge_new-0.1.0/scripts/training_observation_finance.md +285 -0
  75. llm_forge_new-0.1.0/scripts/validate_gpu.py +63 -0
  76. llm_forge_new-0.1.0/src/llm_forge/__init__.py +3 -0
  77. llm_forge_new-0.1.0/src/llm_forge/cli.py +1766 -0
  78. llm_forge_new-0.1.0/src/llm_forge/config/__init__.py +84 -0
  79. llm_forge_new-0.1.0/src/llm_forge/config/hardware_detector.py +667 -0
  80. llm_forge_new-0.1.0/src/llm_forge/config/presets/__init__.py +1 -0
  81. llm_forge_new-0.1.0/src/llm_forge/config/presets/full_finetune.yaml +104 -0
  82. llm_forge_new-0.1.0/src/llm_forge/config/presets/lora_default.yaml +104 -0
  83. llm_forge_new-0.1.0/src/llm_forge/config/presets/pretrain_small.yaml +100 -0
  84. llm_forge_new-0.1.0/src/llm_forge/config/presets/qlora_default.yaml +113 -0
  85. llm_forge_new-0.1.0/src/llm_forge/config/presets/rag_default.yaml +137 -0
  86. llm_forge_new-0.1.0/src/llm_forge/config/schema.py +1769 -0
  87. llm_forge_new-0.1.0/src/llm_forge/config/validator.py +322 -0
  88. llm_forge_new-0.1.0/src/llm_forge/data/__init__.py +7 -0
  89. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/__init__.py +518 -0
  90. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/deduplication.py +547 -0
  91. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/heuristic_filter.py +430 -0
  92. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/language_filter.py +270 -0
  93. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/pii_redactor.py +398 -0
  94. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/quality_classifier.py +475 -0
  95. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/toxicity_filter.py +305 -0
  96. llm_forge_new-0.1.0/src/llm_forge/data/cleaning/unicode_fixer.py +169 -0
  97. llm_forge_new-0.1.0/src/llm_forge/data/ifd_scorer.py +270 -0
  98. llm_forge_new-0.1.0/src/llm_forge/data/loader.py +315 -0
  99. llm_forge_new-0.1.0/src/llm_forge/data/mixing.py +154 -0
  100. llm_forge_new-0.1.0/src/llm_forge/data/preprocessor.py +302 -0
  101. llm_forge_new-0.1.0/src/llm_forge/data/refusal_augmentor.py +253 -0
  102. llm_forge_new-0.1.0/src/llm_forge/data/synthetic/__init__.py +6 -0
  103. llm_forge_new-0.1.0/src/llm_forge/data/synthetic/generator.py +278 -0
  104. llm_forge_new-0.1.0/src/llm_forge/data/synthetic/quality_scorer.py +168 -0
  105. llm_forge_new-0.1.0/src/llm_forge/data/synthetic/templates.py +131 -0
  106. llm_forge_new-0.1.0/src/llm_forge/data/tokenizer/__init__.py +6 -0
  107. llm_forge_new-0.1.0/src/llm_forge/data/tokenizer/selector.py +139 -0
  108. llm_forge_new-0.1.0/src/llm_forge/data/tokenizer/token_optimizer.py +172 -0
  109. llm_forge_new-0.1.0/src/llm_forge/evaluation/__init__.py +9 -0
  110. llm_forge_new-0.1.0/src/llm_forge/evaluation/benchmarks.py +674 -0
  111. llm_forge_new-0.1.0/src/llm_forge/evaluation/domain_eval.py +568 -0
  112. llm_forge_new-0.1.0/src/llm_forge/evaluation/iti_prober.py +426 -0
  113. llm_forge_new-0.1.0/src/llm_forge/evaluation/llm_judge.py +344 -0
  114. llm_forge_new-0.1.0/src/llm_forge/evaluation/metrics.py +613 -0
  115. llm_forge_new-0.1.0/src/llm_forge/evaluation/report_generator.py +1204 -0
  116. llm_forge_new-0.1.0/src/llm_forge/evaluation/retention_probes.py +1050 -0
  117. llm_forge_new-0.1.0/src/llm_forge/evaluation/training_summary.py +318 -0
  118. llm_forge_new-0.1.0/src/llm_forge/pipeline/__init__.py +5 -0
  119. llm_forge_new-0.1.0/src/llm_forge/pipeline/config_translator.py +426 -0
  120. llm_forge_new-0.1.0/src/llm_forge/pipeline/dag_builder.py +1135 -0
  121. llm_forge_new-0.1.0/src/llm_forge/pipeline/pipeline_runner.py +601 -0
  122. llm_forge_new-0.1.0/src/llm_forge/pipeline/preset_resolver.py +250 -0
  123. llm_forge_new-0.1.0/src/llm_forge/rag/__init__.py +5 -0
  124. llm_forge_new-0.1.0/src/llm_forge/rag/chunking.py +607 -0
  125. llm_forge_new-0.1.0/src/llm_forge/rag/embeddings.py +372 -0
  126. llm_forge_new-0.1.0/src/llm_forge/rag/pipeline.py +675 -0
  127. llm_forge_new-0.1.0/src/llm_forge/rag/reranker.py +263 -0
  128. llm_forge_new-0.1.0/src/llm_forge/rag/retriever.py +440 -0
  129. llm_forge_new-0.1.0/src/llm_forge/rag/vectorstore.py +655 -0
  130. llm_forge_new-0.1.0/src/llm_forge/serving/__init__.py +36 -0
  131. llm_forge_new-0.1.0/src/llm_forge/serving/export.py +970 -0
  132. llm_forge_new-0.1.0/src/llm_forge/serving/fastapi_server.py +652 -0
  133. llm_forge_new-0.1.0/src/llm_forge/serving/gradio_app.py +621 -0
  134. llm_forge_new-0.1.0/src/llm_forge/serving/iti_baker.py +159 -0
  135. llm_forge_new-0.1.0/src/llm_forge/serving/model_merger.py +330 -0
  136. llm_forge_new-0.1.0/src/llm_forge/serving/vllm_server.py +455 -0
  137. llm_forge_new-0.1.0/src/llm_forge/training/__init__.py +50 -0
  138. llm_forge_new-0.1.0/src/llm_forge/training/alignment.py +993 -0
  139. llm_forge_new-0.1.0/src/llm_forge/training/callbacks.py +868 -0
  140. llm_forge_new-0.1.0/src/llm_forge/training/distributed/__init__.py +12 -0
  141. llm_forge_new-0.1.0/src/llm_forge/training/distributed/deepspeed_config.py +289 -0
  142. llm_forge_new-0.1.0/src/llm_forge/training/distributed/fsdp_config.py +212 -0
  143. llm_forge_new-0.1.0/src/llm_forge/training/distributed/hardware_profiler.py +503 -0
  144. llm_forge_new-0.1.0/src/llm_forge/training/distributed/megatron_config.py +382 -0
  145. llm_forge_new-0.1.0/src/llm_forge/training/distributed/orchestrator.py +353 -0
  146. llm_forge_new-0.1.0/src/llm_forge/training/finetuner.py +747 -0
  147. llm_forge_new-0.1.0/src/llm_forge/training/mac_utils.py +314 -0
  148. llm_forge_new-0.1.0/src/llm_forge/training/mlx_trainer.py +468 -0
  149. llm_forge_new-0.1.0/src/llm_forge/training/optimization/__init__.py +15 -0
  150. llm_forge_new-0.1.0/src/llm_forge/training/optimization/batch_optimizer.py +329 -0
  151. llm_forge_new-0.1.0/src/llm_forge/training/optimization/fp8_manager.py +260 -0
  152. llm_forge_new-0.1.0/src/llm_forge/training/optimization/memory_optimizer.py +422 -0
  153. llm_forge_new-0.1.0/src/llm_forge/training/pretrainer.py +576 -0
  154. llm_forge_new-0.1.0/src/llm_forge/training/trainer.py +739 -0
  155. llm_forge_new-0.1.0/src/llm_forge/ui/__init__.py +5 -0
  156. llm_forge_new-0.1.0/src/llm_forge/ui/__main__.py +6 -0
  157. llm_forge_new-0.1.0/src/llm_forge/ui/app.py +1790 -0
  158. llm_forge_new-0.1.0/src/llm_forge/ui/model_catalog.py +243 -0
  159. llm_forge_new-0.1.0/src/llm_forge/utils/__init__.py +12 -0
  160. llm_forge_new-0.1.0/src/llm_forge/utils/download.py +348 -0
  161. llm_forge_new-0.1.0/src/llm_forge/utils/error_recovery.py +299 -0
  162. llm_forge_new-0.1.0/src/llm_forge/utils/gpu_utils.py +543 -0
  163. llm_forge_new-0.1.0/src/llm_forge/utils/logging.py +208 -0
  164. llm_forge_new-0.1.0/src/llm_forge/utils/perf_dashboard.py +353 -0
  165. llm_forge_new-0.1.0/src/llm_forge/utils/security.py +553 -0
  166. llm_forge_new-0.1.0/src/llm_forge/wizard.py +785 -0
  167. llm_forge_new-0.1.0/tests/__init__.py +0 -0
  168. llm_forge_new-0.1.0/tests/conftest.py +178 -0
  169. llm_forge_new-0.1.0/tests/test_cleaning/__init__.py +0 -0
  170. llm_forge_new-0.1.0/tests/test_cleaning/test_deduplication.py +184 -0
  171. llm_forge_new-0.1.0/tests/test_cleaning/test_heuristic_filter.py +177 -0
  172. llm_forge_new-0.1.0/tests/test_cleaning/test_pii_redactor.py +139 -0
  173. llm_forge_new-0.1.0/tests/test_cleaning/test_unicode_fixer.py +112 -0
  174. llm_forge_new-0.1.0/tests/test_cli.py +240 -0
  175. llm_forge_new-0.1.0/tests/test_cli_phase4.py +378 -0
  176. llm_forge_new-0.1.0/tests/test_config/__init__.py +0 -0
  177. llm_forge_new-0.1.0/tests/test_config/test_hardware_detector.py +271 -0
  178. llm_forge_new-0.1.0/tests/test_config_presets.py +174 -0
  179. llm_forge_new-0.1.0/tests/test_config_schema.py +391 -0
  180. llm_forge_new-0.1.0/tests/test_data_loader.py +206 -0
  181. llm_forge_new-0.1.0/tests/test_error_recovery.py +256 -0
  182. llm_forge_new-0.1.0/tests/test_evaluation/__init__.py +0 -0
  183. llm_forge_new-0.1.0/tests/test_evaluation/test_ifeval_benchmark.py +131 -0
  184. llm_forge_new-0.1.0/tests/test_evaluation/test_quality_report_card.py +286 -0
  185. llm_forge_new-0.1.0/tests/test_evaluation/test_regression_detection.py +127 -0
  186. llm_forge_new-0.1.0/tests/test_evaluation/test_retention_probes.py +284 -0
  187. llm_forge_new-0.1.0/tests/test_evaluation_metrics.py +234 -0
  188. llm_forge_new-0.1.0/tests/test_grpo_trainer.py +227 -0
  189. llm_forge_new-0.1.0/tests/test_ifd_scoring.py +355 -0
  190. llm_forge_new-0.1.0/tests/test_llm_judge.py +310 -0
  191. llm_forge_new-0.1.0/tests/test_mlx_trainer.py +285 -0
  192. llm_forge_new-0.1.0/tests/test_model_merging.py +410 -0
  193. llm_forge_new-0.1.0/tests/test_orpo_alignment.py +425 -0
  194. llm_forge_new-0.1.0/tests/test_perf_dashboard.py +215 -0
  195. llm_forge_new-0.1.0/tests/test_pipeline_integration.py +404 -0
  196. llm_forge_new-0.1.0/tests/test_preprocessor.py +277 -0
  197. llm_forge_new-0.1.0/tests/test_rag.py +165 -0
  198. llm_forge_new-0.1.0/tests/test_sample_packing.py +132 -0
  199. llm_forge_new-0.1.0/tests/test_serving.py +111 -0
  200. llm_forge_new-0.1.0/tests/test_serving_modules.py +652 -0
  201. llm_forge_new-0.1.0/tests/test_training/__init__.py +0 -0
  202. llm_forge_new-0.1.0/tests/test_training/test_completion_only_loss.py +143 -0
  203. llm_forge_new-0.1.0/tests/test_training/test_distributed_orchestrator.py +265 -0
  204. llm_forge_new-0.1.0/tests/test_training/test_finetuner.py +119 -0
  205. llm_forge_new-0.1.0/tests/test_training/test_grad_accum_fix.py +156 -0
  206. llm_forge_new-0.1.0/tests/test_training/test_mac_utils.py +271 -0
  207. llm_forge_new-0.1.0/tests/test_training/test_memory_optimizer.py +191 -0
  208. llm_forge_new-0.1.0/tests/test_training/test_neftune_label_smoothing.py +172 -0
  209. llm_forge_new-0.1.0/tests/test_training/test_progress_dashboard.py +351 -0
  210. llm_forge_new-0.1.0/tests/test_training_summary.py +265 -0
  211. llm_forge_new-0.1.0/tests/test_wizard.py +280 -0
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+ # Safety check hook — blocks dangerous operations in Claude Code
3
+
4
+ INPUT="$TOOL_INPUT_command"
5
+
6
+ # Block force pushes to main (use --force-with-lease on feature branches only)
7
+ if echo "$INPUT" | grep -q "git push.*--force"; then
8
+ echo "BLOCKED: Force push detected."
9
+ echo "Use --force-with-lease on feature branches only."
10
+ echo "Never force push to main."
11
+ exit 1
12
+ fi
13
+
14
+ # Block recursive deletion of critical directories
15
+ if echo "$INPUT" | grep -qE "rm.*-rf.*(src|tests|configs|\.claude)"; then
16
+ echo "BLOCKED: Recursive deletion of critical directory detected."
17
+ echo "Directories src/, tests/, configs/, and .claude/ are protected."
18
+ exit 1
19
+ fi
20
+
21
+ # Block accidental deletion of the database
22
+ if echo "$INPUT" | grep -qE "rm.*metrics\.db"; then
23
+ echo "BLOCKED: Deletion of metrics database detected."
24
+ echo "The metrics database contains historical training data."
25
+ exit 1
26
+ fi
27
+
28
+ # Warn about pip install without --break-system-packages
29
+ if echo "$INPUT" | grep -q "pip install" && ! echo "$INPUT" | grep -q "break-system-packages"; then
30
+ echo "WARNING: Consider using --break-system-packages flag with pip install."
31
+ echo "Continuing anyway..."
32
+ fi
33
+
34
+ # All checks passed
35
+ exit 0
@@ -0,0 +1,26 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Edit|Write",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "cd \"$CLAUDE_PROJECT_DIR\" && python -m ruff check --fix $TOOL_INPUT_path 2>/dev/null; exit 0"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PreToolUse": [
15
+ {
16
+ "matcher": "Bash",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "bash .claude/hooks/safety-check.sh"
21
+ }
22
+ ]
23
+ }
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,54 @@
1
+ name: Bug Report
2
+ description: Report a bug in llm-forge
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for reporting a bug! Please fill out the information below.
10
+ - type: textarea
11
+ id: description
12
+ attributes:
13
+ label: Description
14
+ description: A clear description of the bug.
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: reproduce
19
+ attributes:
20
+ label: Steps to Reproduce
21
+ description: Steps to reproduce the behavior.
22
+ placeholder: |
23
+ 1. Create config with...
24
+ 2. Run `llm-forge train --config ...`
25
+ 3. See error...
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: expected
30
+ attributes:
31
+ label: Expected Behavior
32
+ description: What you expected to happen.
33
+ validations:
34
+ required: true
35
+ - type: textarea
36
+ id: config
37
+ attributes:
38
+ label: Configuration (YAML)
39
+ description: Your YAML config file (remove any sensitive info).
40
+ render: yaml
41
+ - type: textarea
42
+ id: environment
43
+ attributes:
44
+ label: Environment
45
+ description: Output of `llm-forge info`
46
+ render: text
47
+ validations:
48
+ required: true
49
+ - type: textarea
50
+ id: logs
51
+ attributes:
52
+ label: Error Logs
53
+ description: Relevant error messages or stack traces.
54
+ render: text
@@ -0,0 +1,42 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature for llm-forge
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for suggesting a feature! Please describe what you'd like.
10
+ - type: textarea
11
+ id: description
12
+ attributes:
13
+ label: Feature Description
14
+ description: A clear description of the feature you'd like.
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: motivation
19
+ attributes:
20
+ label: Motivation
21
+ description: Why would this feature be useful?
22
+ validations:
23
+ required: true
24
+ - type: textarea
25
+ id: alternatives
26
+ attributes:
27
+ label: Alternatives Considered
28
+ description: Any alternative solutions you've considered.
29
+ - type: dropdown
30
+ id: area
31
+ attributes:
32
+ label: Component
33
+ options:
34
+ - Configuration
35
+ - Data Pipeline
36
+ - Training
37
+ - Evaluation
38
+ - RAG
39
+ - Serving
40
+ - CLI
41
+ - Documentation
42
+ - Other
@@ -0,0 +1,20 @@
1
+ ## Summary
2
+
3
+ <!-- Brief description of changes -->
4
+
5
+ ## Changes
6
+
7
+ -
8
+
9
+ ## Testing
10
+
11
+ - [ ] Added/updated tests
12
+ - [ ] All tests pass (`make test`)
13
+ - [ ] Linting passes (`make lint`)
14
+
15
+ ## Type of Change
16
+
17
+ - [ ] Bug fix
18
+ - [ ] New feature
19
+ - [ ] Breaking change
20
+ - [ ] Documentation update
@@ -0,0 +1,73 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ env:
13
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
14
+
15
+ jobs:
16
+ lint:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+ - name: Install dependencies
25
+ run: |
26
+ pip install ruff mypy
27
+ - name: Run ruff check
28
+ run: ruff check src/ tests/
29
+ - name: Run ruff format check
30
+ run: ruff format --check src/ tests/
31
+
32
+ test-cpu:
33
+ runs-on: ubuntu-latest
34
+ strategy:
35
+ matrix:
36
+ python-version: ["3.10", "3.11", "3.12"]
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - name: Set up Python ${{ matrix.python-version }}
40
+ uses: actions/setup-python@v5
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+ - name: Install dependencies
44
+ run: |
45
+ pip install -e ".[dev]"
46
+ - name: Run tests
47
+ env:
48
+ NO_COLOR: "1"
49
+ run: |
50
+ pytest tests/ -v --cov=llm_forge --cov-report=xml \
51
+ --ignore=tests/test_training/test_gpu.py \
52
+ -m "not gpu and not slow"
53
+ - name: Upload coverage
54
+ if: matrix.python-version == '3.11'
55
+ uses: codecov/codecov-action@v5
56
+ with:
57
+ files: ./coverage.xml
58
+
59
+ build:
60
+ runs-on: ubuntu-latest
61
+ needs: [lint, test-cpu]
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ - name: Set up Python
65
+ uses: actions/setup-python@v5
66
+ with:
67
+ python-version: "3.11"
68
+ - name: Install build tools
69
+ run: pip install build twine
70
+ - name: Build package
71
+ run: python -m build
72
+ - name: Check package
73
+ run: twine check dist/*
@@ -0,0 +1,31 @@
1
+ name: GPU Tests
2
+
3
+ on:
4
+ pull_request:
5
+ types: [labeled]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ env:
11
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
12
+
13
+ jobs:
14
+ test-gpu:
15
+ if: github.event.label.name == 'gpu-test'
16
+ runs-on: self-hosted
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.11"
23
+ - name: Install dependencies
24
+ run: |
25
+ pip install -e ".[all]"
26
+ - name: Verify GPU
27
+ run: |
28
+ python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}, GPUs: {torch.cuda.device_count()}')"
29
+ - name: Run GPU tests
30
+ run: |
31
+ pytest tests/ -v -m gpu --timeout=600
@@ -0,0 +1,58 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions: {}
9
+
10
+ env:
11
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
12
+
13
+ jobs:
14
+ publish:
15
+ runs-on: ubuntu-latest
16
+ environment: release
17
+ permissions:
18
+ id-token: write
19
+ contents: read
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.11"
26
+ - name: Install build tools
27
+ run: pip install build
28
+ - name: Build package
29
+ run: python -m build
30
+ - name: Publish to PyPI
31
+ uses: pypa/gh-action-pypi-publish@release/v1
32
+
33
+ github-release:
34
+ runs-on: ubuntu-latest
35
+ needs: publish
36
+ permissions:
37
+ contents: write
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ with:
41
+ fetch-depth: 0
42
+ - name: Generate changelog
43
+ id: changelog
44
+ run: |
45
+ PREV_TAG=$(git tag --sort=-version:refname | sed -n '2p')
46
+ if [ -z "$PREV_TAG" ]; then
47
+ echo "body=Initial release" >> $GITHUB_OUTPUT
48
+ else
49
+ CHANGES=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD)
50
+ echo "body<<EOF" >> $GITHUB_OUTPUT
51
+ echo "$CHANGES" >> $GITHUB_OUTPUT
52
+ echo "EOF" >> $GITHUB_OUTPUT
53
+ fi
54
+ - name: Create GitHub Release
55
+ uses: softprops/action-gh-release@v2
56
+ with:
57
+ body: ${{ steps.changelog.outputs.body }}
58
+ generate_release_notes: true
@@ -0,0 +1,88 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.egg-info/
7
+ *.egg
8
+ dist/
9
+ build/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+ *.swp
21
+ *.swo
22
+ *~
23
+
24
+ # OS
25
+ .DS_Store
26
+ Thumbs.db
27
+
28
+ # Project
29
+ output/
30
+ outputs/
31
+ checkpoints/
32
+ logs/
33
+ wandb/
34
+ *.ckpt
35
+ *.pt
36
+ *.bin
37
+ *.safetensors
38
+ *.gguf
39
+
40
+ # Data (user training data — not committed)
41
+ /data/
42
+ *.jsonl
43
+ *.parquet
44
+ *.csv
45
+ # Exception: example data IS committed
46
+ !examples/data/*.jsonl
47
+ !examples/data/*.txt
48
+
49
+ # Environment and secrets
50
+ .env
51
+ .env.*
52
+ *.key
53
+ *.pem
54
+ *.p12
55
+ *.secret
56
+ credentials.json
57
+ service-account*.json
58
+
59
+ # HuggingFace token cache
60
+ .cache/huggingface/token
61
+
62
+ # Eval results (large, machine-specific)
63
+ eval_results/
64
+
65
+ # Models (large files)
66
+ models/
67
+ *.model
68
+ lid.176.bin
69
+
70
+ # ChromaDB
71
+ chroma_db/
72
+
73
+ # Coverage
74
+ .coverage
75
+ htmlcov/
76
+ coverage.xml
77
+
78
+ # Jupyter
79
+ .ipynb_checkpoints/
80
+
81
+ # Benchmark results (machine-specific paths)
82
+ hopper_benchmark/
83
+
84
+ # Metrics database
85
+ metrics.db
86
+
87
+ # Claude project memory (personal context)
88
+ .claude/projects/
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ All notable changes to llm-forge will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-03-19
9
+
10
+ ### Added
11
+ - Initial public release of llm-forge
12
+ - YAML-first configuration system with Pydantic v2 validation (22 config classes, 183 fields)
13
+ - Universal data loader (JSONL, CSV, Parquet, PDF, DOCX, HTML, HuggingFace datasets)
14
+ - Full data cleaning pipeline (unicode fixing, language filtering, heuristic filters, quality classification, toxicity filtering, PII redaction, 3-tier deduplication)
15
+ - LoRA, QLoRA, and full fine-tuning with TRL SFTTrainer
16
+ - Pre-training from scratch with configurable Llama architecture
17
+ - Alignment training: DPO, ORPO, GRPO, and PPO-based RLHF
18
+ - Inference-Time Intervention (ITI) for anti-hallucination with probing and weight baking
19
+ - IFD (Instruction-Following Difficulty) scoring for data quality
20
+ - Refusal augmentation (R-Tuning) for safety training
21
+ - Model merging: linear interpolation, SLERP, and TIES-Merging
22
+ - Synthetic data generation with quality scoring
23
+ - Distributed training orchestration (FSDP, DeepSpeed ZeRO 0-3, Megatron-Core 3D parallelism)
24
+ - FP8 training support for Hopper GPUs via Transformer Engine
25
+ - Hardware auto-detection and config optimization for RTX 3090/4090, A100, H100, Apple Silicon
26
+ - lm-evaluation-harness benchmark integration (MMLU, GSM8K, ARC, HellaSwag, IFEval, etc.)
27
+ - LLM-as-Judge evaluation with configurable criteria
28
+ - Domain evaluation with custom datasets
29
+ - Knowledge retention probes (100 questions across 10 domains)
30
+ - RAG pipeline with hybrid retrieval (dense + BM25), cross-encoder reranking, ChromaDB/FAISS
31
+ - Gradio web dashboard with model browser, training UI, and chat interface
32
+ - FastAPI server with OpenAI-compatible API endpoints
33
+ - vLLM high-throughput serving integration
34
+ - Model export: safetensors, GGUF (16 quantization types), ONNX, AWQ
35
+ - Ollama Modelfile generation with multi-turn chat template support
36
+ - Typer CLI with 13 commands and Rich formatting
37
+ - Interactive training wizard for guided setup
38
+ - Apple Silicon support (MPS + MLX trainer)
39
+ - Mac-specific monitoring (thermal, battery, memory pressure)
40
+ - SLURM job generation for HPC clusters
41
+ - Training callbacks: Rich progress, GPU monitoring, W&B, early stopping, checkpointing
42
+ - Comprehensive error recovery with context-aware suggestions
43
+ - Security module: safetensors validation, credential masking
44
+ - 894 passing tests, 0 failures
45
+ - 20 ready-to-use YAML configs (quickstart, benchmarks, domain examples, cloud deployment)
46
+ - Example training data in Alpaca, ShareGPT, and completion formats
47
+ - GitHub Actions CI/CD (lint, test, build, PyPI release)
48
+
49
+ ### Finance Specialist Model (v7)
50
+ - Trained and deployed to HuggingFace: Venkat9990/finance-specialist-v7
51
+ - Zero catastrophic forgetting: all benchmarks within 0-2% of base model
52
+ - Knowledge-preserving LoRA (r=8, attention-only, LR 1e-5)
53
+ - 97.7% token masking accuracy
54
+ - Available as safetensors (2.4 GB) and GGUF Q4_K_M (763 MB)