dentate 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 (274) hide show
  1. dentate-0.1.0/LICENSE +202 -0
  2. dentate-0.1.0/PKG-INFO +423 -0
  3. dentate-0.1.0/README.md +347 -0
  4. dentate-0.1.0/dentate/__init__.py +10 -0
  5. dentate-0.1.0/dentate/_deps.py +38 -0
  6. dentate-0.1.0/dentate/adapters/__init__.py +7 -0
  7. dentate-0.1.0/dentate/adapters/oracle/__init__.py +5 -0
  8. dentate-0.1.0/dentate/adapters/oracle/fake.py +62 -0
  9. dentate-0.1.0/dentate/adapters/teacher/__init__.py +5 -0
  10. dentate-0.1.0/dentate/adapters/teacher/fake.py +27 -0
  11. dentate-0.1.0/dentate/adapters/tracking/__init__.py +6 -0
  12. dentate-0.1.0/dentate/adapters/tracking/null.py +19 -0
  13. dentate-0.1.0/dentate/adapters/tracking/wandb.py +53 -0
  14. dentate-0.1.0/dentate/agent.py +76 -0
  15. dentate-0.1.0/dentate/analysis.py +421 -0
  16. dentate-0.1.0/dentate/analysis_llm.py +247 -0
  17. dentate-0.1.0/dentate/api.py +1255 -0
  18. dentate-0.1.0/dentate/arch/__init__.py +115 -0
  19. dentate-0.1.0/dentate/arch/_baseline_torch.py +110 -0
  20. dentate-0.1.0/dentate/arch/_xlstm_torch.py +122 -0
  21. dentate-0.1.0/dentate/arch/baseline.py +84 -0
  22. dentate-0.1.0/dentate/arch/knobs.py +159 -0
  23. dentate-0.1.0/dentate/arch/registry.py +72 -0
  24. dentate-0.1.0/dentate/arch/xlstm.py +86 -0
  25. dentate-0.1.0/dentate/backends/__init__.py +11 -0
  26. dentate-0.1.0/dentate/backends/_stub.py +55 -0
  27. dentate-0.1.0/dentate/backends/cuda.py +16 -0
  28. dentate-0.1.0/dentate/backends/factory.py +31 -0
  29. dentate-0.1.0/dentate/backends/fake.py +165 -0
  30. dentate-0.1.0/dentate/backends/hf.py +317 -0
  31. dentate-0.1.0/dentate/backends/mlx.py +171 -0
  32. dentate-0.1.0/dentate/bootcamp/__init__.py +8 -0
  33. dentate-0.1.0/dentate/bootcamp/__main__.py +89 -0
  34. dentate-0.1.0/dentate/bootcamp/app.py +438 -0
  35. dentate-0.1.0/dentate/bootcamp/auth.py +231 -0
  36. dentate-0.1.0/dentate/bootcamp/config.py +121 -0
  37. dentate-0.1.0/dentate/bootcamp/experiment.py +277 -0
  38. dentate-0.1.0/dentate/bootcamp/jobs.py +434 -0
  39. dentate-0.1.0/dentate/bootcamp/papers.py +60 -0
  40. dentate-0.1.0/dentate/bootcamp/project.py +111 -0
  41. dentate-0.1.0/dentate/bootcamp/repository.py +240 -0
  42. dentate-0.1.0/dentate/bootcamp/resources.py +97 -0
  43. dentate-0.1.0/dentate/bootcamp/worker.py +247 -0
  44. dentate-0.1.0/dentate/cli.py +1885 -0
  45. dentate-0.1.0/dentate/compute.py +141 -0
  46. dentate-0.1.0/dentate/config.py +166 -0
  47. dentate-0.1.0/dentate/control.py +63 -0
  48. dentate-0.1.0/dentate/data/__init__.py +25 -0
  49. dentate-0.1.0/dentate/data/dataset.py +44 -0
  50. dentate-0.1.0/dentate/data/replay.py +53 -0
  51. dentate-0.1.0/dentate/data/schemas.py +63 -0
  52. dentate-0.1.0/dentate/demo/NOTICE +20 -0
  53. dentate-0.1.0/dentate/demo/TOKENIZER.json +12 -0
  54. dentate-0.1.0/dentate/demo/__init__.py +159 -0
  55. dentate-0.1.0/dentate/demo/starter.dentate +10 -0
  56. dentate-0.1.0/dentate/demo/tokenizer/merges.txt +48901 -0
  57. dentate-0.1.0/dentate/demo/tokenizer/special_tokens_map.json +28 -0
  58. dentate-0.1.0/dentate/demo/tokenizer/tokenizer.json +98249 -0
  59. dentate-0.1.0/dentate/demo/tokenizer/tokenizer_config.json +154 -0
  60. dentate-0.1.0/dentate/demo/tokenizer/vocab.json +1 -0
  61. dentate-0.1.0/dentate/distill/__init__.py +6 -0
  62. dentate-0.1.0/dentate/distill/judge_distill.py +24 -0
  63. dentate-0.1.0/dentate/domain/__init__.py +57 -0
  64. dentate-0.1.0/dentate/domain/ports.py +128 -0
  65. dentate-0.1.0/dentate/domain/types.py +145 -0
  66. dentate-0.1.0/dentate/errors.py +57 -0
  67. dentate-0.1.0/dentate/eval/__init__.py +20 -0
  68. dentate-0.1.0/dentate/eval/baselines.py +75 -0
  69. dentate-0.1.0/dentate/eval/evaluate.py +63 -0
  70. dentate-0.1.0/dentate/eval/report.py +25 -0
  71. dentate-0.1.0/dentate/eval/stats.py +48 -0
  72. dentate-0.1.0/dentate/export_smi.py +196 -0
  73. dentate-0.1.0/dentate/harness.py +284 -0
  74. dentate-0.1.0/dentate/ingest.py +21 -0
  75. dentate-0.1.0/dentate/integrations/__init__.py +37 -0
  76. dentate-0.1.0/dentate/integrations/compute.py +336 -0
  77. dentate-0.1.0/dentate/integrations/huggingface.py +233 -0
  78. dentate-0.1.0/dentate/integrations/secrets.py +112 -0
  79. dentate-0.1.0/dentate/integrations/wandb_link.py +29 -0
  80. dentate-0.1.0/dentate/manifest.py +81 -0
  81. dentate-0.1.0/dentate/model_docs.py +152 -0
  82. dentate-0.1.0/dentate/models/__init__.py +22 -0
  83. dentate-0.1.0/dentate/models/registry.py +141 -0
  84. dentate-0.1.0/dentate/models/userstore.py +53 -0
  85. dentate-0.1.0/dentate/obs.py +190 -0
  86. dentate-0.1.0/dentate/online/__init__.py +5 -0
  87. dentate-0.1.0/dentate/online/loop.py +78 -0
  88. dentate-0.1.0/dentate/os_sim/__init__.py +17 -0
  89. dentate-0.1.0/dentate/os_sim/cache.py +54 -0
  90. dentate-0.1.0/dentate/os_sim/checker.py +71 -0
  91. dentate-0.1.0/dentate/os_sim/dataset.py +180 -0
  92. dentate-0.1.0/dentate/os_sim/engine.py +462 -0
  93. dentate-0.1.0/dentate/os_sim/enrich.py +99 -0
  94. dentate-0.1.0/dentate/os_sim/filesystem.py +160 -0
  95. dentate-0.1.0/dentate/os_sim/grounding.py +64 -0
  96. dentate-0.1.0/dentate/os_sim/import_traces.py +341 -0
  97. dentate-0.1.0/dentate/os_sim/manage.py +93 -0
  98. dentate-0.1.0/dentate/os_sim/memory.py +150 -0
  99. dentate-0.1.0/dentate/os_sim/persona.py +51 -0
  100. dentate-0.1.0/dentate/os_sim/reward_bridge.py +123 -0
  101. dentate-0.1.0/dentate/os_sim/risk.py +50 -0
  102. dentate-0.1.0/dentate/os_sim/scenarios.py +172 -0
  103. dentate-0.1.0/dentate/os_sim/session.py +221 -0
  104. dentate-0.1.0/dentate/os_sim/shell_llm.py +127 -0
  105. dentate-0.1.0/dentate/os_sim/state.py +88 -0
  106. dentate-0.1.0/dentate/os_sim/templates.py +130 -0
  107. dentate-0.1.0/dentate/os_sim/trajectory.py +77 -0
  108. dentate-0.1.0/dentate/os_sim/vfs.py +260 -0
  109. dentate-0.1.0/dentate/package.py +113 -0
  110. dentate-0.1.0/dentate/playground.py +934 -0
  111. dentate-0.1.0/dentate/presets.py +96 -0
  112. dentate-0.1.0/dentate/pretrain/__init__.py +15 -0
  113. dentate-0.1.0/dentate/pretrain/agentic_data.py +153 -0
  114. dentate-0.1.0/dentate/pretrain/agentic_eval.py +102 -0
  115. dentate-0.1.0/dentate/pretrain/agentic_run.py +300 -0
  116. dentate-0.1.0/dentate/pretrain/assoc.py +261 -0
  117. dentate-0.1.0/dentate/pretrain/behaviors.py +83 -0
  118. dentate-0.1.0/dentate/pretrain/benchmark.py +102 -0
  119. dentate-0.1.0/dentate/pretrain/best_ckpt.py +60 -0
  120. dentate-0.1.0/dentate/pretrain/capacity.py +145 -0
  121. dentate-0.1.0/dentate/pretrain/certificate.py +116 -0
  122. dentate-0.1.0/dentate/pretrain/chatml.py +144 -0
  123. dentate-0.1.0/dentate/pretrain/code_env.py +310 -0
  124. dentate-0.1.0/dentate/pretrain/coherence.py +62 -0
  125. dentate-0.1.0/dentate/pretrain/corpusstats.py +166 -0
  126. dentate-0.1.0/dentate/pretrain/curator.py +177 -0
  127. dentate-0.1.0/dentate/pretrain/deeploop.py +104 -0
  128. dentate-0.1.0/dentate/pretrain/derivation.py +264 -0
  129. dentate-0.1.0/dentate/pretrain/gates.py +111 -0
  130. dentate-0.1.0/dentate/pretrain/grpo.py +308 -0
  131. dentate-0.1.0/dentate/pretrain/grpo_run.py +217 -0
  132. dentate-0.1.0/dentate/pretrain/hf_reason_data.py +169 -0
  133. dentate-0.1.0/dentate/pretrain/llc.py +98 -0
  134. dentate-0.1.0/dentate/pretrain/lm_replay.py +47 -0
  135. dentate-0.1.0/dentate/pretrain/longctx.py +61 -0
  136. dentate-0.1.0/dentate/pretrain/longctx_data.py +80 -0
  137. dentate-0.1.0/dentate/pretrain/longctx_train.py +66 -0
  138. dentate-0.1.0/dentate/pretrain/managed.py +493 -0
  139. dentate-0.1.0/dentate/pretrain/meaningful_eval.py +164 -0
  140. dentate-0.1.0/dentate/pretrain/metrics.py +391 -0
  141. dentate-0.1.0/dentate/pretrain/ntgrid.py +95 -0
  142. dentate-0.1.0/dentate/pretrain/oracle_traces.py +274 -0
  143. dentate-0.1.0/dentate/pretrain/passk.py +110 -0
  144. dentate-0.1.0/dentate/pretrain/pool.py +139 -0
  145. dentate-0.1.0/dentate/pretrain/presets.py +84 -0
  146. dentate-0.1.0/dentate/pretrain/preview.py +101 -0
  147. dentate-0.1.0/dentate/pretrain/probes.py +147 -0
  148. dentate-0.1.0/dentate/pretrain/reason_data.py +150 -0
  149. dentate-0.1.0/dentate/pretrain/reason_run.py +454 -0
  150. dentate-0.1.0/dentate/pretrain/reason_trainer.py +276 -0
  151. dentate-0.1.0/dentate/pretrain/recall_data.py +153 -0
  152. dentate-0.1.0/dentate/pretrain/recall_run.py +292 -0
  153. dentate-0.1.0/dentate/pretrain/smoltalk.py +44 -0
  154. dentate-0.1.0/dentate/pretrain/teacher.py +229 -0
  155. dentate-0.1.0/dentate/pretrain/tools.py +103 -0
  156. dentate-0.1.0/dentate/pretrain/trainer.py +764 -0
  157. dentate-0.1.0/dentate/pretrain/vision.py +181 -0
  158. dentate-0.1.0/dentate/pretrain/vl_run.py +110 -0
  159. dentate-0.1.0/dentate/pretrain/wmprobe.py +235 -0
  160. dentate-0.1.0/dentate/pretrain/world_model.py +150 -0
  161. dentate-0.1.0/dentate/primitives/__init__.py +19 -0
  162. dentate-0.1.0/dentate/primitives/losses.py +156 -0
  163. dentate-0.1.0/dentate/primitives/optimizer.py +28 -0
  164. dentate-0.1.0/dentate/primitives/sampling.py +55 -0
  165. dentate-0.1.0/dentate/primitives/schedules.py +20 -0
  166. dentate-0.1.0/dentate/reward/__init__.py +11 -0
  167. dentate-0.1.0/dentate/reward/combine.py +64 -0
  168. dentate-0.1.0/dentate/reward/reward_model.py +47 -0
  169. dentate-0.1.0/dentate/reward/service.py +57 -0
  170. dentate-0.1.0/dentate/runconfig.py +119 -0
  171. dentate-0.1.0/dentate/runkind/__init__.py +18 -0
  172. dentate-0.1.0/dentate/runkind/base.py +55 -0
  173. dentate-0.1.0/dentate/runkind/capabilities.py +46 -0
  174. dentate-0.1.0/dentate/runkind/distill.py +52 -0
  175. dentate-0.1.0/dentate/runkind/reason.py +63 -0
  176. dentate-0.1.0/dentate/runkind/rlvr.py +61 -0
  177. dentate-0.1.0/dentate/sandbox.py +146 -0
  178. dentate-0.1.0/dentate/scripts/__init__.py +1 -0
  179. dentate-0.1.0/dentate/scripts/campaign_100m.py +173 -0
  180. dentate-0.1.0/dentate/serve_openai.py +281 -0
  181. dentate-0.1.0/dentate/site.py +290 -0
  182. dentate-0.1.0/dentate/store.py +420 -0
  183. dentate-0.1.0/dentate/tasks/__init__.py +11 -0
  184. dentate-0.1.0/dentate/tasks/hf.py +151 -0
  185. dentate-0.1.0/dentate/tasks/masking.py +161 -0
  186. dentate-0.1.0/dentate/tasks/multi.py +59 -0
  187. dentate-0.1.0/dentate/tasks/reason_source.py +59 -0
  188. dentate-0.1.0/dentate/tasks/synthetic.py +89 -0
  189. dentate-0.1.0/dentate/train/__init__.py +6 -0
  190. dentate-0.1.0/dentate/train/curriculum.py +277 -0
  191. dentate-0.1.0/dentate/train/pipeline.py +383 -0
  192. dentate-0.1.0/dentate/train/stages.py +65 -0
  193. dentate-0.1.0/dentate/ui.py +189 -0
  194. dentate-0.1.0/dentate/util.py +39 -0
  195. dentate-0.1.0/dentate/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  196. dentate-0.1.0/dentate/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  197. dentate-0.1.0/dentate/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  198. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  199. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  200. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  201. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  202. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  203. dentate-0.1.0/dentate/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  204. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  205. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  206. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  207. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  208. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  209. dentate-0.1.0/dentate/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  210. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  211. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  212. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  213. dentate-0.1.0/dentate/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  214. dentate-0.1.0/dentate/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  215. dentate-0.1.0/dentate/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  216. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  217. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  218. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  219. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  220. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  221. dentate-0.1.0/dentate/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  222. dentate-0.1.0/dentate/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  223. dentate-0.1.0/dentate/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  224. dentate-0.1.0/dentate/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  225. dentate-0.1.0/dentate/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  226. dentate-0.1.0/dentate/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  227. dentate-0.1.0/dentate/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  228. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  229. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  230. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  231. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  232. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  233. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  234. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  235. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  236. dentate-0.1.0/dentate/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  237. dentate-0.1.0/dentate/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  238. dentate-0.1.0/dentate/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  239. dentate-0.1.0/dentate/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  240. dentate-0.1.0/dentate/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  241. dentate-0.1.0/dentate/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  242. dentate-0.1.0/dentate/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  243. dentate-0.1.0/dentate/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  244. dentate-0.1.0/dentate/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  245. dentate-0.1.0/dentate/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  246. dentate-0.1.0/dentate/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  247. dentate-0.1.0/dentate/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  248. dentate-0.1.0/dentate/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  249. dentate-0.1.0/dentate/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  250. dentate-0.1.0/dentate/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  251. dentate-0.1.0/dentate/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  252. dentate-0.1.0/dentate/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  253. dentate-0.1.0/dentate/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  254. dentate-0.1.0/dentate/web/assets/index-DsBOi9cQ.js +1058 -0
  255. dentate-0.1.0/dentate/web/assets/index-fQgsX_rq.css +41 -0
  256. dentate-0.1.0/dentate/web/favicon.svg +19 -0
  257. dentate-0.1.0/dentate/web/icon-192.png +0 -0
  258. dentate-0.1.0/dentate/web/icon-512.png +0 -0
  259. dentate-0.1.0/dentate/web/index.html +18 -0
  260. dentate-0.1.0/dentate/web/manifest.webmanifest +15 -0
  261. dentate-0.1.0/dentate/web/media/dentate.jpg +0 -0
  262. dentate-0.1.0/dentate/web/media/dentate.mp4 +0 -0
  263. dentate-0.1.0/dentate/web/sw.js +46 -0
  264. dentate-0.1.0/dentate.egg-info/PKG-INFO +423 -0
  265. dentate-0.1.0/dentate.egg-info/SOURCES.txt +272 -0
  266. dentate-0.1.0/dentate.egg-info/dependency_links.txt +1 -0
  267. dentate-0.1.0/dentate.egg-info/entry_points.txt +2 -0
  268. dentate-0.1.0/dentate.egg-info/requires.txt +58 -0
  269. dentate-0.1.0/dentate.egg-info/top_level.txt +1 -0
  270. dentate-0.1.0/pyproject.toml +116 -0
  271. dentate-0.1.0/setup.cfg +4 -0
  272. dentate-0.1.0/tests/test_hf_search_and_models.py +24 -0
  273. dentate-0.1.0/tests/test_hf_source.py +68 -0
  274. dentate-0.1.0/tests/test_remote_compute.py +29 -0
dentate-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Marius-Constantin Dinu / Alpha Omega Labs
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
dentate-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,423 @@
1
+ Metadata-Version: 2.4
2
+ Name: dentate
3
+ Version: 0.1.0
4
+ Summary: Dentate — RLVR + distillation for small models: SFT → support gate → GRPO → frozen eval, with the Spiral looped transformer demo
5
+ Author-email: Marius-Constantin Dinu <dinu.marius.constantin@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://dentate.cortex.a2olabs.com
8
+ Project-URL: Source, https://github.com/Xpitfire/dentate
9
+ Project-URL: Issues, https://github.com/Xpitfire/dentate/issues
10
+ Project-URL: Colab, https://colab.research.google.com/github/Xpitfire/dentate/blob/main/examples/colab/dentate_bootcamp.ipynb
11
+ Keywords: reinforcement-learning,rlvr,grpo,distillation,small-language-models,spiral,bootcamp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ License-File: dentate/demo/NOTICE
26
+ Requires-Dist: pyyaml
27
+ Provides-Extra: serve
28
+ Requires-Dist: fastapi<1,>=0.115; extra == "serve"
29
+ Requires-Dist: uvicorn<1,>=0.30; extra == "serve"
30
+ Requires-Dist: pydantic<3,>=2.9; extra == "serve"
31
+ Requires-Dist: httpx<1,>=0.27; extra == "serve"
32
+ Requires-Dist: PyJWT[crypto]<3,>=2.9; extra == "serve"
33
+ Requires-Dist: python-multipart; extra == "serve"
34
+ Provides-Extra: demo
35
+ Requires-Dist: dentate[serve]; extra == "demo"
36
+ Requires-Dist: torch<3,>=2.6; extra == "demo"
37
+ Requires-Dist: transformers<6,>=4.46; extra == "demo"
38
+ Requires-Dist: numpy<3,>=1.26; extra == "demo"
39
+ Requires-Dist: spiral-lm<0.2,>=0.1.0; extra == "demo"
40
+ Provides-Extra: bootcamp
41
+ Requires-Dist: dentate[demo]; extra == "bootcamp"
42
+ Provides-Extra: bootcamp-web
43
+ Requires-Dist: dentate[serve]; extra == "bootcamp-web"
44
+ Provides-Extra: api
45
+ Requires-Dist: dentate[serve]; extra == "api"
46
+ Provides-Extra: mlx
47
+ Requires-Dist: mlx; extra == "mlx"
48
+ Requires-Dist: mlx-lm; extra == "mlx"
49
+ Requires-Dist: mlx-lm-lora; extra == "mlx"
50
+ Provides-Extra: cuda
51
+ Requires-Dist: torch>=2.6; extra == "cuda"
52
+ Requires-Dist: transformers; extra == "cuda"
53
+ Requires-Dist: peft; extra == "cuda"
54
+ Requires-Dist: trl; extra == "cuda"
55
+ Requires-Dist: datasets; extra == "cuda"
56
+ Requires-Dist: verl; extra == "cuda"
57
+ Provides-Extra: wandb
58
+ Requires-Dist: wandb; extra == "wandb"
59
+ Provides-Extra: dev
60
+ Requires-Dist: pytest; extra == "dev"
61
+ Requires-Dist: ruff; extra == "dev"
62
+ Requires-Dist: playwright; extra == "dev"
63
+ Requires-Dist: pytest-playwright; extra == "dev"
64
+ Requires-Dist: httpx; extra == "dev"
65
+ Requires-Dist: fastapi; extra == "dev"
66
+ Requires-Dist: uvicorn; extra == "dev"
67
+ Requires-Dist: python-multipart; extra == "dev"
68
+ Requires-Dist: PyJWT[crypto]; extra == "dev"
69
+ Requires-Dist: numpy; extra == "dev"
70
+ Requires-Dist: torch>=2.6; extra == "dev"
71
+ Requires-Dist: transformers; extra == "dev"
72
+ Requires-Dist: build; extra == "dev"
73
+ Requires-Dist: twine; extra == "dev"
74
+ Requires-Dist: nbformat; extra == "dev"
75
+ Dynamic: license-file
76
+
77
+ # Dentate
78
+
79
+ > **RLVR + distillation for small models.** Project → SFT → measured support → gated GRPO → frozen evaluation,
80
+ > with the [Spiral](https://github.com/Xpitfire/spiral) looped transformer as the demo model.
81
+ > Site: **https://dentate.cortex.a2olabs.com** · Package: `pip install "dentate[demo]"` · Apache-2.0
82
+
83
+ Dentate trains a small model from *verifiable, scored experience* and refuses to reinforce what the model cannot
84
+ already do: GRPO runs only after a pass@k support sweep finds a harvestable gap. Reward and evaluation share one
85
+ semantic verifier; the frozen evaluation set is content-disjoint from every training pool. A failed gate is an
86
+ honest, successfully measured result (post-GRPO accuracy is then absent, not zero).
87
+
88
+ ## Run it
89
+
90
+ **pip** (Python 3.11+, CPU is enough; macOS / Linux / Windows):
91
+
92
+ ```bash
93
+ pip install "dentate[demo]"
94
+ dentate demo doctor # torch / transformers / spiral / tokenizer / SPA checks
95
+ dentate demo init # bundled starter project + pinned SmolLM-135M-Instruct tokenizer → ~/.dentate/demo
96
+ dentate demo run # trains the starter on CPU → ~/.dentate/experiments/<timestamp>/result.dentate
97
+ dentate serve # the site on http://127.0.0.1:8793 — public pages + your local lab, data in ~/.dentate
98
+ ```
99
+
100
+ No download happens after the install: the wheel bundles the starter project, the tokenizer (one pinned Hugging Face
101
+ revision, SHA-256s in `dentate/demo/TOKENIZER.json`) and the built web app. No model weights, teacher or oracle.
102
+
103
+ **Colab** — [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Xpitfire/dentate/blob/main/examples/colab/dentate_bootcamp.ipynb)
104
+ `examples/colab/dentate_bootcamp.ipynb`: install → init → run → the site through Colab's port proxy.
105
+
106
+ **Download the CLI** (no Python needed; one-folder bundles built by the release workflow):
107
+ [macOS arm64](https://github.com/Xpitfire/dentate/releases/latest/download/dentate-macos-arm64.zip) ·
108
+ [Linux x64](https://github.com/Xpitfire/dentate/releases/latest/download/dentate-linux-x64.zip) ·
109
+ [Windows x64](https://github.com/Xpitfire/dentate/releases/latest/download/dentate-windows-x64.zip)
110
+
111
+ **Hosted** — https://dentate.cortex.a2olabs.com: browse papers, docs and public results without an account; sign in to
112
+ launch experiments on the bootcamp workers and to publish results and papers (private by default).
113
+
114
+ Student guide: **[docs/BOOTCAMP.md](./docs/BOOTCAMP.md)** (local / Colab / hosted, project schema, result files,
115
+ troubleshooting).
116
+
117
+ ### CLI
118
+
119
+ | command | what |
120
+ |---|---|
121
+ | `dentate serve [--host 127.0.0.1] [--port 8793] [--data ~/.dentate]` | the whole site locally (same app as prod, implicit local session; loopback only) |
122
+ | `dentate demo init [--dir ~/.dentate/demo]` | materialize tokenizer + starter, print the `export DENTATE_TOKENIZER_DIR=…` line |
123
+ | `dentate demo run [--project P] [--out DIR] [--tokenizer DIR] [--quiet]` | train a `.dentate` project; `--out` must be new |
124
+ | `dentate demo doctor` | environment check, exit 1 on any failure |
125
+ | `dentate research-serve --out runs` | the owner research dashboard alone (the pre-0.1 `dentate serve`) |
126
+ | `python -m dentate.bootcamp run\|serve\|worker` | attendee-local run, hosted frontdoor, training worker (unchanged) |
127
+
128
+ Extras: `demo` (= `serve` + torch/transformers/numpy/spiral-lm), `serve` (FastAPI/uvicorn/pydantic/httpx/PyJWT/
129
+ python-multipart); `bootcamp` / `bootcamp-web` / `api` are aliases; `mlx`, `cuda`, `wandb`, `dev` as before.
130
+
131
+ ### Releasing
132
+
133
+ `make wheel` builds the SPA, then sdist + wheel, and asserts the wheel carries the demo tokenizer, starter and SPA;
134
+ `make spiral-wheel` builds `spiral-lm` from `external/spiral`. Tagging `v*` runs `.github/workflows/release.yml`:
135
+ build + verify + smoke from the wheel → PyPI (`PYPI_API_TOKEN`) → PyInstaller bundles for macOS-14/arm64,
136
+ ubuntu-22.04/x64, windows-2022/x64 (`packaging/pyinstaller/dentate.spec`) attached to the GitHub release.
137
+
138
+ Named for the **dentate gyrus** — the hippocampal region for **neurogenesis, pattern separation, and
139
+ experience replay**. In Cortex, the [Gauntlet](../benchmark) gated composite is the **verifiable reward** Dentate
140
+ uses to distill a strong oracle into a 1–8B local model and push past imitation with RLVR: Gauntlet scores →
141
+ Dentate trains → the model re-registers as a Gauntlet harness → Gauntlet re-scores it → continual learning.
142
+
143
+ ## RL bootcamp: real hosted and attendee-local experiments
144
+
145
+ The bootcamp is **not** the fake-backed research harness described further below. It trains a fresh CPU Spiral
146
+ using the native reasoning SFT runner, measures sampled support with `passk_sweep`, and runs native GRPO only when
147
+ both the support sweep and GRPO's independent gate permit it.
148
+
149
+ Projects are attendee-local `.dentate` files: either bounded JSON configuration or a ZIP containing
150
+ `project.json`, metrics/provenance JSON and optional SFT/GRPO checkpoint tensors. Import never unpickles a
151
+ checkpoint in the public service. Imported metrics remain explicitly **historical and untrusted**;
152
+ starting a project always cold-starts a new model, rather than implicitly resuming imported weights.
153
+ Result packages preserve the new checkpoints, tokenizer file hashes, model/data seed, frozen tasks,
154
+ semantic verifier version and new measurements. Keep the tokenizer alongside the package for reproduction.
155
+
156
+ ### Attendee-local run from a checkout
157
+
158
+ `dentate demo run` is the packaged form of this. From a checkout, with the real Spiral package:
159
+
160
+ ```bash
161
+ pip install -e '.[demo]' -e ./external/spiral
162
+ dentate demo init # or: export DENTATE_TOKENIZER_DIR=dentate/demo/tokenizer
163
+ python -m dentate.bootcamp run --project examples/rl-bootcamp/starter.dentate --out ./my-experiment
164
+ ```
165
+
166
+ `examples/rl-bootcamp/prepare_tokenizer.py --out DIR --revision SHA` re-downloads the tokenizer from Hugging Face
167
+ when baking a worker image at a different audited revision; the bundled copy is the one recorded in
168
+ `dentate/demo/TOKENIZER.json`. Training itself is offline, with no teacher, oracle, external datasets or replay.
169
+ The output directory must be new. It contains `result.dentate`, provenance, measurements and native
170
+ Store run artifacts. Local CLI execution is not limited by the hosted lease; worker/UI jobs are.
171
+ The UI's **Save editable project** saves configuration; **Download result package** saves the complete
172
+ experiment. **Save original imported package** retains imported checkpoints and historical provenance.
173
+
174
+ Use a locally produced checkpoint with the existing native benchmark (this is a **new benchmark**,
175
+ not the frozen bootcamp comparison):
176
+
177
+ ```bash
178
+ python -m dentate.cli reason-bench --checkpoint my-experiment/runs/sft/checkpoints/final.pt \
179
+ --teacher "$DENTATE_TOKENIZER_DIR" --device cpu --n-iters 2 --n-per-kind 8
180
+ ```
181
+
182
+ For your own downloaded result package, its `checkpoints/sft.pt` and, when GRPO ran,
183
+ `checkpoints/grpo.pt` members are the same native checkpoint format. Extract only these fixed members
184
+ after validating the package with `dentate.bootcamp.project.load`; use the matching trusted tokenizer.
185
+ Do not execute imported Python or load someone else's checkpoint into a privileged service.
186
+
187
+ The final comparison uses one frozen content-disjoint set, excluding both training pools, SFT/GRPO
188
+ internal evaluation sets and support-sweep tasks. Tiny finite task spaces can exhaust held-out content:
189
+ `insufficient_heldout` stops before training rather than falling back to overlapping evaluation.
190
+ Cold small models can legitimately produce `gate_failed`; then post-GRPO accuracy is absent, not zero.
191
+ Native intermediate metrics and the frozen comparison have distinct scopes in the exported report.
192
+
193
+ ### Hosted frontdoor and trusted provider setup
194
+
195
+ `python -m dentate.bootcamp serve` starts a **separate FastAPI application**. Do not publish the legacy
196
+ `dentate.api.create_app` service. Keep the legacy runs, secrets and sandbox in a private owner backend;
197
+ the frontdoor receives no owner data volume or owner provider credentials. Every legacy `/api/*`
198
+ request is checked server-side for the explicitly mapped owner before a streaming proxy is opened.
199
+ Attendees can access only their new temporary bootcamp jobs. The frontdoor imports no Torch models.
200
+
201
+ Install `.[serve]` for the public service. Run `make web-build` before building the Python
202
+ wheel: Vite writes `web/dist`, then the Makefile copies those built assets into `dentate/web`
203
+ for package data. `DENTATE_SPA_DIR` can explicitly select a built SPA directory; the frontdoor refuses
204
+ to start with missing built HTML. There is no fake/legacy HTML fallback.
205
+
206
+ The legacy API grants local-owner sessions only with `create_app(..., local_owner=True)`; `dentate serve`
207
+ always runs in that mode and therefore refuses non-loopback binds; `dentate research-serve` selects it only
208
+ when bound to `127.0.0.1`, `::1`, or `localhost`.
209
+ Non-loopback owner backends expose neither an automatic owner session nor local bootcamp jobs.
210
+ The production Compose `site` service runs the separate frontdoor; `owner` has no published port
211
+ and alone mounts the existing `dentate-data` volume. Set `DENTATE_FRONTDOOR_ENV_FILE` to the
212
+ protected operator environment file before deployment. Never deploy the legacy image as `site`.
213
+
214
+ Required operator configuration:
215
+
216
+ | Variable | Contract |
217
+ |---|---|
218
+ | `DENTATE_PUBLIC_ORIGIN` | Exact HTTPS frontdoor origin, no path |
219
+ | `DENTATE_TRUSTED_PROXY_IPS` | Exact ingress IPs/CIDRs, comma-separated; wildcard and `/0` forbidden |
220
+ | `DENTATE_BOOTCAMP_ROOT` | Dedicated private writable state directory, default `/data/bootcamp` |
221
+ | `DENTATE_LEGACY_URL` | Private owner-backend origin, default `http://127.0.0.1:8793`; never publicly routed |
222
+ | `DENTATE_GOOGLE_CLIENT_ID`, `DENTATE_GOOGLE_CLIENT_SECRET` | App-specific Google OIDC client |
223
+ | `DENTATE_GOOGLE_ISSUER` | Defaults to `https://accounts.google.com` |
224
+ | `DENTATE_CORTEX_ISSUER`, `DENTATE_CORTEX_CLIENT_ID`, `DENTATE_CORTEX_CLIENT_SECRET` | App-specific Cortex OIDC issuer/client |
225
+ | `DENTATE_OWNER_SUBJECTS` | JSON array of `{"issuer":"trusted issuer","subject":"verified subject"}` mappings |
226
+ | `DENTATE_CORTEX_URL` | Independent Cortex resource API HTTPS origin; may be staging while the frontdoor is production |
227
+ | `DENTATE_CORTEX_INSTALLATION` | Dedicated Dentate resource installation ID |
228
+ | `DENTATE_CORTEX_INSTALLATION_TOKEN` | Dedicated installation bearer, at least 32 characters; never an admin token |
229
+ | `DENTATE_CORTEX_ORGANIZATION` | Server-assigned organization ID for this installation |
230
+ | `DENTATE_WORKER_IMAGE` | Approved immutable `registry/repository@sha256:...` worker image |
231
+
232
+ The ingress must replace client-supplied forwarding headers, and only that ingress may reach the public
233
+ service socket. The canonical hosted launcher trusts forwarding only from the explicitly configured
234
+ ingress. Login admission is bounded per verified transport source; shared NATs can share the pending
235
+ login allowance. Cookie sessions last 24 hours, store token hashes only and use Secure/HttpOnly cookies.
236
+ Mutations require exact Origin plus CSRF; state, nonce and S256 PKCE bind OIDC login.
237
+
238
+ Register these exact callbacks in the providers:
239
+ `DENTATE_PUBLIC_ORIGIN/auth/callback/google` and `DENTATE_PUBLIC_ORIGIN/auth/callback/cortex`.
240
+ Login starts at `/auth/login/google` or `/auth/login/cortex`; logout is `POST /auth/logout`.
241
+ Google must attest `email_verified=true`. Cortex must supply that claim in the signed ID token or in
242
+ subject-matching authenticated userinfo; Authentik's stock `email` scope hardcodes it to `false`, so
243
+ provision the Cortex client with `scripts/provision-dentate-oidc.py` (in the Cortex repo), which
244
+ installs an `email` mapping that attests only users whose current email equals their admin-pinned
245
+ `verified_email` attribute (`DENTATE_VERIFIED_EMAILS`). No equal-email auto-linking occurs. Owner
246
+ mode requires an explicit trusted issuer/subject mapping **and** verified
247
+ `dinu.marius.constantin@gmail.com`.
248
+ Without provider clients/source configuration, login remains unavailable; configuring a provider does
249
+ not prove its credentials or callback registration work until the real login roundtrip succeeds.
250
+
251
+ ### Cortex training workers and retention
252
+
253
+ Use the existing Cortex `/api/v1/resources` installation API. An operator registers a dedicated Dentate
254
+ installation whose `metadataUrl` is the frontdoor origin, `secretRef` resolves its installation bearer,
255
+ `maxRole` is `developer`, and `allowedImages` includes only the audited worker digest. No omegaXiv or
256
+ other application grants/tokens are shared. Cortex calls
257
+ `GET /v1/internal/cortex/runs/{id}` with that bearer to fetch server-derived execution metadata.
258
+ The frontdoor bootstraps `/installations/{id}/runs` with only `{runId}`, receives a short-lived execution
259
+ grant, then requests a fixed worker command/image/port through `/requests`. Attendees never select a
260
+ command, image, credential, role, mount or filesystem path.
261
+
262
+ Build the worker from `examples/rl-bootcamp/worker.Dockerfile` with the Dentate repository as build
263
+ context and a reviewed `TOKENIZER_REVISION`. The image preinstalls real CPU Torch, Spiral and the
264
+ tokenizer. It runs non-root with offline model loading; writable training artifacts go to Cortex's
265
+ bounded `/work`, not its smaller `/tmp`. Cortex's root lease supervisor clears supplementary groups
266
+ and drops the workload to UID/GID `1000` before execution; the standalone image uses `65532`.
267
+ Publish and approve the resulting immutable digest.
268
+
269
+ Each job is capped at 2 CPU, 2048 MiB memory, 256 MiB temporary workspace, and an execution lease
270
+ of at most 30 minutes. Requested resource leases subtract elapsed bootstrap time and a safety margin.
271
+ An installation should allow at most four concurrent containers / 8 GiB total memory; per-attendee
272
+ workspace limits should allow one. App admission independently caps four active jobs globally, one
273
+ per attendee, four retained records per attendee and 64 retained jobs globally. Invoke transport is
274
+ JSON-framed/base64, at most 1 MiB per response / 30 seconds; project/result chunks are 256 KiB and
275
+ training runs asynchronously with state polling. Upload packages are capped at 48 MiB compressed /
276
+ 64 MiB expanded, six allowlisted members, with traversal/symlink/duplicate/encrypted entries rejected.
277
+ The frontdoor validates method, session, Origin and CSRF before reading imports. At most two
278
+ authenticated imports are buffered through their handlers; excess imports get `503` with
279
+ `Retry-After` before their bodies are read. Ordinary bootcamp/auth request bodies are capped at
280
+ 64 KiB. Worker upload chunks retain their separate 512 KiB encoded-envelope limit.
281
+ Use the Cortex root `.cortex/app.yml` for deployment: it publishes the authenticating `site`
282
+ frontend, includes private `owner`, checks `/healthz`, and requires the protected environment-file path.
283
+
284
+ Server artifacts are temporary and deleted after 24 hours; attendees can download or explicitly
285
+ delete them sooner. Cancellation terminates the local process group or releases the Cortex resource.
286
+ On frontdoor restart, unfinished jobs fail explicitly rather than silently resuming; remaining resources
287
+ are released when possible and always remain subject to Cortex's authoritative lease. Transport errors,
288
+ lease expiry and release warnings remain observable, never replaced with synthetic successful metrics.
289
+ Transient filesystem or SQLite maintenance failures are logged and retried on the next 30-second cycle;
290
+ a failed artifact deletion does not stop cleanup of other jobs. Persistent failures require operator repair.
291
+ Run one frontdoor process (`workers=1`); external multi-replica scheduling is not part of this contract.
292
+
293
+ The installed PWA caches **only public shell assets**, never session/auth/API/job/owner responses.
294
+ Offline navigation displays the shell and a failed-closed session screen. It never claims to execute
295
+ Python offline. `mount_local(app, store_root)` from `dentate.bootcamp` adds local owner session and
296
+ project/job routes to an existing local API; the legacy API's own data and training routes stay intact.
297
+
298
+ ## Design docs
299
+
300
+ **The Spiral looped-transformer research harness (what actually ships in `pretrain/`):**
301
+ - **[docs/TRAINING.md](./docs/TRAINING.md)** — online SeqKD + the self-stabilizing optimizer (rotational-equilibrium
302
+ AdamW · WSD · EMA · z-loss), the KD losses (soft-KD · SP-KD · JEPA · teacher-init), and the deep-loop stability
303
+ additions — with rationale + citations. The authoritative spec for the shipped distillation loop.
304
+ - **[docs/ANALYSIS.md](./docs/ANALYSIS.md)** — the Analysis-tab interpretability & stability diagnostics (logit lens,
305
+ CKA, effective rank, ρ(J), the N-step Jacobian ∏J, arch internals) with formulas + citations.
306
+ - **[docs/RESULTS.md](./docs/RESULTS.md)** — every notable run with full reproduction parameters, the current best
307
+ (`ceiling-mem-fullstack`), capacity/plasticity probes, the best model's diagnostics, and the reasoning-model results.
308
+ - **[docs/MODEL_CARD.md](./docs/MODEL_CARD.md)** — the `spiral-reason` model card: architecture, ~1M core, training,
309
+ per-kind results, honest limits, performance, and how to run. **[docs/ROADMAP-REASONING.md](./docs/ROADMAP-REASONING.md)**
310
+ is the phased program (R0–R6); **[docs/FORMAT.md](./docs/FORMAT.md)** the chat protocol.
311
+ - Architecture + deep-loop stability live in the Spiral repo: `external/spiral/docs/{MATH,STABILITY,SOURCES}.md`.
312
+
313
+ **The RLVR-curriculum product vision (the broader Gauntlet design):**
314
+ - **[docs/RESEARCH-2026-06.md](./docs/RESEARCH-2026-06.md)** — framework research (PyTorch vs MLX, verl/TRL,
315
+ on-policy distillation, W&B, the Gemma license).
316
+ - **[docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md)** — three tiers (student/teacher/oracle), the 3-source
317
+ reward (R1 verifiable ⊕ R2 reference ⊕ R3 RLAIF), masking task-gen, the eval/baseline/W&B layer (mermaid).
318
+ - **[docs/REQUIREMENTS.md](./docs/REQUIREMENTS.md)** — F1–F30 / N1–N15 + roadmap.
319
+ - **[docs/DASHBOARD.md](./docs/DASHBOARD.md)** — the training-dashboard design + API contract (W&B/TensorBoard/
320
+ Kaggle/Gauntlet-inspired; deployable at `dentate.<ip>.sslip.io`).
321
+ - **[PLAN.md](./PLAN.md)** — the canonical phased checklist (P0–P7).
322
+
323
+ ## What's implemented — the dev harness (fake-backed vertical slice)
324
+ The full pipeline runs **deterministically with zero downloads** on a *fake backend* + *fake oracle/teacher*
325
+ over **synthetic** and **masking** task domains, so every layer is exercised and tested before real weights:
326
+
327
+ ```
328
+ data → reward (R1 gate+tests ⊕ R2 similarity ⊕ R3 RLAIF/PRM) → SFT/GKD/DPO/GRPO → eval gate (CI rollback) → online
329
+ ↘ events + structured logs ↘ experiment/checkpoint store (resume) ↘ dashboard
330
+ ```
331
+
332
+ **Fail-loud everywhere** (no hidden fallbacks): typed `errors.py`, an event bus that re-raises subscriber
333
+ failures, requested-but-missing W&B → `TrackerError` (never a silent no-op). Runs persist to an inspectable
334
+ JSON store with **checkpoint lineage + resume**; config via YAML + `--set` overrides; **sweeps** with multi-seed
335
+ CIs. Every knob is a CLI command/param.
336
+
337
+ Clean hexagonal architecture — a pure `domain/` (types + ports), with swappable adapters:
338
+
339
+ | Port (`domain/ports.py`) | Fake (dev/test) | Real (its phase) |
340
+ |---|---|---|
341
+ | `Backend` | `backends/fake.py` | `backends/mlx.py` (P0/P3/P5), `backends/cuda.py` (P7) |
342
+ | `Oracle` / `Judge` | `adapters/oracle/fake.py` | Anthropic (P3) |
343
+ | `Teacher` | `adapters/teacher/fake.py` | MLX teacher (P3.5) |
344
+ | `Tracker` | `NullTracker` | `WandbTracker` (`--report-to wandb`) |
345
+ | `TaskSource`+`Verifier` | `tasks/synthetic.py`, `tasks/masking.py` | Gauntlet runrecord adapter |
346
+
347
+ The fake backend models a policy as a scalar `skill` that rises with each training stage, so the curriculum,
348
+ the reward composition, and the CI-aware promotion gate are all real and testable — only the *learner* is
349
+ simulated. Swapping in MLX/CUDA + Anthropic is a one-line change in `harness.py`.
350
+
351
+ ## Run it
352
+ ```bash
353
+ # from dentate/ (uses the fake backend — no model downloads). The test targets hydrate dentate's
354
+ # own [dev] extra via `uv run`; the CLI targets still use the repo venv (../.venv).
355
+ make run # gated curriculum (default 'code'), persisted to ./runs
356
+ make test # 590 fast tests (fake backend; slow/real deselected)
357
+ make smoke # real MLX backend: downloads SmolLM-135M, runs a tiny LoRA SFT through the pipeline
358
+ make lint # ruff
359
+ make checkpoints # list runs (make checkpoints RUN=<id> → checkpoint lineage tree)
360
+ make site # build the static dashboard (D1) → site/public/index.html
361
+ make serve # run the interactive dashboard (D2) on http://127.0.0.1:8793
362
+
363
+ # or directly:
364
+ PYTHONPATH=. python -m dentate.cli run --domain synthetic --reward r1r2r3 --out runs --run-id demo
365
+ PYTHONPATH=. python -m dentate.cli run --backend mlx --model smollm-135m --stages sft --out runs # REAL
366
+ PYTHONPATH=. python -m dentate.cli resume --out runs --run demo --checkpoint baseline --stages grpo
367
+ PYTHONPATH=. python -m dentate.cli fork --out runs --run demo --set seed=1 --new-run-id demo2
368
+ PYTHONPATH=. python -m dentate.cli sweep --config sweep.yaml --out runs # multi-seed grid + CIs
369
+ PYTHONPATH=. python -m dentate.cli serve --out runs # interactive dashboard
370
+ PYTHONPATH=. python -m dentate.cli export-smi --checkpoint runs/RUN/checkpoints/final.pt \
371
+ --output /tmp/dentate-smi-source --tokenizer-dir PATH/TO/TOKENIZER \
372
+ --architecture auto --run-manifest runs/RUN/run.json
373
+ ```
374
+
375
+ **Dashboards.** **D1** (`dentate site`) renders a static dashboard: runs index → run report with ECharts
376
+ curves, stage timeline, the **full Config & Reproducibility panel** (every resolved parameter + copyable
377
+ `reproduce`/`fork` commands + W&B/lineage links), checkpoint lineage, dataset preview. **D2** (`dentate research-serve`)
378
+ is the interactive FastAPI app (`api.py` + `ui.py`): launch/fork/**train-further**/live-SSE, read+write API at
379
+ parity with the CLI. Deploy bundle (`site/Dockerfile`, `../docker-compose.dentate.yml`, `.cortex/app.yml`)
380
+ targets `dentate.<ip>.sslip.io`. See [docs/DASHBOARD.md](./docs/DASHBOARD.md).
381
+
382
+ **Real backend.** `--backend mlx` runs a real model (SmolLM-135M LoRA SFT via `mlx-lm`) through the *same*
383
+ curriculum/eval/store/dashboard as the fake backend (`make smoke`). DPO/GRPO on MLX = P5; CUDA/TRL = P7.
384
+
385
+ Example (`run --domain synthetic --reward r1r2r3`):
386
+ ```
387
+ baseline composite 0.252
388
+ sft 0.414 Δ+0.161 promoted gkd 0.571 Δ+0.157 promoted
389
+ dpo 0.582 Δ+0.011 promoted grpo 0.673 Δ+0.091 promoted
390
+ final composite 0.673 lift +0.420 gap_to_oracle 0.327 gap_to_teacher 0.244
391
+ ```
392
+
393
+ ## Layout
394
+ ```
395
+ dentate/
396
+ domain/ ports (Protocols) + immutable types — the hexagonal core
397
+ config.py typed specs (Model/Train/Reward/Teacher/Oracle/Distill/RewardModel/Domain/Eval/Wandb)
398
+ models/ registry: students (default Qwen3-4B-2507) + teachers (Gemma-4 ⇄ Qwen3-MoE)
399
+ tasks/ synthetic transforms + masking reconstruction (TaskSource + Verifier)
400
+ reward/ combine (gated R1⊕R2⊕R3) · service · distilled reward model
401
+ distill/ judge distillation (oracle rankings → local R3 reward model)
402
+ backends/ fake (dev) · mlx · cuda (stubs) · factory
403
+ adapters/ fake oracle/teacher · trackers (null/wandb)
404
+ data/ schemas (TRL-native) · jsonl io · replay buffer
405
+ eval/ stats · baseline registry + degradation gate · evaluate · report
406
+ train/ stage runners (sft/gkd/dpo/grpo) · curriculum (gated orchestrator)
407
+ online/ streaming continual-RLVR loop with replay
408
+ errors.py typed error hierarchy (fail loud, no hidden fallbacks)
409
+ obs.py structured logging + typed event bus
410
+ store.py experiment/checkpoint store (JSON) — lineage + resume; the dashboard reads this
411
+ manifest.py complete resolved run manifest (reproduce 1:1 + fork; no secrets)
412
+ runconfig.py RunConfig + YAML load + --set overrides + sweep expansion
413
+ site.py static dashboard generator (D1) — HTML + ECharts
414
+ api.py · ui.py interactive dashboard (D2) — FastAPI over the store/harness + vanilla-JS app + live SSE
415
+ backends/mlx.py REAL Apple-Silicon backend — load/generate/logprobs + LoRA SFT over mlx-lm
416
+ harness.py application wiring (curriculum / online / resume / fork / sweep; fake or mlx backend)
417
+ cli.py models | tasks | run | eval | online | checkpoints | resume | fork | sweep | site | serve | export-smi
418
+ export_smi.py tensor-only xLSTM/Spiral export for Sema Infer, with bound provenance
419
+ ```
420
+
421
+ ## Next (real backends)
422
+ P0 spikes wire `backends/mlx.py` to `mlx-lm`/`mlx-lm-lora` and pin versions; P3 adds the Anthropic oracle and
423
+ SFT-distill on `Qwen3-4B-2507`; P3.5 adds teacher GKD. The data + reward contracts are unchanged — see PLAN.md.