hfl 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 (218) hide show
  1. hfl-0.1.0/.github/FUNDING.yml +2 -0
  2. hfl-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +90 -0
  3. hfl-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. hfl-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +54 -0
  5. hfl-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +47 -0
  6. hfl-0.1.0/.github/dependabot.yml +39 -0
  7. hfl-0.1.0/.github/workflows/build-executables.yml +147 -0
  8. hfl-0.1.0/.github/workflows/ci.yml +90 -0
  9. hfl-0.1.0/.github/workflows/license-check.yml +41 -0
  10. hfl-0.1.0/.github/workflows/lint.yml +43 -0
  11. hfl-0.1.0/.github/workflows/pages.yml +50 -0
  12. hfl-0.1.0/.github/workflows/release.yml +81 -0
  13. hfl-0.1.0/.github/workflows/security.yml +67 -0
  14. hfl-0.1.0/.github/workflows/test.yml +39 -0
  15. hfl-0.1.0/.gitignore +63 -0
  16. hfl-0.1.0/.gitleaks.toml +26 -0
  17. hfl-0.1.0/CHANGELOG.md +50 -0
  18. hfl-0.1.0/CODE_OF_CONDUCT.md +41 -0
  19. hfl-0.1.0/CONTRIBUTING.md +71 -0
  20. hfl-0.1.0/DISCLAIMER.md +59 -0
  21. hfl-0.1.0/LICENSE +733 -0
  22. hfl-0.1.0/LICENSE-DEPENDENCIES.md +63 -0
  23. hfl-0.1.0/LICENSE-FAQ.md +73 -0
  24. hfl-0.1.0/NOTICE-EU-AI-ACT.md +92 -0
  25. hfl-0.1.0/PKG-INFO +796 -0
  26. hfl-0.1.0/PRIVACY.md +130 -0
  27. hfl-0.1.0/README.es.md +454 -0
  28. hfl-0.1.0/README.md +454 -0
  29. hfl-0.1.0/SECURITY.md +57 -0
  30. hfl-0.1.0/docs/adr/0001-singleton-pattern.md +94 -0
  31. hfl-0.1.0/docs/adr/0002-async-api-sync-engines.md +112 -0
  32. hfl-0.1.0/docs/adr/0003-gguf-default-format.md +109 -0
  33. hfl-0.1.0/docs/adr/0004-ollama-compatibility.md +115 -0
  34. hfl-0.1.0/docs/adr/0005-license-classification.md +115 -0
  35. hfl-0.1.0/docs/adr/0006-rate-limiting-strategy.md +126 -0
  36. hfl-0.1.0/docs/adr/template.md +53 -0
  37. hfl-0.1.0/docs/hfl-architecture-complete.html +1349 -0
  38. hfl-0.1.0/docs/hfl-arquitectura-completa.html +1347 -0
  39. hfl-0.1.0/hfl.spec +147 -0
  40. hfl-0.1.0/pyproject.toml +125 -0
  41. hfl-0.1.0/scripts/build_executable.sh +74 -0
  42. hfl-0.1.0/scripts/fix_all.sh +53 -0
  43. hfl-0.1.0/src/hfl/__init__.py +5 -0
  44. hfl-0.1.0/src/hfl/api/__init__.py +3 -0
  45. hfl-0.1.0/src/hfl/api/converters.py +145 -0
  46. hfl-0.1.0/src/hfl/api/deprecation.py +132 -0
  47. hfl-0.1.0/src/hfl/api/errors.py +278 -0
  48. hfl-0.1.0/src/hfl/api/exception_handlers.py +39 -0
  49. hfl-0.1.0/src/hfl/api/helpers.py +550 -0
  50. hfl-0.1.0/src/hfl/api/middleware.py +260 -0
  51. hfl-0.1.0/src/hfl/api/model_loader.py +180 -0
  52. hfl-0.1.0/src/hfl/api/rate_limit.py +431 -0
  53. hfl-0.1.0/src/hfl/api/routes_health.py +274 -0
  54. hfl-0.1.0/src/hfl/api/routes_metrics.py +45 -0
  55. hfl-0.1.0/src/hfl/api/routes_native.py +260 -0
  56. hfl-0.1.0/src/hfl/api/routes_openai.py +285 -0
  57. hfl-0.1.0/src/hfl/api/routes_tts.py +302 -0
  58. hfl-0.1.0/src/hfl/api/schemas/__init__.py +41 -0
  59. hfl-0.1.0/src/hfl/api/schemas/ollama.py +97 -0
  60. hfl-0.1.0/src/hfl/api/schemas/openai.py +151 -0
  61. hfl-0.1.0/src/hfl/api/schemas/tts.py +138 -0
  62. hfl-0.1.0/src/hfl/api/server.py +232 -0
  63. hfl-0.1.0/src/hfl/api/state.py +321 -0
  64. hfl-0.1.0/src/hfl/api/streaming.py +195 -0
  65. hfl-0.1.0/src/hfl/api/timeout.py +107 -0
  66. hfl-0.1.0/src/hfl/cli/__init__.py +3 -0
  67. hfl-0.1.0/src/hfl/cli/commands/__init__.py +6 -0
  68. hfl-0.1.0/src/hfl/cli/commands/_utils.py +207 -0
  69. hfl-0.1.0/src/hfl/cli/main.py +1134 -0
  70. hfl-0.1.0/src/hfl/config.py +194 -0
  71. hfl-0.1.0/src/hfl/converter/__init__.py +3 -0
  72. hfl-0.1.0/src/hfl/converter/formats.py +678 -0
  73. hfl-0.1.0/src/hfl/converter/gguf_converter.py +538 -0
  74. hfl-0.1.0/src/hfl/core/__init__.py +49 -0
  75. hfl-0.1.0/src/hfl/core/container.py +270 -0
  76. hfl-0.1.0/src/hfl/core/observability_setup.py +74 -0
  77. hfl-0.1.0/src/hfl/core/tracing.py +214 -0
  78. hfl-0.1.0/src/hfl/engine/__init__.py +3 -0
  79. hfl-0.1.0/src/hfl/engine/async_wrapper.py +228 -0
  80. hfl-0.1.0/src/hfl/engine/bark_engine.py +354 -0
  81. hfl-0.1.0/src/hfl/engine/base.py +257 -0
  82. hfl-0.1.0/src/hfl/engine/coqui_engine.py +389 -0
  83. hfl-0.1.0/src/hfl/engine/dependency_check.py +138 -0
  84. hfl-0.1.0/src/hfl/engine/failover.py +168 -0
  85. hfl-0.1.0/src/hfl/engine/llama_cpp.py +252 -0
  86. hfl-0.1.0/src/hfl/engine/memory.py +252 -0
  87. hfl-0.1.0/src/hfl/engine/model_pool.py +452 -0
  88. hfl-0.1.0/src/hfl/engine/observability.py +386 -0
  89. hfl-0.1.0/src/hfl/engine/prompt_builder.py +310 -0
  90. hfl-0.1.0/src/hfl/engine/selector.py +275 -0
  91. hfl-0.1.0/src/hfl/engine/transformers_engine.py +239 -0
  92. hfl-0.1.0/src/hfl/engine/vllm_engine.py +239 -0
  93. hfl-0.1.0/src/hfl/events.py +227 -0
  94. hfl-0.1.0/src/hfl/exceptions.py +304 -0
  95. hfl-0.1.0/src/hfl/hub/__init__.py +3 -0
  96. hfl-0.1.0/src/hfl/hub/auth.py +102 -0
  97. hfl-0.1.0/src/hfl/hub/client.py +190 -0
  98. hfl-0.1.0/src/hfl/hub/downloader.py +170 -0
  99. hfl-0.1.0/src/hfl/hub/license_checker.py +327 -0
  100. hfl-0.1.0/src/hfl/hub/resolver.py +178 -0
  101. hfl-0.1.0/src/hfl/i18n/__init__.py +189 -0
  102. hfl-0.1.0/src/hfl/i18n/locales/en.json +259 -0
  103. hfl-0.1.0/src/hfl/i18n/locales/es.json +259 -0
  104. hfl-0.1.0/src/hfl/logging_config.py +213 -0
  105. hfl-0.1.0/src/hfl/metrics.py +359 -0
  106. hfl-0.1.0/src/hfl/models/__init__.py +3 -0
  107. hfl-0.1.0/src/hfl/models/backends/__init__.py +23 -0
  108. hfl-0.1.0/src/hfl/models/backends/base.py +88 -0
  109. hfl-0.1.0/src/hfl/models/backends/file.py +174 -0
  110. hfl-0.1.0/src/hfl/models/backends/sqlite.py +189 -0
  111. hfl-0.1.0/src/hfl/models/manifest.py +154 -0
  112. hfl-0.1.0/src/hfl/models/provenance.py +190 -0
  113. hfl-0.1.0/src/hfl/models/registry.py +450 -0
  114. hfl-0.1.0/src/hfl/plugins.py +215 -0
  115. hfl-0.1.0/src/hfl/security.py +378 -0
  116. hfl-0.1.0/src/hfl/utils/__init__.py +3 -0
  117. hfl-0.1.0/src/hfl/utils/circuit_breaker.py +196 -0
  118. hfl-0.1.0/src/hfl/utils/retry.py +177 -0
  119. hfl-0.1.0/src/hfl/validators.py +450 -0
  120. hfl-0.1.0/tests/__init__.py +3 -0
  121. hfl-0.1.0/tests/conftest.py +189 -0
  122. hfl-0.1.0/tests/stress/__init__.py +2 -0
  123. hfl-0.1.0/tests/stress/test_concurrent_streaming.py +151 -0
  124. hfl-0.1.0/tests/stress/test_model_pool_stress.py +177 -0
  125. hfl-0.1.0/tests/test_api.py +461 -0
  126. hfl-0.1.0/tests/test_api_auth.py +278 -0
  127. hfl-0.1.0/tests/test_api_contracts.py +344 -0
  128. hfl-0.1.0/tests/test_api_model_loading.py +152 -0
  129. hfl-0.1.0/tests/test_api_schemas.py +290 -0
  130. hfl-0.1.0/tests/test_async_wrapper.py +196 -0
  131. hfl-0.1.0/tests/test_audit.py +261 -0
  132. hfl-0.1.0/tests/test_auth.py +144 -0
  133. hfl-0.1.0/tests/test_circuit_breaker.py +208 -0
  134. hfl-0.1.0/tests/test_cli.py +1041 -0
  135. hfl-0.1.0/tests/test_cli_commands.py +188 -0
  136. hfl-0.1.0/tests/test_cli_extended.py +94 -0
  137. hfl-0.1.0/tests/test_cli_helpers.py +155 -0
  138. hfl-0.1.0/tests/test_cli_signal.py +67 -0
  139. hfl-0.1.0/tests/test_concurrency.py +294 -0
  140. hfl-0.1.0/tests/test_config.py +226 -0
  141. hfl-0.1.0/tests/test_config_env.py +90 -0
  142. hfl-0.1.0/tests/test_container.py +443 -0
  143. hfl-0.1.0/tests/test_conversion_caching.py +386 -0
  144. hfl-0.1.0/tests/test_converter.py +638 -0
  145. hfl-0.1.0/tests/test_converter_edge_cases.py +158 -0
  146. hfl-0.1.0/tests/test_converter_extended.py +139 -0
  147. hfl-0.1.0/tests/test_converters.py +347 -0
  148. hfl-0.1.0/tests/test_dependency_check.py +265 -0
  149. hfl-0.1.0/tests/test_deprecation.py +142 -0
  150. hfl-0.1.0/tests/test_downloader.py +106 -0
  151. hfl-0.1.0/tests/test_downloader_extended.py +127 -0
  152. hfl-0.1.0/tests/test_edge_cases.py +436 -0
  153. hfl-0.1.0/tests/test_engine.py +502 -0
  154. hfl-0.1.0/tests/test_engine_base.py +432 -0
  155. hfl-0.1.0/tests/test_engine_observability.py +347 -0
  156. hfl-0.1.0/tests/test_errors.py +184 -0
  157. hfl-0.1.0/tests/test_events.py +216 -0
  158. hfl-0.1.0/tests/test_exception_handlers.py +81 -0
  159. hfl-0.1.0/tests/test_exceptions.py +231 -0
  160. hfl-0.1.0/tests/test_failover.py +270 -0
  161. hfl-0.1.0/tests/test_health_probe.py +69 -0
  162. hfl-0.1.0/tests/test_helpers.py +841 -0
  163. hfl-0.1.0/tests/test_hub.py +418 -0
  164. hfl-0.1.0/tests/test_hub_client.py +141 -0
  165. hfl-0.1.0/tests/test_i18n.py +243 -0
  166. hfl-0.1.0/tests/test_i18n_edge_cases.py +194 -0
  167. hfl-0.1.0/tests/test_i18n_extended.py +375 -0
  168. hfl-0.1.0/tests/test_i18n_fallback.py +231 -0
  169. hfl-0.1.0/tests/test_integration.py +293 -0
  170. hfl-0.1.0/tests/test_license_checker.py +394 -0
  171. hfl-0.1.0/tests/test_logging.py +253 -0
  172. hfl-0.1.0/tests/test_memory_tracking.py +347 -0
  173. hfl-0.1.0/tests/test_metrics.py +231 -0
  174. hfl-0.1.0/tests/test_middleware.py +286 -0
  175. hfl-0.1.0/tests/test_middleware_order.py +149 -0
  176. hfl-0.1.0/tests/test_model_integrity.py +333 -0
  177. hfl-0.1.0/tests/test_model_loader.py +419 -0
  178. hfl-0.1.0/tests/test_model_pool.py +566 -0
  179. hfl-0.1.0/tests/test_model_pool_wait.py +84 -0
  180. hfl-0.1.0/tests/test_network_errors.py +258 -0
  181. hfl-0.1.0/tests/test_observability_setup.py +117 -0
  182. hfl-0.1.0/tests/test_openai_compatibility.py +359 -0
  183. hfl-0.1.0/tests/test_per_model_rate_limit.py +223 -0
  184. hfl-0.1.0/tests/test_plugins.py +395 -0
  185. hfl-0.1.0/tests/test_prompt_builder.py +370 -0
  186. hfl-0.1.0/tests/test_prompt_sanitization.py +421 -0
  187. hfl-0.1.0/tests/test_provenance.py +249 -0
  188. hfl-0.1.0/tests/test_rate_limit.py +433 -0
  189. hfl-0.1.0/tests/test_registry.py +772 -0
  190. hfl-0.1.0/tests/test_registry_backends.py +297 -0
  191. hfl-0.1.0/tests/test_registry_recovery.py +337 -0
  192. hfl-0.1.0/tests/test_resolver_edge_cases.py +129 -0
  193. hfl-0.1.0/tests/test_resolver_extended.py +310 -0
  194. hfl-0.1.0/tests/test_retry.py +205 -0
  195. hfl-0.1.0/tests/test_routes_health.py +188 -0
  196. hfl-0.1.0/tests/test_routes_metrics.py +165 -0
  197. hfl-0.1.0/tests/test_routes_native.py +175 -0
  198. hfl-0.1.0/tests/test_routes_openai_edge_cases.py +238 -0
  199. hfl-0.1.0/tests/test_routes_openai_extended.py +237 -0
  200. hfl-0.1.0/tests/test_routes_tts.py +278 -0
  201. hfl-0.1.0/tests/test_security.py +150 -0
  202. hfl-0.1.0/tests/test_selector.py +458 -0
  203. hfl-0.1.0/tests/test_selector_edge_cases.py +53 -0
  204. hfl-0.1.0/tests/test_selector_extended.py +47 -0
  205. hfl-0.1.0/tests/test_server_lifecycle.py +134 -0
  206. hfl-0.1.0/tests/test_state.py +644 -0
  207. hfl-0.1.0/tests/test_state_concurrency.py +279 -0
  208. hfl-0.1.0/tests/test_streaming.py +413 -0
  209. hfl-0.1.0/tests/test_streaming_edge_cases.py +264 -0
  210. hfl-0.1.0/tests/test_timeout.py +168 -0
  211. hfl-0.1.0/tests/test_tracing.py +262 -0
  212. hfl-0.1.0/tests/test_transformers_engine.py +345 -0
  213. hfl-0.1.0/tests/test_transformers_engine_errors.py +403 -0
  214. hfl-0.1.0/tests/test_transformers_engine_extended.py +324 -0
  215. hfl-0.1.0/tests/test_tts_engine.py +664 -0
  216. hfl-0.1.0/tests/test_tts_engines.py +366 -0
  217. hfl-0.1.0/tests/test_validators.py +310 -0
  218. hfl-0.1.0/tests/test_vllm_engine.py +611 -0
@@ -0,0 +1,2 @@
1
+ github: ggalancs
2
+ custom: https://paypal.me/ggalancs
@@ -0,0 +1,90 @@
1
+ name: Bug Report
2
+ description: Report a bug or unexpected behavior
3
+ title: "[Bug]: "
4
+ labels: ["bug", "triage"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for taking the time to report a bug! Please fill out the form below.
10
+
11
+ - type: textarea
12
+ id: description
13
+ attributes:
14
+ label: Bug Description
15
+ description: A clear and concise description of what the bug is.
16
+ placeholder: "When I run `hfl pull ...`, the following error occurs..."
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: steps
22
+ attributes:
23
+ label: Steps to Reproduce
24
+ description: Steps to reproduce the behavior
25
+ placeholder: |
26
+ 1. Run `hfl pull meta-llama/Llama-3.3-70B-Instruct`
27
+ 2. Wait for download to complete
28
+ 3. See error...
29
+ validations:
30
+ required: true
31
+
32
+ - type: textarea
33
+ id: expected
34
+ attributes:
35
+ label: Expected Behavior
36
+ description: What you expected to happen
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: actual
42
+ attributes:
43
+ label: Actual Behavior
44
+ description: What actually happened
45
+ validations:
46
+ required: true
47
+
48
+ - type: input
49
+ id: version
50
+ attributes:
51
+ label: hfl Version
52
+ description: "Output of `hfl version`"
53
+ placeholder: "hfl v0.1.0"
54
+ validations:
55
+ required: true
56
+
57
+ - type: dropdown
58
+ id: os
59
+ attributes:
60
+ label: Operating System
61
+ options:
62
+ - macOS
63
+ - Linux (Ubuntu/Debian)
64
+ - Linux (Other)
65
+ - Windows
66
+ - Other
67
+ validations:
68
+ required: true
69
+
70
+ - type: input
71
+ id: python
72
+ attributes:
73
+ label: Python Version
74
+ description: "Output of `python --version`"
75
+ placeholder: "Python 3.12.0"
76
+ validations:
77
+ required: true
78
+
79
+ - type: textarea
80
+ id: logs
81
+ attributes:
82
+ label: Error Logs
83
+ description: Paste any relevant error messages or logs
84
+ render: shell
85
+
86
+ - type: textarea
87
+ id: additional
88
+ attributes:
89
+ label: Additional Context
90
+ description: Any other relevant information (hardware, model being used, etc.)
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://github.com/ggalancs/hfl#readme
5
+ about: Check the README for usage instructions
6
+ - name: Discussions
7
+ url: https://github.com/ggalancs/hfl/discussions
8
+ about: Ask questions and discuss features
@@ -0,0 +1,54 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature or improvement
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for suggesting a feature! Please describe your idea below.
10
+
11
+ - type: textarea
12
+ id: problem
13
+ attributes:
14
+ label: Problem Statement
15
+ description: What problem does this feature solve? Is it related to a frustration?
16
+ placeholder: "I'm always frustrated when..."
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: solution
22
+ attributes:
23
+ label: Proposed Solution
24
+ description: Describe the solution you'd like
25
+ placeholder: "It would be great if hfl could..."
26
+ validations:
27
+ required: true
28
+
29
+ - type: textarea
30
+ id: alternatives
31
+ attributes:
32
+ label: Alternatives Considered
33
+ description: Any alternative solutions or features you've considered
34
+
35
+ - type: dropdown
36
+ id: component
37
+ attributes:
38
+ label: Component
39
+ description: Which part of hfl does this relate to?
40
+ options:
41
+ - CLI (commands, flags)
42
+ - API Server
43
+ - Model Download/Conversion
44
+ - Inference Engine
45
+ - Documentation
46
+ - Other
47
+ validations:
48
+ required: true
49
+
50
+ - type: textarea
51
+ id: additional
52
+ attributes:
53
+ label: Additional Context
54
+ description: Any other context, screenshots, or examples
@@ -0,0 +1,47 @@
1
+ ## Description
2
+
3
+ <!-- Describe your changes in detail -->
4
+
5
+ ## Type of Change
6
+
7
+ <!-- Mark the relevant option with an [x] -->
8
+
9
+ - [ ] Bug fix (non-breaking change that fixes an issue)
10
+ - [ ] New feature (non-breaking change that adds functionality)
11
+ - [ ] Breaking change (fix or feature that would cause existing functionality to change)
12
+ - [ ] Documentation update
13
+ - [ ] Refactoring (no functional changes)
14
+
15
+ ## Related Issues
16
+
17
+ <!-- Link any related issues using #issue_number -->
18
+
19
+ Closes #
20
+
21
+ ## Checklist
22
+
23
+ - [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) guidelines
24
+ - [ ] My code follows the project's code style (ruff)
25
+ - [ ] I have added tests that prove my fix/feature works
26
+ - [ ] All new and existing tests pass (`pytest`)
27
+ - [ ] I have updated documentation if needed
28
+
29
+ ## Compliance Modules
30
+
31
+ <!-- If your changes affect any of these, explain how they're preserved -->
32
+
33
+ Per the HRUL license, these modules must maintain their functionality:
34
+
35
+ - [ ] License Verification - unchanged / updated to maintain functionality
36
+ - [ ] Provenance Tracking - unchanged / updated to maintain functionality
37
+ - [ ] AI Disclaimer - unchanged / updated to maintain functionality
38
+ - [ ] Privacy Protection - unchanged / updated to maintain functionality
39
+ - [ ] Gating Respect - unchanged / updated to maintain functionality
40
+
41
+ ## Screenshots (if applicable)
42
+
43
+ <!-- Add screenshots to help explain your changes -->
44
+
45
+ ## Additional Notes
46
+
47
+ <!-- Any additional information reviewers should know -->
@@ -0,0 +1,39 @@
1
+ version: 2
2
+ updates:
3
+ # Python dependencies
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "monday"
9
+ open-pull-requests-limit: 5
10
+ reviewers:
11
+ - "ggalancs" # Adjust to your GitHub username
12
+ labels:
13
+ - "dependencies"
14
+ - "python"
15
+ commit-message:
16
+ prefix: "deps"
17
+ groups:
18
+ dev-dependencies:
19
+ patterns:
20
+ - "pytest*"
21
+ - "ruff"
22
+ - "mypy"
23
+ - "coverage"
24
+ ml-dependencies:
25
+ patterns:
26
+ - "torch*"
27
+ - "transformers*"
28
+ - "llama-cpp*"
29
+
30
+ # GitHub Actions
31
+ - package-ecosystem: "github-actions"
32
+ directory: "/"
33
+ schedule:
34
+ interval: "weekly"
35
+ labels:
36
+ - "dependencies"
37
+ - "github-actions"
38
+ commit-message:
39
+ prefix: "ci"
@@ -0,0 +1,147 @@
1
+ name: Build Executables
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: 'Version tag (e.g., v0.1.0)'
8
+ required: false
9
+ default: 'dev'
10
+ include_llama:
11
+ description: 'Include llama-cpp-python (larger binary)'
12
+ required: false
13
+ type: boolean
14
+ default: false
15
+
16
+ jobs:
17
+ build:
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ include:
22
+ - os: ubuntu-latest
23
+ platform: linux
24
+ artifact_name: hfl-linux-x86_64
25
+ - os: macos-latest
26
+ platform: macos
27
+ artifact_name: hfl-macos-x86_64
28
+ - os: macos-14
29
+ platform: macos-arm
30
+ artifact_name: hfl-macos-arm64
31
+ - os: windows-latest
32
+ platform: windows
33
+ artifact_name: hfl-windows-x86_64
34
+
35
+ runs-on: ${{ matrix.os }}
36
+
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: "3.12"
44
+
45
+ - name: Install dependencies
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ pip install pyinstaller
49
+ pip install -e .
50
+
51
+ - name: Install llama-cpp-python (optional)
52
+ if: ${{ inputs.include_llama }}
53
+ run: |
54
+ pip install llama-cpp-python
55
+ env:
56
+ CMAKE_ARGS: ${{ matrix.platform == 'macos' && '-DGGML_METAL=ON' || matrix.platform == 'macos-arm' && '-DGGML_METAL=ON' || '' }}
57
+
58
+ - name: Build executable
59
+ run: |
60
+ pyinstaller hfl.spec --clean
61
+
62
+ - name: Test executable (Unix)
63
+ if: matrix.platform != 'windows'
64
+ run: |
65
+ chmod +x dist/hfl
66
+ ./dist/hfl version
67
+ ./dist/hfl --help
68
+
69
+ - name: Test executable (Windows)
70
+ if: matrix.platform == 'windows'
71
+ run: |
72
+ ./dist/hfl.exe version
73
+ ./dist/hfl.exe --help
74
+
75
+ - name: Rename artifact (Unix)
76
+ if: matrix.platform != 'windows'
77
+ run: |
78
+ mv dist/hfl dist/${{ matrix.artifact_name }}
79
+
80
+ - name: Rename artifact (Windows)
81
+ if: matrix.platform == 'windows'
82
+ run: |
83
+ mv dist/hfl.exe dist/${{ matrix.artifact_name }}.exe
84
+
85
+ - name: Upload artifact
86
+ uses: actions/upload-artifact@v4
87
+ with:
88
+ name: ${{ matrix.artifact_name }}
89
+ path: dist/${{ matrix.artifact_name }}${{ matrix.platform == 'windows' && '.exe' || '' }}
90
+ retention-days: 30
91
+
92
+ release:
93
+ needs: build
94
+ runs-on: ubuntu-latest
95
+ if: ${{ inputs.version != 'dev' }}
96
+
97
+ steps:
98
+ - name: Download all artifacts
99
+ uses: actions/download-artifact@v4
100
+ with:
101
+ path: artifacts
102
+
103
+ - name: Create checksums
104
+ run: |
105
+ cd artifacts
106
+ find . -type f \( -name "hfl-*" \) -exec sha256sum {} \; > checksums.txt
107
+ cat checksums.txt
108
+
109
+ - name: Create Release
110
+ uses: softprops/action-gh-release@v1
111
+ with:
112
+ tag_name: ${{ inputs.version }}
113
+ name: hfl ${{ inputs.version }}
114
+ draft: true
115
+ files: |
116
+ artifacts/hfl-linux-x86_64/*
117
+ artifacts/hfl-macos-x86_64/*
118
+ artifacts/hfl-macos-arm64/*
119
+ artifacts/hfl-windows-x86_64/*
120
+ artifacts/checksums.txt
121
+ body: |
122
+ ## hfl ${{ inputs.version }}
123
+
124
+ ### Downloads
125
+
126
+ | Platform | Architecture | File |
127
+ |----------|-------------|------|
128
+ | Linux | x86_64 | `hfl-linux-x86_64` |
129
+ | macOS | x86_64 (Intel) | `hfl-macos-x86_64` |
130
+ | macOS | arm64 (Apple Silicon) | `hfl-macos-arm64` |
131
+ | Windows | x86_64 | `hfl-windows-x86_64.exe` |
132
+
133
+ ### Installation
134
+
135
+ **Linux/macOS:**
136
+ ```bash
137
+ chmod +x hfl-*
138
+ sudo mv hfl-* /usr/local/bin/hfl
139
+ ```
140
+
141
+ **Windows:**
142
+ Move `hfl-windows-x86_64.exe` to a folder in your PATH, or run directly.
143
+
144
+ ### Verify checksums
145
+ ```bash
146
+ sha256sum -c checksums.txt
147
+ ```
@@ -0,0 +1,90 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+ workflow_dispatch: # Allow manual triggering
9
+
10
+ jobs:
11
+ test:
12
+ name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ os: [ubuntu-latest, macos-latest]
18
+ python-version: ["3.10", "3.11", "3.12"]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Cache pip packages
29
+ uses: actions/cache@v4
30
+ with:
31
+ path: ~/.cache/pip
32
+ key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
33
+ restore-keys: |
34
+ ${{ runner.os }}-pip-
35
+
36
+ - name: Install dependencies
37
+ run: |
38
+ python -m pip install --upgrade pip
39
+ pip install -e ".[dev]"
40
+
41
+ - name: Run tests
42
+ run: |
43
+ pytest tests/ --cov=hfl --cov-report=xml --cov-report=term-missing
44
+
45
+ - name: Upload coverage to Codecov
46
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
47
+ uses: codecov/codecov-action@v4
48
+ with:
49
+ file: ./coverage.xml
50
+ fail_ci_if_error: false
51
+
52
+ lint:
53
+ name: Lint
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+
58
+ - name: Set up Python
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Install ruff
64
+ run: pip install ruff
65
+
66
+ - name: Run ruff check
67
+ run: ruff check src/hfl tests/
68
+
69
+ - name: Run ruff format check
70
+ run: ruff format --check src/hfl tests/
71
+
72
+ type-check:
73
+ name: Type Check
74
+ runs-on: ubuntu-latest
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+
78
+ - name: Set up Python
79
+ uses: actions/setup-python@v5
80
+ with:
81
+ python-version: "3.12"
82
+
83
+ - name: Install dependencies
84
+ run: |
85
+ python -m pip install --upgrade pip
86
+ pip install -e ".[dev]"
87
+
88
+ - name: Run mypy
89
+ run: |
90
+ mypy src/hfl/api/ src/hfl/cli/ --ignore-missing-imports
@@ -0,0 +1,41 @@
1
+ # R7 - License Check (Legal Audit)
2
+ # Prevents introduction of copyleft dependencies
3
+
4
+ name: License Check
5
+
6
+ on:
7
+ workflow_dispatch: # Solo ejecución manual
8
+
9
+ jobs:
10
+ check-licenses:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - name: Install dependencies
21
+ run: |
22
+ pip install "pip-licenses>=4.0,<5.0"
23
+ pip install -e .
24
+
25
+ - name: Check for copyleft licenses
26
+ run: |
27
+ echo "Checking for GPL/AGPL/LGPL licenses..."
28
+ pip-licenses -f plain -u --fail-on="GPL;GPLv2;GPLv3;AGPL;AGPLv3;LGPL;LGPLv2;LGPLv3"
29
+
30
+ - name: Generate license report
31
+ if: always()
32
+ run: |
33
+ pip-licenses -f markdown -u > license-report.md
34
+ cat license-report.md
35
+
36
+ - name: Upload license report
37
+ if: always()
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: license-report
41
+ path: license-report.md
@@ -0,0 +1,43 @@
1
+ name: Lint
2
+
3
+ on:
4
+ workflow_dispatch: # Solo ejecución manual
5
+
6
+ jobs:
7
+ ruff:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v4
11
+
12
+ - name: Set up Python
13
+ uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+
17
+ - name: Install ruff
18
+ run: pip install ruff
19
+
20
+ - name: Run ruff check
21
+ run: ruff check src/ tests/
22
+
23
+ - name: Run ruff format check
24
+ run: ruff format --check src/ tests/
25
+
26
+ mypy:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - name: Set up Python
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "3.12"
35
+
36
+ - name: Install dependencies
37
+ run: |
38
+ pip install -e ".[dev]"
39
+ pip install mypy
40
+
41
+ - name: Run mypy
42
+ run: mypy src/hfl --ignore-missing-imports
43
+ continue-on-error: true # Gradual typing adoption
@@ -0,0 +1,50 @@
1
+ # GitHub Pages deployment workflow
2
+ name: Deploy Documentation to GitHub Pages
3
+
4
+ on:
5
+ push:
6
+ branches: ["main"]
7
+ paths:
8
+ - "docs/**"
9
+ - "README.md"
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ concurrency:
18
+ group: "pages"
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Setup Pages
29
+ uses: actions/configure-pages@v5
30
+
31
+ - name: Create site directory
32
+ run: |
33
+ mkdir -p _site
34
+ cp docs/hfl-architecture-complete.html _site/index.html
35
+ cp docs/hfl-arquitectura-completa.html _site/arquitectura.html
36
+ cp README.md _site/README.md
37
+
38
+ - name: Upload artifact
39
+ uses: actions/upload-pages-artifact@v3
40
+
41
+ deploy:
42
+ environment:
43
+ name: github-pages
44
+ url: ${{ steps.deployment.outputs.page_url }}
45
+ runs-on: ubuntu-latest
46
+ needs: build
47
+ steps:
48
+ - name: Deploy to GitHub Pages
49
+ id: deployment
50
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,81 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Run on version tags like v0.1.0
7
+
8
+ jobs:
9
+ build:
10
+ name: Build Distribution
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.12"
19
+
20
+ - name: Install build tools
21
+ run: pip install build
22
+
23
+ - name: Build package
24
+ run: python -m build
25
+
26
+ - name: Upload distribution artifacts
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ test:
33
+ name: Test Installation
34
+ needs: build
35
+ runs-on: ${{ matrix.os }}
36
+ strategy:
37
+ matrix:
38
+ os: [ubuntu-latest, macos-latest]
39
+ python-version: ["3.10", "3.12"]
40
+
41
+ steps:
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v5
44
+ with:
45
+ python-version: ${{ matrix.python-version }}
46
+
47
+ - name: Download distribution
48
+ uses: actions/download-artifact@v4
49
+ with:
50
+ name: dist
51
+ path: dist/
52
+
53
+ - name: Install from wheel
54
+ run: pip install dist/*.whl
55
+
56
+ - name: Test CLI
57
+ run: |
58
+ hfl --help
59
+ hfl --version || true
60
+
61
+ publish:
62
+ name: Publish to PyPI
63
+ needs: [build, test]
64
+ runs-on: ubuntu-latest
65
+ environment:
66
+ name: pypi
67
+ url: https://pypi.org/project/hfl/
68
+
69
+ permissions:
70
+ id-token: write # Required for trusted publishing
71
+
72
+ steps:
73
+ - name: Download distribution
74
+ uses: actions/download-artifact@v4
75
+ with:
76
+ name: dist
77
+ path: dist/
78
+
79
+ - name: Publish to PyPI
80
+ uses: pypa/gh-action-pypi-publish@release/v1
81
+ # Uses trusted publishing - no API token needed