tribunal-kit 9.2.3 → 9.2.4

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 (563) hide show
  1. package/.agent/.tribunal/session.jsonl +15 -0
  2. package/.agent/ARCHITECTURE.md +4 -4
  3. package/.agent/agents/agent-shield-auditor.md +18 -0
  4. package/.agent/agents/harness-manager.md +49 -0
  5. package/.agent/agents/human-gate-negotiator.md +22 -0
  6. package/.agent/agents/kernel-scheduler.md +56 -0
  7. package/.agent/agents/memory-archivist.md +37 -0
  8. package/.agent/agents/orchestrator.md +5 -0
  9. package/.agent/agents/project-planner.md +5 -0
  10. package/.agent/agents/security-auditor.md +5 -0
  11. package/.agent/rules/GEMINI.md +1 -1
  12. package/.agent/scripts/_utils.js +1 -1
  13. package/.agent/scripts/checklist.js +1 -1
  14. package/.agent/scripts/context_compiler.js +1 -1
  15. package/.agent/scripts/guardrail_engine.js +1 -1
  16. package/.agent/scripts/harness_manager.js +60 -0
  17. package/.agent/scripts/lint_runner.js +1 -1
  18. package/.agent/scripts/mcp_server.js +181 -0
  19. package/.agent/scripts/memory_archivist.js +97 -0
  20. package/.agent/scripts/memory_consolidator.js +37 -0
  21. package/.agent/scripts/memory_engine.js +61 -21
  22. package/.agent/scripts/pipeline_engine.js +17 -2
  23. package/.agent/scripts/session_logger.js +115 -0
  24. package/.agent/scripts/session_manager.js +10 -0
  25. package/.agent/scripts/swarm_dispatcher.js +74 -1
  26. package/.agent/scripts/syscall_registry.js +105 -0
  27. package/.agent/scripts/test_runner.js +1 -1
  28. package/.agent/scripts/verify_all.js +2 -2
  29. package/.agent/skill_topic_map.json +28 -1
  30. package/.agent/skills/agent-syscall-guidelines/SKILL.md +25 -0
  31. package/.agent/skills/agentic-workflows-2026/SKILL.md +8 -0
  32. package/.agent/skills/agentshield-security/SKILL.md +26 -0
  33. package/.agent/skills/context-engineering-pro/SKILL.md +7 -0
  34. package/.agent/skills/fabel-protocol/SKILL.md +5 -0
  35. package/.agent/skills/graph-engineering/SKILL.md +28 -0
  36. package/.agent/skills/harness-protocol/SKILL.md +8 -0
  37. package/.agent/skills/hf-cli/SKILL.md +239 -0
  38. package/.agent/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  39. package/.agent/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  40. package/.agent/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  41. package/.agent/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  42. package/.agent/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  43. package/.agent/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  44. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  45. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  46. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  47. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  48. package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  49. package/.agent/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  50. package/.agent/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  51. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  52. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  53. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  54. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  55. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  56. package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  57. package/.agent/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  58. package/.agent/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  59. package/.agent/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  60. package/.agent/skills/hf-mem/SKILL.md +79 -0
  61. package/.agent/skills/huggingface-best/SKILL.md +134 -0
  62. package/.agent/skills/huggingface-community-evals/SKILL.md +207 -0
  63. package/.agent/skills/huggingface-community-evals/examples/.env.example +3 -0
  64. package/.agent/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  65. package/.agent/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  66. package/.agent/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  67. package/.agent/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  68. package/.agent/skills/huggingface-datasets/SKILL.md +107 -0
  69. package/.agent/skills/huggingface-gradio/SKILL.md +298 -0
  70. package/.agent/skills/huggingface-gradio/examples.md +613 -0
  71. package/.agent/skills/huggingface-llm-trainer/SKILL.md +738 -0
  72. package/.agent/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  73. package/.agent/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  74. package/.agent/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  75. package/.agent/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  76. package/.agent/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  77. package/.agent/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  78. package/.agent/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  79. package/.agent/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  80. package/.agent/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  81. package/.agent/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  82. package/.agent/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  83. package/.agent/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  84. package/.agent/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  85. package/.agent/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  86. package/.agent/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  87. package/.agent/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  88. package/.agent/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  89. package/.agent/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  90. package/.agent/skills/huggingface-local-models/SKILL.md +113 -0
  91. package/.agent/skills/huggingface-local-models/references/hardware.md +38 -0
  92. package/.agent/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  93. package/.agent/skills/huggingface-local-models/references/quantization.md +256 -0
  94. package/.agent/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  95. package/.agent/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  96. package/.agent/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  97. package/.agent/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  98. package/.agent/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  99. package/.agent/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  100. package/.agent/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  101. package/.agent/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  102. package/.agent/skills/huggingface-paper-publisher/SKILL.md +624 -0
  103. package/.agent/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  104. package/.agent/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  105. package/.agent/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  106. package/.agent/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  107. package/.agent/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  108. package/.agent/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  109. package/.agent/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  110. package/.agent/skills/huggingface-papers/SKILL.md +239 -0
  111. package/.agent/skills/huggingface-spaces/README.md +9 -0
  112. package/.agent/skills/huggingface-spaces/SKILL.md +242 -0
  113. package/.agent/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  114. package/.agent/skills/huggingface-spaces/references/3d-generation.md +98 -0
  115. package/.agent/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  116. package/.agent/skills/huggingface-spaces/references/3d-models.md +227 -0
  117. package/.agent/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  118. package/.agent/skills/huggingface-spaces/references/buckets.md +89 -0
  119. package/.agent/skills/huggingface-spaces/references/debugging.md +236 -0
  120. package/.agent/skills/huggingface-spaces/references/gradio.md +200 -0
  121. package/.agent/skills/huggingface-spaces/references/grants.md +63 -0
  122. package/.agent/skills/huggingface-spaces/references/inference-providers.md +97 -0
  123. package/.agent/skills/huggingface-spaces/references/known-errors.md +232 -0
  124. package/.agent/skills/huggingface-spaces/references/requirements.md +169 -0
  125. package/.agent/skills/huggingface-spaces/references/zerogpu.md +349 -0
  126. package/.agent/skills/huggingface-tool-builder/SKILL.md +120 -0
  127. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  128. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  129. package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  130. package/.agent/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  131. package/.agent/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  132. package/.agent/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  133. package/.agent/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  134. package/.agent/skills/huggingface-trackio/SKILL.md +142 -0
  135. package/.agent/skills/huggingface-trackio/references/alerts.md +196 -0
  136. package/.agent/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  137. package/.agent/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  138. package/.agent/skills/huggingface-vision-trainer/SKILL.md +593 -0
  139. package/.agent/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  140. package/.agent/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  141. package/.agent/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  142. package/.agent/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  143. package/.agent/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  144. package/.agent/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  145. package/.agent/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  146. package/.agent/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  147. package/.agent/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  148. package/.agent/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  149. package/.agent/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  150. package/.agent/skills/huggingface-zerogpu/SKILL.md +289 -0
  151. package/.agent/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  152. package/.agent/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  153. package/.agent/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  154. package/.agent/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  155. package/.agent/skills/human-gate-negotiation/SKILL.md +30 -0
  156. package/.agent/skills/intelligent-routing/SKILL.md +10 -4
  157. package/.agent/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  158. package/.agent/skills/session-log-interrogation/SKILL.md +29 -0
  159. package/.agent/skills/subagent-driven-development/SKILL.md +32 -0
  160. package/.agent/skills/systematic-debugging/SKILL.md +5 -0
  161. package/.agent/skills/train-sentence-transformers/SKILL.md +109 -0
  162. package/.agent/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  163. package/.agent/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  164. package/.agent/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  165. package/.agent/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  166. package/.agent/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  167. package/.agent/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  168. package/.agent/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  169. package/.agent/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  170. package/.agent/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  171. package/.agent/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  172. package/.agent/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  173. package/.agent/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  174. package/.agent/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  175. package/.agent/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  176. package/.agent/skills/train-sentence-transformers/references/training_args.md +270 -0
  177. package/.agent/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  178. package/.agent/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  179. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  180. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  181. package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  182. package/.agent/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  183. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  184. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  185. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  186. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  187. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  188. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  189. package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  190. package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  191. package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  192. package/.agent/skills/transformers-js/SKILL.md +692 -0
  193. package/.agent/skills/transformers-js/references/CACHE.md +339 -0
  194. package/.agent/skills/transformers-js/references/CONFIGURATION.md +438 -0
  195. package/.agent/skills/transformers-js/references/EXAMPLES.md +620 -0
  196. package/.agent/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  197. package/.agent/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  198. package/.agent/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  199. package/.agent/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  200. package/.agent/skills/tribunal-instincts-memory/SKILL.md +31 -0
  201. package/.agent/skills/trl-training/SKILL.md +318 -0
  202. package/.agent/workflows/assimilate.md +21 -0
  203. package/.agent/workflows/audit.md +5 -0
  204. package/.agent/workflows/generate.md +5 -0
  205. package/.agent/workflows/htop.md +22 -0
  206. package/.agent/workflows/marathon.md +5 -0
  207. package/.agent/workflows/resume.md +20 -0
  208. package/.agent/workflows/team-mode.md +22 -0
  209. package/.agents/skills/agent-syscall-guidelines/SKILL.md +25 -0
  210. package/.agents/skills/agentic-workflows-2026/SKILL.md +8 -0
  211. package/.agents/skills/agentshield-security/SKILL.md +26 -0
  212. package/.agents/skills/context-engineering-pro/SKILL.md +7 -0
  213. package/.agents/skills/fabel-protocol/SKILL.md +5 -0
  214. package/.agents/skills/graph-engineering/SKILL.md +28 -0
  215. package/.agents/skills/harness-protocol/SKILL.md +8 -0
  216. package/.agents/skills/hf-cli/SKILL.md +239 -0
  217. package/.agents/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  218. package/.agents/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  219. package/.agents/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  220. package/.agents/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  221. package/.agents/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  222. package/.agents/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  223. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  224. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  225. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  226. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  227. package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  228. package/.agents/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  229. package/.agents/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  230. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  231. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  232. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  233. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  234. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  235. package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  236. package/.agents/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  237. package/.agents/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  238. package/.agents/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  239. package/.agents/skills/hf-mem/SKILL.md +79 -0
  240. package/.agents/skills/huggingface-best/SKILL.md +134 -0
  241. package/.agents/skills/huggingface-community-evals/SKILL.md +207 -0
  242. package/.agents/skills/huggingface-community-evals/examples/.env.example +3 -0
  243. package/.agents/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  244. package/.agents/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  245. package/.agents/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  246. package/.agents/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  247. package/.agents/skills/huggingface-datasets/SKILL.md +107 -0
  248. package/.agents/skills/huggingface-gradio/SKILL.md +298 -0
  249. package/.agents/skills/huggingface-gradio/examples.md +613 -0
  250. package/.agents/skills/huggingface-llm-trainer/SKILL.md +738 -0
  251. package/.agents/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  252. package/.agents/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  253. package/.agents/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  254. package/.agents/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  255. package/.agents/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  256. package/.agents/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  257. package/.agents/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  258. package/.agents/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  259. package/.agents/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  260. package/.agents/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  261. package/.agents/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  262. package/.agents/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  263. package/.agents/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  264. package/.agents/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  265. package/.agents/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  266. package/.agents/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  267. package/.agents/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  268. package/.agents/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  269. package/.agents/skills/huggingface-local-models/SKILL.md +113 -0
  270. package/.agents/skills/huggingface-local-models/references/hardware.md +38 -0
  271. package/.agents/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  272. package/.agents/skills/huggingface-local-models/references/quantization.md +256 -0
  273. package/.agents/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  274. package/.agents/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  275. package/.agents/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  276. package/.agents/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  277. package/.agents/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  278. package/.agents/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  279. package/.agents/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  280. package/.agents/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  281. package/.agents/skills/huggingface-paper-publisher/SKILL.md +624 -0
  282. package/.agents/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  283. package/.agents/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  284. package/.agents/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  285. package/.agents/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  286. package/.agents/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  287. package/.agents/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  288. package/.agents/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  289. package/.agents/skills/huggingface-papers/SKILL.md +239 -0
  290. package/.agents/skills/huggingface-spaces/README.md +9 -0
  291. package/.agents/skills/huggingface-spaces/SKILL.md +242 -0
  292. package/.agents/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  293. package/.agents/skills/huggingface-spaces/references/3d-generation.md +98 -0
  294. package/.agents/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  295. package/.agents/skills/huggingface-spaces/references/3d-models.md +227 -0
  296. package/.agents/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  297. package/.agents/skills/huggingface-spaces/references/buckets.md +89 -0
  298. package/.agents/skills/huggingface-spaces/references/debugging.md +236 -0
  299. package/.agents/skills/huggingface-spaces/references/gradio.md +200 -0
  300. package/.agents/skills/huggingface-spaces/references/grants.md +63 -0
  301. package/.agents/skills/huggingface-spaces/references/inference-providers.md +97 -0
  302. package/.agents/skills/huggingface-spaces/references/known-errors.md +232 -0
  303. package/.agents/skills/huggingface-spaces/references/requirements.md +169 -0
  304. package/.agents/skills/huggingface-spaces/references/zerogpu.md +349 -0
  305. package/.agents/skills/huggingface-tool-builder/SKILL.md +120 -0
  306. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  307. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  308. package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  309. package/.agents/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  310. package/.agents/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  311. package/.agents/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  312. package/.agents/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  313. package/.agents/skills/huggingface-trackio/SKILL.md +142 -0
  314. package/.agents/skills/huggingface-trackio/references/alerts.md +196 -0
  315. package/.agents/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  316. package/.agents/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  317. package/.agents/skills/huggingface-vision-trainer/SKILL.md +593 -0
  318. package/.agents/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  319. package/.agents/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  320. package/.agents/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  321. package/.agents/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  322. package/.agents/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  323. package/.agents/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  324. package/.agents/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  325. package/.agents/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  326. package/.agents/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  327. package/.agents/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  328. package/.agents/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  329. package/.agents/skills/huggingface-zerogpu/SKILL.md +289 -0
  330. package/.agents/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  331. package/.agents/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  332. package/.agents/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  333. package/.agents/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  334. package/.agents/skills/human-gate-negotiation/SKILL.md +30 -0
  335. package/.agents/skills/intelligent-routing/SKILL.md +10 -4
  336. package/.agents/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  337. package/.agents/skills/session-log-interrogation/SKILL.md +29 -0
  338. package/.agents/skills/subagent-driven-development/SKILL.md +32 -0
  339. package/.agents/skills/systematic-debugging/SKILL.md +5 -0
  340. package/.agents/skills/train-sentence-transformers/SKILL.md +109 -0
  341. package/.agents/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  342. package/.agents/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  343. package/.agents/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  344. package/.agents/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  345. package/.agents/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  346. package/.agents/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  347. package/.agents/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  348. package/.agents/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  349. package/.agents/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  350. package/.agents/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  351. package/.agents/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  352. package/.agents/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  353. package/.agents/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  354. package/.agents/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  355. package/.agents/skills/train-sentence-transformers/references/training_args.md +270 -0
  356. package/.agents/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  357. package/.agents/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  358. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  359. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  360. package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  361. package/.agents/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  362. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  363. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  364. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  365. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  366. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  367. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  368. package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  369. package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  370. package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  371. package/.agents/skills/transformers-js/SKILL.md +692 -0
  372. package/.agents/skills/transformers-js/references/CACHE.md +339 -0
  373. package/.agents/skills/transformers-js/references/CONFIGURATION.md +438 -0
  374. package/.agents/skills/transformers-js/references/EXAMPLES.md +620 -0
  375. package/.agents/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  376. package/.agents/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  377. package/.agents/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  378. package/.agents/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  379. package/.agents/skills/tribunal-instincts-memory/SKILL.md +31 -0
  380. package/.agents/skills/trl-training/SKILL.md +318 -0
  381. package/CONTRIBUTING.md +2 -2
  382. package/README.md +135 -435
  383. package/bin/adapter-install.js +1 -1
  384. package/bin/mcp-server.js +5 -5
  385. package/dist/tui/banner.js +1 -1
  386. package/gemini-extension.json +1 -1
  387. package/mcp_config.json +1 -1
  388. package/package.json +7 -7
  389. package/plugin.json +1 -1
  390. package/scripts/context_compiler.js +1 -1
  391. package/scripts/skill_enhancement_engine.js +6 -6
  392. package/skills/agent-syscall-guidelines/SKILL.md +25 -0
  393. package/skills/agentic-workflows-2026/SKILL.md +8 -0
  394. package/skills/agentshield-security/SKILL.md +26 -0
  395. package/skills/context-engineering-pro/SKILL.md +7 -0
  396. package/skills/fabel-protocol/SKILL.md +5 -0
  397. package/skills/graph-engineering/SKILL.md +28 -0
  398. package/skills/harness-protocol/SKILL.md +8 -0
  399. package/skills/hf-cli/SKILL.md +239 -0
  400. package/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
  401. package/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
  402. package/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
  403. package/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
  404. package/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
  405. package/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
  406. package/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
  407. package/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
  408. package/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
  409. package/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
  410. package/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
  411. package/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
  412. package/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
  413. package/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
  414. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
  415. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
  416. package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
  417. package/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
  418. package/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
  419. package/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
  420. package/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
  421. package/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
  422. package/skills/hf-mem/SKILL.md +79 -0
  423. package/skills/huggingface-best/SKILL.md +134 -0
  424. package/skills/huggingface-community-evals/SKILL.md +207 -0
  425. package/skills/huggingface-community-evals/examples/.env.example +3 -0
  426. package/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  427. package/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
  428. package/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
  429. package/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  430. package/skills/huggingface-datasets/SKILL.md +107 -0
  431. package/skills/huggingface-gradio/SKILL.md +298 -0
  432. package/skills/huggingface-gradio/examples.md +613 -0
  433. package/skills/huggingface-llm-trainer/SKILL.md +738 -0
  434. package/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
  435. package/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
  436. package/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
  437. package/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
  438. package/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
  439. package/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
  440. package/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
  441. package/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
  442. package/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
  443. package/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
  444. package/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
  445. package/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
  446. package/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
  447. package/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
  448. package/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
  449. package/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
  450. package/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
  451. package/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
  452. package/skills/huggingface-local-models/SKILL.md +113 -0
  453. package/skills/huggingface-local-models/references/hardware.md +38 -0
  454. package/skills/huggingface-local-models/references/hub-discovery.md +178 -0
  455. package/skills/huggingface-local-models/references/quantization.md +256 -0
  456. package/skills/huggingface-lora-space-builder/SKILL.md +394 -0
  457. package/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
  458. package/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
  459. package/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
  460. package/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
  461. package/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
  462. package/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
  463. package/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
  464. package/skills/huggingface-paper-publisher/SKILL.md +624 -0
  465. package/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
  466. package/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
  467. package/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
  468. package/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
  469. package/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
  470. package/skills/huggingface-paper-publisher/templates/modern.md +319 -0
  471. package/skills/huggingface-paper-publisher/templates/standard.md +201 -0
  472. package/skills/huggingface-papers/SKILL.md +239 -0
  473. package/skills/huggingface-spaces/README.md +9 -0
  474. package/skills/huggingface-spaces/SKILL.md +242 -0
  475. package/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
  476. package/skills/huggingface-spaces/references/3d-generation.md +98 -0
  477. package/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
  478. package/skills/huggingface-spaces/references/3d-models.md +227 -0
  479. package/skills/huggingface-spaces/references/3d-outputs.md +114 -0
  480. package/skills/huggingface-spaces/references/buckets.md +89 -0
  481. package/skills/huggingface-spaces/references/debugging.md +236 -0
  482. package/skills/huggingface-spaces/references/gradio.md +200 -0
  483. package/skills/huggingface-spaces/references/grants.md +63 -0
  484. package/skills/huggingface-spaces/references/inference-providers.md +97 -0
  485. package/skills/huggingface-spaces/references/known-errors.md +232 -0
  486. package/skills/huggingface-spaces/references/requirements.md +169 -0
  487. package/skills/huggingface-spaces/references/zerogpu.md +349 -0
  488. package/skills/huggingface-tool-builder/SKILL.md +120 -0
  489. package/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
  490. package/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
  491. package/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
  492. package/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
  493. package/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
  494. package/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
  495. package/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
  496. package/skills/huggingface-trackio/SKILL.md +142 -0
  497. package/skills/huggingface-trackio/references/alerts.md +196 -0
  498. package/skills/huggingface-trackio/references/logging_metrics.md +212 -0
  499. package/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
  500. package/skills/huggingface-vision-trainer/SKILL.md +593 -0
  501. package/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  502. package/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
  503. package/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
  504. package/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
  505. package/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
  506. package/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
  507. package/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
  508. package/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
  509. package/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
  510. package/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
  511. package/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  512. package/skills/huggingface-zerogpu/SKILL.md +289 -0
  513. package/skills/huggingface-zerogpu/references/concurrency.md +79 -0
  514. package/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
  515. package/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
  516. package/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
  517. package/skills/human-gate-negotiation/SKILL.md +30 -0
  518. package/skills/intelligent-routing/SKILL.md +10 -4
  519. package/skills/semantic-filesystem-navigation/SKILL.md +24 -0
  520. package/skills/session-log-interrogation/SKILL.md +29 -0
  521. package/skills/subagent-driven-development/SKILL.md +32 -0
  522. package/skills/systematic-debugging/SKILL.md +5 -0
  523. package/skills/train-sentence-transformers/SKILL.md +109 -0
  524. package/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
  525. package/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
  526. package/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
  527. package/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
  528. package/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
  529. package/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
  530. package/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
  531. package/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
  532. package/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
  533. package/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
  534. package/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
  535. package/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
  536. package/skills/train-sentence-transformers/references/model_architectures.md +178 -0
  537. package/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
  538. package/skills/train-sentence-transformers/references/training_args.md +270 -0
  539. package/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
  540. package/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
  541. package/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
  542. package/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
  543. package/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
  544. package/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
  545. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
  546. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
  547. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
  548. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
  549. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
  550. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
  551. package/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
  552. package/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
  553. package/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
  554. package/skills/transformers-js/SKILL.md +692 -0
  555. package/skills/transformers-js/references/CACHE.md +339 -0
  556. package/skills/transformers-js/references/CONFIGURATION.md +438 -0
  557. package/skills/transformers-js/references/EXAMPLES.md +620 -0
  558. package/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  559. package/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
  560. package/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
  561. package/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  562. package/skills/tribunal-instincts-memory/SKILL.md +31 -0
  563. package/skills/trl-training/SKILL.md +318 -0
@@ -0,0 +1,124 @@
1
+ # Tasks: per-task baseline UI patterns
2
+
3
+ This file describes the *baseline* UI shape for each task category. Use it after the LoRA's task is identified, as a starting skeleton. Then read `adapting-to-the-lora.md` to shape the actual UI to the specific LoRA — the baseline is rarely the right final answer.
4
+
5
+ The five tasks: text-to-image, image-to-image, text-to-video, image-to-video, video-to-video.
6
+
7
+ ## Common to all tasks
8
+
9
+ - Layout: two-column `gr.Row` with `equal_height=True`. Inputs on the left, outputs on the right.
10
+ - One primary `gr.Button("Generate", variant="primary", size="lg")`. No secondary buttons unless they do meaningfully different things.
11
+ - An `Advanced` accordion (`gr.Accordion("Advanced", open=False)`) for power-user controls that most users will never touch (seed, randomize seed, advanced sampler params).
12
+ - Always include a seed control with a "Randomize seed" checkbox, and return the actually-used seed alongside the result so users can reproduce.
13
+ - Wire up `prompt.submit` as well as button click for text inputs, so Enter works.
14
+ - Use `gr.Progress(track_tqdm=True)` so diffusers' internal progress bar surfaces.
15
+
16
+ ## Text-to-image (T2I)
17
+
18
+ **Inputs:** prompt (`gr.Textbox`, `lines=2`, with example placeholder). Aspect ratio or resolution control. Optional: negative prompt for models that support it.
19
+
20
+ **Outputs:** `gr.Image` (or `gr.Gallery` if returning more than one).
21
+
22
+ **Standard advanced controls:** seed, randomize seed, num inference steps, guidance scale. Hide steps and guidance entirely for few-step LoRAs (Lightning, Turbo, schnell).
23
+
24
+ **Aspect ratio handling:** offer a dropdown of common ratios with width/height auto-derived. Snap dimensions to the model's native bucket size (16 for most diffusion transformers, 8 for older UNet-based). Show width/height as read-only display.
25
+
26
+ **Examples:** lift example prompts from the LoRA model card into a `gr.Examples` block. Use `cache_examples=True, cache_mode="lazy"` so caching defers to first click instead of failing at build time on ZeroGPU.
27
+
28
+ ## Image-to-image (I2I)
29
+
30
+ **Inputs:** input image (`gr.Image(type="pil")` or `numpy` depending on what your processing wants), instruction or prompt (`gr.Textbox`).
31
+
32
+ **Outputs:** `gr.Image`. For edit LoRAs, consider `gr.ImageSlider` (built-in) for before/after comparison instead of a separate image.
33
+
34
+ **Resolution handling:** for instruction-edit pipelines (Qwen-Image-Edit, Flux Kontext, Flux.2 Klein), resize the input to the nearest multiple of the model's bucket size, preserving aspect. Don't crop unless the LoRA expects a specific aspect.
35
+
36
+ **Validation:** raise `gr.Error("Please upload an image first.")` when the input is empty. Consider disabling Generate until an image is loaded (`run_button.interactive = False`, flip on `input_image.change`).
37
+
38
+ **Sub-task variants change a lot here.** Read `adapting-to-the-lora.md` — relighting, face swap, object move, style transfer, instruction edits, inpainting all live under "I2I" but call for different UIs.
39
+
40
+ ## Text-to-video (T2V)
41
+
42
+ **Inputs:** prompt. Duration slider (1–10 seconds typical, depending on the model's max). Resolution/aspect picker.
43
+
44
+ **Outputs:** `gr.Video(autoplay=True)`. Set `format="mp4"` and pick fps explicitly (24 is a safe default; some models prefer 16 or 30).
45
+
46
+ **Standard advanced controls:** seed, randomize seed, fps. Steps usually locked for distilled video models.
47
+
48
+ **Duration awareness:** set `@spaces.GPU(duration=...)` to comfortably exceed expected generation time. For 5-second 720p video, 180+ seconds of GPU time is realistic. Tell the user in the UI that generation takes a while ("Generating a 5s video takes about 2 minutes").
49
+
50
+ **Frame count math:** most video diffusion models want frame counts that are `8k+1` or similar. Compute `num_frames` from `duration * fps` and round to the nearest valid value rather than passing arbitrary frames. The base-model reference file says what's valid for each model.
51
+
52
+ ## Image-to-video (I2V)
53
+
54
+ **Inputs:** input image (the first frame, or a stylistic reference depending on the LoRA), prompt describing the motion. Duration.
55
+
56
+ **Outputs:** `gr.Video`.
57
+
58
+ **Aspect ratio:** auto-detect from the input image and snap to the model's nearest bucket. Show the chosen resolution as info text.
59
+
60
+ **Variants:** some I2V LoRAs use the input image as the literal first frame; others use it as a stylistic reference and generate a new first frame from the prompt. The model card usually says which. The UI for both is similar; the difference is in how `image=` is passed to the pipeline and whether a "use as first frame" toggle makes sense.
61
+
62
+ ## Video-to-video (V2V)
63
+
64
+ **Inputs:** at minimum, a source video. Almost always also a prompt. Often additional inputs depending on what the LoRA does (reference image for appearance, mask, control video, etc.).
65
+
66
+ **Outputs:** `gr.Video`. For LoRAs that do preprocessing on the input (pose extraction, depth estimation, padding), show the preprocessed intermediate as a second smaller video alongside the result, so the user sees what the model actually saw.
67
+
68
+ **This is where adaptation matters most.** "V2V" alone tells you almost nothing about the UI. Pose-control, depth-control, canny-control, outpainting, inpainting, style transfer, motion transfer, frame interpolation, and upscaling are all V2V and all need different UIs. Always read `adapting-to-the-lora.md` and the per-base-model file before designing.
69
+
70
+ **Common patterns:**
71
+
72
+ - Preprocessing preview: a small `gr.Video(height=240)` showing the extracted pose / depth / canny / padded video. Update it on input change so the user sees the preprocessed result before clicking Generate.
73
+ - Two-input layout for motion-transfer LoRAs: source video + appearance image, clearly labeled.
74
+ - Aspect-ratio picker only when the LoRA actually changes aspect (outpainting). For pose/depth/canny control, output aspect matches input.
75
+
76
+ ## Picking components
77
+
78
+ Walk this ladder in order. Stop at the first rung that fits the LoRA's input shape.
79
+
80
+ **1. Stock Gradio components.** First choice almost always:
81
+
82
+ - `gr.ImageSlider` — built-in before/after comparison for edit LoRAs.
83
+ - `gr.ImageEditor` — upload + paint on top of an image. The right pick for any LoRA whose "input shape" is "a region of the image" expressed by painting — object removal trained on red-highlighted regions, relight trained on colored brush strokes, scribble-conditioned edits. Constrain the brush with `gr.Brush(default_color="#ff0000", colors=["#ff0000"])` so the user can only paint in the color the LoRA was trained on; the editor returns `{"background", "layers", "composite"}` and the `composite` is what you feed the pipeline. Used in production by `linoyts/QIE-2509-Object-Remover-Bbox-v3` (qie-2509-object-remover) — don't reach for `gradio_image_annotation` for these tasks just because the LoRA was trained "with bboxes"; the user-facing shape is a painted region, not a literal box.
84
+ - `@gr.render` — UI that changes shape based on input (e.g. show extra controls only when an input is uploaded).
85
+ - `gr.Examples` — clickable example inputs. Almost always worth including. Lift from the LoRA's model card.
86
+ - `gr.BrowserState` — persist user preferences (preferred aspect ratio, last seed, etc.) across sessions.
87
+ - `gr.DeepLinkButton` — share a specific generation as a URL.
88
+
89
+ **2. Hub custom components.** A `pip install` and an import, no JS to maintain:
90
+
91
+ - `gradio_image_annotation` — bbox/point annotation on top of an image. Right when the LoRA literally needs box *coordinates* as structured input (e.g. drag-and-drop "move from box A to box B" LoRAs, region-tagged edits). Wrong when the LoRA wants a painted region — use `gr.ImageEditor` instead.
92
+ - `gradio_imageslider` — alternative before/after slider with extra controls.
93
+ - `gradio_modal` — modal dialogs.
94
+ - `gradio_rangeslider` — dual-handle range slider.
95
+
96
+ Browse the rest at https://www.gradio.app/custom-components/gallery before going further down the ladder.
97
+
98
+ **3. Creative mode (custom HTML/JS).** When stock and Hub custom components both come up short — point sets, strokes, trajectories, region selections with metadata, 3D rotation gizmos, timeline scrubbers, anything where the user manipulates a thing on top of media. See `creative-mode.md` for the Gradio primitives, the JS↔Python communication contract, and the pitfalls. Don't skip rung 2 to get here — `gradio_image_annotation` already covers a lot of what looks like it needs custom HTML.
99
+
100
+ Themes: default to `gr.themes.Citrus()`.
101
+
102
+ Before defaulting to a plain component or guessing at a custom one, web-fetch the current Gradio docs at https://www.gradio.app/docs.
103
+
104
+ ## Gradio 6.x gotchas
105
+
106
+ The current `sdk_version` (6.x at time of writing — verify with `pip index versions gradio`) changed a few things that older recipes get wrong. The failures are easy to miss because they happen at the Space's first import, not when you write the file locally.
107
+
108
+ - **`theme=` and `css=` moved from `gr.Blocks(...)` to `demo.launch(...)`.** Passing them to `Blocks` now emits a deprecation warning and the styling silently doesn't apply. Always:
109
+
110
+ ```python
111
+ with gr.Blocks(title="...") as demo:
112
+ ...
113
+
114
+ if __name__ == "__main__":
115
+ demo.launch(theme=gr.themes.Citrus(), css=CSS)
116
+ ```
117
+
118
+ Spaces runs `app.py` as `__main__`, so the `launch()` call executes.
119
+
120
+ - **Some component kwargs were removed.** `gr.Image` no longer accepts `show_download_button` (the same change affects a handful of other components). The Space fails at import with `TypeError: __init__() got an unexpected keyword argument 'show_download_button'` — not surfaced until the container actually starts. When in doubt, web-fetch the current docs for the specific component before passing non-obvious kwargs.
121
+
122
+ - **The Gradio version the Space runs at is set by `sdk_version:` in the README YAML, *not* by `requirements.txt`.** Pinning `gradio` in `requirements.txt` is at best ignored and at worst causes a runtime mismatch; set the version once, in the README, and write `app.py` against that version.
123
+
124
+ If the first build fails on a `TypeError` or signature mismatch in a Gradio component, this is the most common cause — read `/logs/container` (build) or `/logs/run` (runtime), look at the line in `app.py`, and check the current component signature.
@@ -0,0 +1,196 @@
1
+ # ZeroGPU and publishing
2
+
3
+ ZeroGPU is the default hardware target. It's a shared serverless GPU pool: GPU is allocated on each request, held for the duration of a `@spaces.GPU` function call, and released. The key implications for the demo's code shape:
4
+
5
+ ## ZeroGPU rules
6
+
7
+ **Models go on `cuda` at module level, not lazy-loaded inside the GPU function.**
8
+
9
+ ```python
10
+ import torch
11
+ import spaces
12
+ from diffusers import QwenImagePipeline
13
+
14
+ pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16)
15
+ pipe.to("cuda")
16
+ pipe.load_lora_weights("user/my-lora")
17
+
18
+ @spaces.GPU(duration=60)
19
+ def generate(prompt):
20
+ return pipe(prompt).images[0]
21
+ ```
22
+
23
+ ZeroGPU uses a CUDA emulation mode that lets `.to("cuda")` work outside `@spaces.GPU` functions during startup. Module-level placement is significantly faster than deferred placement because CUDA transfers are optimized for startup-time placement. Lazy-loading inside `@spaces.GPU` is discouraged.
24
+
25
+ **The `@spaces.GPU` decorator wraps the function that needs the GPU.**
26
+
27
+ The default duration is 60 seconds. Set it higher for longer tasks: `@spaces.GPU(duration=120)` or `@spaces.GPU(duration=300)`. Set it lower if the task reliably finishes faster — lower duration means higher queue priority. For tasks where duration varies with input, pass a function: `@spaces.GPU(duration=lambda *args: ...)`.
28
+
29
+ **GPU size: `large` (default, 48GB VRAM) or `xlarge` (96GB, full Blackwell).** Specify with `@spaces.GPU(size="xlarge")` when a single inference needs more than 48GB — large base video models, high-resolution generation, or heavy multi-stage pipelines. `xlarge` consumes 2× the daily quota per second and queues longer, so only reach for it when `large` actually OOMs.
30
+
31
+ Typical durations:
32
+
33
+ - Few-step T2I (4-8 steps): 30-60 seconds.
34
+ - Standard T2I (20-50 steps): 60-90 seconds.
35
+ - I2I / instruction edits: 60-90 seconds.
36
+ - Short video (3-5 seconds): 120-180 seconds.
37
+ - Long video / multi-stage: 180-300 seconds.
38
+
39
+ **Don't use `torch.compile`.** It's incompatible with ZeroGPU's process model (the GPU process forks per call). The decorator is a no-op outside ZeroGPU, so `pipe(...)` runs uncompiled in both environments.
40
+
41
+ **Validate inputs at the top of the GPU function.** Raising `gr.Error(...)` inside a `@spaces.GPU` function still consumes some GPU quota for the allocation. Validate before doing real work, or move validation into a non-decorated function called by the UI.
42
+
43
+ **Use `cache_examples=True` with `cache_mode="lazy"` on `gr.Examples`.** Plain `cache_examples=True` runs the function at build time, before a GPU is allocated, and will fail. `cache_mode="lazy"` defers caching to the first time a user clicks each example — the GPU is available, and subsequent clicks return the cached result instantly.
44
+
45
+ **Match `gr.Examples(fn=…)` to the function signature.** A click calls `fn` with only the `inputs=` components, positionally; extra parameters without defaults raise `TypeError: missing N required positional arguments`. The run event wires every component, so this only breaks on the example click — not manual or smoke tests. Fix: default the extra params, or pass the full `inputs=` list with full example rows.
46
+
47
+ **Don't initialize CUDA from outside the controlled paths.** `pipe.to("cuda")` is fine (CUDA emulation handles it). Calling `torch.cuda.something()` directly at module level can break the process model — when in doubt, do it inside the GPU function or skip it.
48
+
49
+ **ZeroGPU requires PRO/Team/Enterprise.** A free-tier user can create a Space with `hardware: zero-a10g` in the README, but it'll fall back to CPU. If the user isn't on a supporting plan, mention this and point them at two paths: upgrade to PRO (unlocks ZeroGPU directly), or apply for a [community GPU grant](https://huggingface.co/docs/hub/spaces-gpus#community-gpu-grants) (request free paid GPU hardware via the Space's hardware settings, subject to approval).
50
+
51
+ ## HF Hub patterns
52
+
53
+ ### Authentication — check first, ask only if needed
54
+
55
+ Don't ask for a token reflexively. Check whether the user is already authenticated, and only prompt if there's no usable session.
56
+
57
+ ```python
58
+ from huggingface_hub import HfApi, get_token
59
+
60
+ def resolve_auth():
61
+ """Returns (token, username) or (None, None) if no usable auth."""
62
+ cached = get_token() # picks up HF_TOKEN env var or cached CLI login
63
+ if not cached:
64
+ return None, None
65
+ try:
66
+ info = HfApi().whoami(token=cached)
67
+ return cached, info["name"]
68
+ except Exception:
69
+ return None, None # token exists but is invalid/expired
70
+ ```
71
+
72
+ Decision tree:
73
+
74
+ - **User already authenticated and the LoRA repo is public**: use the existing token. Confirm the username with the user before publishing ("I'll publish to `{username}` — confirm?").
75
+ - **User already authenticated and the LoRA repo is private**: try `api.repo_info(repo_id, token=cached)`. If it succeeds, the existing token has the right scope — proceed. If it fails (token doesn't have access to that repo), ask for a token with broader access.
76
+ - **No cached token**: ask the user. One ask, with the explanation: "I need a Hugging Face access token with **write** scope. Create one at https://huggingface.co/settings/tokens. Paste it here." The same token will be reused for publishing.
77
+
78
+ The default flow on a Hugging Face Space, in a logged-in user's local environment with `huggingface-cli login`, or in any environment with `HF_TOKEN` set, will *not* require asking the user for a token. Asking is the fallback, not the default.
79
+
80
+ ### Reading the LoRA repo
81
+
82
+ ```python
83
+ from huggingface_hub import HfApi, ModelCard
84
+
85
+ api = HfApi(token=hf_token) # token may be None for public repos
86
+
87
+ try:
88
+ info = api.repo_info(repo_id) # 401/403 → private/gated; need token
89
+ except Exception as e:
90
+ # Handle private/gated repo case
91
+ ...
92
+
93
+ files = api.list_repo_files(repo_id)
94
+ card = ModelCard.load(repo_id, token=hf_token)
95
+ base_model = card.data.get("base_model")
96
+ pipeline_tag = card.data.get("pipeline_tag")
97
+ readme_text = card.text
98
+ ```
99
+
100
+ ### Picking the LoRA weights file
101
+
102
+ Many LoRA repos contain a single `.safetensors` file and the choice is trivial. But some contain several — variants (4-step / 8-step distillations, FP16 vs BF16, different ranks), training-history checkpoints (`epoch-10.safetensors`, `epoch-20.safetensors`), or genuinely different methods (`lora.safetensors` + `lora_dora.safetensors`). Pick in this order, stopping at the first match:
103
+
104
+ 1. **The README recommends a specific file.** This is the strongest signal — if the author bothered to name a file, that's the choice. Look for filenames inside inference snippets (especially `weight_name="..."` arguments), in "recommended" or "best" callouts, in comparison tables ranking variants, or in any prose like "use X for Y." If the README clearly points at one file, use it without asking.
105
+
106
+ 2. **No README recommendation, and `pytorch_lora_weights.safetensors` exists at the repo root.** Use it. This is the diffusers convention and a safe default.
107
+
108
+ 3. **Neither, but the multiple files look like training checkpoints** (filenames with patterns like `epoch-N`, `step-N`, `checkpoint-N`, or a numeric progression like `lora-1.safetensors`, `lora-2.safetensors`, `lora-3.safetensors`). Default to the highest-numbered / latest one, but mention the choice in the response so the user can override: "Repo has epoch-10, epoch-20, epoch-30; using epoch-30 — let me know if you want a different one."
109
+
110
+ 4. **Otherwise** — files look like alternative variants (`*-4steps` vs `*-8steps`, `*-fp16` vs `*-bf16`, `lora` vs `lora_dora`), or names are opaque (`v2.safetensors`, `final.safetensors`, `output.safetensors`), or there's no clear "latest." Ask, with a one-line description of each option based on what the filenames suggest. Don't pick blindly — the wrong choice produces a working Space that's silently using the wrong weights.
111
+
112
+ This reasoning happens once, in Phase 1. The chosen filename is then passed to `load_lora_weights` via `weight_name="..."` in `app.py`.
113
+
114
+ ### Loading a private LoRA in `app.py`
115
+
116
+ ```python
117
+ import os
118
+ pipe.load_lora_weights("user/private-lora", token=os.environ["HF_TOKEN"])
119
+ ```
120
+
121
+ ### Creating and publishing the Space
122
+
123
+ ```python
124
+ from huggingface_hub import HfApi, SpaceHardware
125
+
126
+ api = HfApi(token=hf_token)
127
+ username = api.whoami()["name"]
128
+ repo_id = f"{username}/{space_name}"
129
+
130
+ api.create_repo(
131
+ repo_id=repo_id,
132
+ repo_type="space",
133
+ space_sdk="gradio",
134
+ space_hardware=SpaceHardware.ZERO_A10G,
135
+ private=True,
136
+ exist_ok=True,
137
+ )
138
+
139
+ # Set HF token as a Space secret if the LoRA or base model is private/gated
140
+ api.add_space_secret(repo_id=repo_id, key="HF_TOKEN", value=hf_token)
141
+
142
+ # Upload files
143
+ for path in ["app.py", "requirements.txt", "README.md"]:
144
+ api.upload_file(
145
+ path_or_fileobj=path,
146
+ path_in_repo=path,
147
+ repo_id=repo_id,
148
+ repo_type="space",
149
+ )
150
+ ```
151
+
152
+ The Space starts building automatically once files are pushed.
153
+
154
+ ### `SpaceHardware.ZERO_A10G`
155
+
156
+ The string value is `"zero-a10g"`. This is a legacy name from when ZeroGPU ran on A10Gs; the actual hardware is NVIDIA RTX Pro 6000 Blackwell, but the identifier stuck. Both `SpaceHardware.ZERO_A10G` and the literal `"zero-a10g"` work. Prefer the enum for clarity.
157
+
158
+ If `create_repo` rejects the hardware (typically because the user isn't on PRO), retry without `space_hardware=`, set the README's `hardware: zero-a10g` anyway, and tell the user the Space will run on CPU until they either upgrade to PRO or apply for a [community GPU grant](https://huggingface.co/docs/hub/spaces-gpus#community-gpu-grants) (request form lives in the Space's hardware settings).
159
+
160
+ ### Updating an existing Space
161
+
162
+ If the user already has a Space they want to update (rather than creating fresh), `create_repo` with `exist_ok=True` is a no-op on the existing repo. `upload_file` overwrites. Existing secrets and hardware settings are preserved. Don't delete and recreate the Space — they'll lose stars, comments, and any custom config.
163
+
164
+ ## After publishing
165
+
166
+ The Space URL is `https://huggingface.co/spaces/{repo_id}`. Build logs are at `https://huggingface.co/spaces/{repo_id}/logs/container`. Runtime logs at `https://huggingface.co/spaces/{repo_id}/logs/run`.
167
+
168
+ When sharing the URL with the user:
169
+
170
+ - Note that the Space is private — they need to be logged in to view it.
171
+ - Note that the build takes a few minutes the first time.
172
+ - Offer to look at the logs if anything fails.
173
+ - Don't add a long postamble — they want to click the link, not read more text.
174
+
175
+ **Confirm a redeploy is actually live before testing it.** An `app.py`-only push does **not** change the Space's reported `runtime.stage` — the old replica keeps serving "RUNNING" while the new build swaps in, so a `gradio_client` test can silently hit **stale code**. To be sure: push → `api.restart_space(repo)` → poll until the stage leaves and returns to RUNNING → grep the boot logs (`/logs/run`) for a unique `[VERSION] …` marker you printed at module scope → then test. Also set `demo.launch(show_error=True)` so `gradio_client` surfaces the real traceback instead of a generic `AppError`.
176
+
177
+ ## Publish-time failures (before the build starts)
178
+
179
+ These happen during `create_repo` or `upload_file`, *before* the Space build pipeline runs. Diagnose by reading the exception, not the container logs (the container hasn't started yet).
180
+
181
+ - **`HfHubHTTPError: 400 Bad Request` from `https://huggingface.co/api/validate-yaml`.** The README's YAML frontmatter failed server-side validation. By far the most common cause is `short_description` exceeding the server's length cap (the cap isn't documented and may change; targeting ~60 characters keeps you well clear). Other causes include typos in field names (`hardware` vs `hardwre`), invalid color values in `colorFrom`/`colorTo`, an unrecognized `hardware` string, or a malformed `models:` list. Fix: open `README.md`, shorten `short_description`, double-check the other YAML fields, retry. If the user gave you a long description for the Space, put the long version in the README body below the YAML — that's the right home for prose.
182
+
183
+ - **`HfHubHTTPError: 403 Forbidden` on `create_repo` with `space_hardware="zero-a10g"`.** The user's account can't request ZeroGPU at creation time (typically because they're not on PRO/Team/Enterprise). Fix: retry `create_repo` without the `space_hardware` argument; keep `hardware: zero-a10g` in the README YAML. The Space gets created on CPU. Point the user at two paths to get off CPU: upgrade to PRO (auto-promotes the Space to ZeroGPU), or apply for a [community GPU grant](https://huggingface.co/docs/hub/spaces-gpus#community-gpu-grants) (request via the Space's hardware settings).
184
+
185
+ - **`HfHubHTTPError: 401/403` on `upload_file`.** Token lacks write scope. Fix: ask the user for a write-scoped token (or use a fine-grained token with write permission on this specific Space).
186
+
187
+ - **`RepositoryNotFoundError` on `upload_file` immediately after `create_repo`.** Race condition; very rare. Fix: small `time.sleep(1)` between create and upload, or retry the upload.
188
+
189
+ ## Common build failures
190
+
191
+ - **`weight_name` mismatch in `load_lora_weights`.** The actual file in the repo is named differently. Fix: `api.list_repo_files(repo_id)` to find the real filename; pass `weight_name=` explicitly.
192
+ - **Gated base model, no token.** The base model (e.g. `black-forest-labs/FLUX.1-dev`) requires accepting a license. Fix: ensure the user has accepted the license on the Hub, and the token is set as a Space secret.
193
+ - **Diffusers version too old for the pipeline class.** The base model was released after the latest pinned diffusers. Fix: change `requirements.txt` from `diffusers` to `git+https://github.com/huggingface/diffusers`.
194
+ - **CUDA OOM on first request.** The model is too big for the 48GB VRAM available on the default `large` size. Solutions, in order of preference: pick a smaller or quantized variant (FP8, smaller checkpoint); request `@spaces.GPU(size="xlarge")` to get the full 96GB (costs 2× quota and queues longer); enable model offloading (`pipe.enable_model_cpu_offload()` — conflicts with ZeroGPU's process model, last resort only).
195
+ - **`cache_examples=True` failure.** Build-time GPU isn't available on ZeroGPU. Fix: add `cache_mode="lazy"` so caching happens on first user click instead of at build.
196
+ - **Free-tier user, hardware not allocated.** Space falls back to CPU. The build succeeds but inference is unusably slow. Fix: user upgrades to PRO, or removes `hardware: zero-a10g` and lives with CPU.