@bendyline/gezel-inference 0.0.0-stage → 0.1.0

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 (967) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -2
  3. package/dist/cache/adapter.d.ts +115 -0
  4. package/dist/cache/adapter.js +23 -0
  5. package/dist/cache/budget.d.ts +15 -0
  6. package/dist/cache/budget.js +31 -0
  7. package/dist/cache/controller.d.ts +205 -0
  8. package/dist/cache/controller.js +377 -0
  9. package/dist/catalog/LICENSE +21 -0
  10. package/dist/catalog/chat-models/bt/btl4-35b-q4/manifest.json +146 -0
  11. package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.0/manifest.json +15 -0
  12. package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.1/manifest.json +15 -0
  13. package/dist/catalog/chat-models/bt/btl4-compact-iq2/manifest.json +146 -0
  14. package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.0/manifest.json +15 -0
  15. package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.1/manifest.json +15 -0
  16. package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.2/manifest.json +15 -0
  17. package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/manifest.json +166 -0
  18. package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.0/manifest.json +62 -0
  19. package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.1/manifest.json +61 -0
  20. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/manifest.json +125 -0
  21. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/versions/1.0.0/manifest.json +27 -0
  22. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/manifest.json +125 -0
  23. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.0.0/manifest.json +27 -0
  24. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.1.0/manifest.json +27 -0
  25. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/manifest.json +126 -0
  26. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/versions/1.0.0/manifest.json +27 -0
  27. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/manifest.json +318 -0
  28. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.0.0/manifest.json +225 -0
  29. package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.1.0/manifest.json +225 -0
  30. package/dist/catalog/chat-models/ge/gemma4-12b-q4/manifest.json +249 -0
  31. package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.0.0/manifest.json +70 -0
  32. package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.0/manifest.json +72 -0
  33. package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.2/manifest.json +78 -0
  34. package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.3/manifest.json +78 -0
  35. package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.2.0/manifest.json +98 -0
  36. package/dist/catalog/chat-models/ge/gemma4-12b-q8/manifest.json +228 -0
  37. package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.0/manifest.json +72 -0
  38. package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.2/manifest.json +78 -0
  39. package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.3/manifest.json +78 -0
  40. package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.1.0/manifest.json +78 -0
  41. package/dist/catalog/chat-models/ge/gemma4-26b-q4/manifest.json +220 -0
  42. package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.1.0/manifest.json +75 -0
  43. package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.0/manifest.json +75 -0
  44. package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.1/manifest.json +80 -0
  45. package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.2/manifest.json +80 -0
  46. package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.3.0/manifest.json +81 -0
  47. package/dist/catalog/chat-models/ge/gemma4-31b-q4/manifest.json +226 -0
  48. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.0/manifest.json +80 -0
  49. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.1/manifest.json +82 -0
  50. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.0/manifest.json +82 -0
  51. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.1/manifest.json +95 -0
  52. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.2/manifest.json +95 -0
  53. package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.3.0/manifest.json +86 -0
  54. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/manifest.json +213 -0
  55. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.0/manifest.json +67 -0
  56. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.2/manifest.json +75 -0
  57. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.0/manifest.json +71 -0
  58. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.1/manifest.json +71 -0
  59. package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.3.0/manifest.json +71 -0
  60. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/manifest.json +205 -0
  61. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.0/manifest.json +72 -0
  62. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.2/manifest.json +75 -0
  63. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.0/manifest.json +76 -0
  64. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.1/manifest.json +76 -0
  65. package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.3.0/manifest.json +76 -0
  66. package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/manifest.json +127 -0
  67. package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/versions/1.0.0/manifest.json +20 -0
  68. package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/manifest.json +140 -0
  69. package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.0/manifest.json +23 -0
  70. package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.1/manifest.json +26 -0
  71. package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/manifest.json +247 -0
  72. package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.0.0/manifest.json +137 -0
  73. package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.1.0/manifest.json +135 -0
  74. package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/manifest.json +195 -0
  75. package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.0/manifest.json +72 -0
  76. package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.1/manifest.json +71 -0
  77. package/dist/catalog/chat-models/gr/granite4.2-30b-q4/manifest.json +200 -0
  78. package/dist/catalog/chat-models/gr/granite4.2-30b-q4/versions/1.0.0/manifest.json +72 -0
  79. package/dist/catalog/chat-models/gr/granite4.2-3b-q4/manifest.json +196 -0
  80. package/dist/catalog/chat-models/gr/granite4.2-3b-q4/versions/1.0.0/manifest.json +57 -0
  81. package/dist/catalog/chat-models/gr/granite4.2-8b-q4/manifest.json +189 -0
  82. package/dist/catalog/chat-models/gr/granite4.2-8b-q4/versions/1.0.0/manifest.json +57 -0
  83. package/dist/catalog/chat-models/index.json +1 -0
  84. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/manifest.json +235 -0
  85. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.0/manifest.json +124 -0
  86. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.1/manifest.json +124 -0
  87. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.2/manifest.json +123 -0
  88. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/manifest.json +257 -0
  89. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.0/manifest.json +145 -0
  90. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.1/manifest.json +145 -0
  91. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/manifest.json +285 -0
  92. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.0/manifest.json +174 -0
  93. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.1/manifest.json +174 -0
  94. package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.2/manifest.json +173 -0
  95. package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/manifest.json +162 -0
  96. package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.0/manifest.json +59 -0
  97. package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.1/manifest.json +58 -0
  98. package/dist/catalog/chat-models/ll/llama3.2-3b-q4/manifest.json +134 -0
  99. package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.0/manifest.json +57 -0
  100. package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.1/manifest.json +56 -0
  101. package/dist/catalog/chat-models/mi/minicpm5-1b-q4/manifest.json +156 -0
  102. package/dist/catalog/chat-models/mi/minicpm5-1b-q4/versions/1.0.0/manifest.json +57 -0
  103. package/dist/catalog/chat-models/mi/minicpm5-2b-q4/manifest.json +161 -0
  104. package/dist/catalog/chat-models/mi/minicpm5-2b-q4/versions/1.0.0/manifest.json +57 -0
  105. package/dist/catalog/chat-models/mi/mistral-7b-q4/manifest.json +159 -0
  106. package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.0/manifest.json +62 -0
  107. package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.1/manifest.json +61 -0
  108. package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/manifest.json +275 -0
  109. package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.0/manifest.json +154 -0
  110. package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.1/manifest.json +153 -0
  111. package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/manifest.json +135 -0
  112. package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.0/manifest.json +20 -0
  113. package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.1/manifest.json +20 -0
  114. package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.2/manifest.json +20 -0
  115. package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/manifest.json +138 -0
  116. package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/versions/1.0.0/manifest.json +14 -0
  117. package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/manifest.json +212 -0
  118. package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.0/manifest.json +94 -0
  119. package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.1/manifest.json +94 -0
  120. package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.2/manifest.json +93 -0
  121. package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/manifest.json +135 -0
  122. package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.0/manifest.json +30 -0
  123. package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.1/manifest.json +30 -0
  124. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/manifest.json +192 -0
  125. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.0/manifest.json +74 -0
  126. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.1/manifest.json +73 -0
  127. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/manifest.json +207 -0
  128. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.0/manifest.json +89 -0
  129. package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.1/manifest.json +88 -0
  130. package/dist/catalog/chat-models/or/ornith-35b-q4/manifest.json +224 -0
  131. package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.0/manifest.json +94 -0
  132. package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.1/manifest.json +93 -0
  133. package/dist/catalog/chat-models/or/ornith-35b-q8/manifest.json +244 -0
  134. package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.0/manifest.json +114 -0
  135. package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.1/manifest.json +113 -0
  136. package/dist/catalog/chat-models/or/ornith-9b-q4/manifest.json +215 -0
  137. package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.0/manifest.json +84 -0
  138. package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.1/manifest.json +83 -0
  139. package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/manifest.json +208 -0
  140. package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/versions/1.0.0/manifest.json +74 -0
  141. package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/manifest.json +223 -0
  142. package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/versions/1.0.0/manifest.json +89 -0
  143. package/dist/catalog/chat-models/or/ornith1.5-9b-q4/manifest.json +187 -0
  144. package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.0/manifest.json +53 -0
  145. package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.1/manifest.json +77 -0
  146. package/dist/catalog/chat-models/or/ornith1.5-9b-q8/manifest.json +192 -0
  147. package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.0/manifest.json +58 -0
  148. package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.1/manifest.json +82 -0
  149. package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/manifest.json +192 -0
  150. package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/versions/1.0.0/manifest.json +75 -0
  151. package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/manifest.json +315 -0
  152. package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.0/manifest.json +164 -0
  153. package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.1/manifest.json +164 -0
  154. package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.2/manifest.json +164 -0
  155. package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.3/manifest.json +163 -0
  156. package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/manifest.json +217 -0
  157. package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/versions/1.0.0/manifest.json +90 -0
  158. package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/manifest.json +194 -0
  159. package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.0/manifest.json +77 -0
  160. package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.2/manifest.json +76 -0
  161. package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.3/manifest.json +76 -0
  162. package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/manifest.json +188 -0
  163. package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.0/manifest.json +77 -0
  164. package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.2/manifest.json +76 -0
  165. package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.3/manifest.json +76 -0
  166. package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/manifest.json +205 -0
  167. package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.0/manifest.json +82 -0
  168. package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.2/manifest.json +81 -0
  169. package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.3/manifest.json +81 -0
  170. package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/manifest.json +230 -0
  171. package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.0/manifest.json +92 -0
  172. package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.4/manifest.json +91 -0
  173. package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.5/manifest.json +91 -0
  174. package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.6/manifest.json +115 -0
  175. package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/manifest.json +240 -0
  176. package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.0/manifest.json +102 -0
  177. package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.2/manifest.json +103 -0
  178. package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.3/manifest.json +103 -0
  179. package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.4/manifest.json +127 -0
  180. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/manifest.json +233 -0
  181. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.0/manifest.json +92 -0
  182. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.1/manifest.json +93 -0
  183. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.2/manifest.json +93 -0
  184. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.3/manifest.json +117 -0
  185. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/manifest.json +252 -0
  186. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.0/manifest.json +112 -0
  187. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.1/manifest.json +113 -0
  188. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.2/manifest.json +113 -0
  189. package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.3/manifest.json +137 -0
  190. package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/manifest.json +195 -0
  191. package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/versions/1.0.0/manifest.json +19 -0
  192. package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/manifest.json +194 -0
  193. package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/versions/1.0.0/manifest.json +19 -0
  194. package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/manifest.json +194 -0
  195. package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.0/manifest.json +19 -0
  196. package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.1/manifest.json +19 -0
  197. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/manifest.json +291 -0
  198. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.0/manifest.json +20 -0
  199. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.1/manifest.json +93 -0
  200. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.2/manifest.json +92 -0
  201. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.3/manifest.json +116 -0
  202. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.4/manifest.json +116 -0
  203. package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.5/manifest.json +116 -0
  204. package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/manifest.json +278 -0
  205. package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.0/manifest.json +20 -0
  206. package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.1/manifest.json +104 -0
  207. package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.2/manifest.json +103 -0
  208. package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.3/manifest.json +127 -0
  209. package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/manifest.json +278 -0
  210. package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.0/manifest.json +113 -0
  211. package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.1/manifest.json +113 -0
  212. package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.2/manifest.json +137 -0
  213. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/manifest.json +221 -0
  214. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/versions/1.0.0/manifest.json +36 -0
  215. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/manifest.json +429 -0
  216. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.0.0/manifest.json +36 -0
  217. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.0/manifest.json +205 -0
  218. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.1/manifest.json +244 -0
  219. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/manifest.json +203 -0
  220. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.0/manifest.json +21 -0
  221. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.1/manifest.json +31 -0
  222. package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.2/manifest.json +30 -0
  223. package/dist/catalog/chat-models/raw-index.json +1 -0
  224. package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/manifest.json +79 -0
  225. package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.0/manifest.json +15 -0
  226. package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.1/manifest.json +15 -0
  227. package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/manifest.json +204 -0
  228. package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.0/manifest.json +70 -0
  229. package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.1/manifest.json +70 -0
  230. package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/manifest.json +164 -0
  231. package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/versions/1.0.0/manifest.json +14 -0
  232. package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/manifest.json +26 -0
  233. package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/versions/2026.10.8/manifest.json +8950 -0
  234. package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/manifest.json +24 -0
  235. package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/versions/2026.10.1/manifest.json +658 -0
  236. package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/manifest.json +24 -0
  237. package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/versions/2026.10.1/manifest.json +666 -0
  238. package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/manifest.json +24 -0
  239. package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/versions/2026.10.2/manifest.json +182 -0
  240. package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/manifest.json +25 -0
  241. package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/versions/2026.10.5/manifest.json +38 -0
  242. package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/manifest.json +24 -0
  243. package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/versions/2026.10.1/manifest.json +558 -0
  244. package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/manifest.json +24 -0
  245. package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/versions/2026.10.1/manifest.json +258 -0
  246. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/manifest.json +24 -0
  247. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/versions/2026.10.1/manifest.json +318 -0
  248. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/manifest.json +24 -0
  249. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/versions/2026.10.1/manifest.json +266 -0
  250. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/manifest.json +24 -0
  251. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/versions/2026.10.1/manifest.json +186 -0
  252. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/manifest.json +24 -0
  253. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/versions/2026.10.1/manifest.json +138 -0
  254. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/manifest.json +24 -0
  255. package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/versions/2026.10.1/manifest.json +138 -0
  256. package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/manifest.json +24 -0
  257. package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/versions/2026.10.3/manifest.json +626 -0
  258. package/dist/catalog/knowledge-catalogs/index.json +1 -0
  259. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/manifest.json +22 -0
  260. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/versions/2026.10.16/manifest.json +18270 -0
  261. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/manifest.json +23 -0
  262. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/versions/2026.10.16/manifest.json +1098 -0
  263. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/manifest.json +23 -0
  264. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/versions/2026.10.16/manifest.json +722 -0
  265. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/manifest.json +23 -0
  266. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/versions/2026.10.16/manifest.json +530 -0
  267. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/manifest.json +23 -0
  268. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/versions/2026.10.16/manifest.json +602 -0
  269. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/manifest.json +23 -0
  270. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/versions/2026.10.16/manifest.json +250 -0
  271. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/manifest.json +22 -0
  272. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/versions/2026.10.16/manifest.json +16794 -0
  273. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/manifest.json +22 -0
  274. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/versions/2026.10.16/manifest.json +1106 -0
  275. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/manifest.json +22 -0
  276. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/versions/2026.10.16/manifest.json +234 -0
  277. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/manifest.json +22 -0
  278. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/versions/2026.10.16/manifest.json +522 -0
  279. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/manifest.json +22 -0
  280. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/versions/2026.10.16/manifest.json +1850 -0
  281. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/manifest.json +22 -0
  282. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/versions/2026.10.16/manifest.json +1734 -0
  283. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/manifest.json +22 -0
  284. package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/versions/2026.10.16/manifest.json +774 -0
  285. package/dist/catalog/knowledge-catalogs/raw-index.json +1 -0
  286. package/dist/catalog/knowledge-catalogs/re/regional-american-south/art.json +12 -0
  287. package/dist/catalog/knowledge-catalogs/re/regional-american-south/logo.webp +0 -0
  288. package/dist/catalog/knowledge-catalogs/re/regional-american-south/manifest.json +48 -0
  289. package/dist/catalog/knowledge-catalogs/re/regional-american-south/versions/2026.10.3/manifest.json +133 -0
  290. package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/art.json +12 -0
  291. package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/logo.webp +0 -0
  292. package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/manifest.json +48 -0
  293. package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/versions/2026.10.3/manifest.json +133 -0
  294. package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/art.json +12 -0
  295. package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/logo.webp +0 -0
  296. package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/manifest.json +48 -0
  297. package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/versions/2026.10.3/manifest.json +133 -0
  298. package/dist/catalog/knowledge-catalogs/re/regional-brazil/art.json +12 -0
  299. package/dist/catalog/knowledge-catalogs/re/regional-brazil/logo.webp +0 -0
  300. package/dist/catalog/knowledge-catalogs/re/regional-brazil/manifest.json +48 -0
  301. package/dist/catalog/knowledge-catalogs/re/regional-brazil/versions/2026.10.3/manifest.json +133 -0
  302. package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/art.json +12 -0
  303. package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/logo.webp +0 -0
  304. package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/manifest.json +48 -0
  305. package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/versions/2026.10.3/manifest.json +133 -0
  306. package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/art.json +12 -0
  307. package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/logo.webp +0 -0
  308. package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/manifest.json +48 -0
  309. package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/versions/2026.10.3/manifest.json +133 -0
  310. package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/art.json +12 -0
  311. package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/logo.webp +0 -0
  312. package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/manifest.json +48 -0
  313. package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/versions/2026.10.3/manifest.json +133 -0
  314. package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/art.json +12 -0
  315. package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/logo.webp +0 -0
  316. package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/manifest.json +48 -0
  317. package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/versions/2026.10.3/manifest.json +133 -0
  318. package/dist/catalog/knowledge-catalogs/re/regional-east-asia/art.json +12 -0
  319. package/dist/catalog/knowledge-catalogs/re/regional-east-asia/logo.webp +0 -0
  320. package/dist/catalog/knowledge-catalogs/re/regional-east-asia/manifest.json +48 -0
  321. package/dist/catalog/knowledge-catalogs/re/regional-east-asia/versions/2026.10.3/manifest.json +133 -0
  322. package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/art.json +12 -0
  323. package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/logo.webp +0 -0
  324. package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/manifest.json +48 -0
  325. package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/versions/2026.10.3/manifest.json +133 -0
  326. package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/art.json +12 -0
  327. package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/logo.webp +0 -0
  328. package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/manifest.json +48 -0
  329. package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/versions/2026.10.3/manifest.json +133 -0
  330. package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/art.json +12 -0
  331. package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/logo.webp +0 -0
  332. package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/manifest.json +48 -0
  333. package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/versions/2026.10.3/manifest.json +133 -0
  334. package/dist/catalog/knowledge-catalogs/re/regional-middle-east/art.json +12 -0
  335. package/dist/catalog/knowledge-catalogs/re/regional-middle-east/logo.webp +0 -0
  336. package/dist/catalog/knowledge-catalogs/re/regional-middle-east/manifest.json +48 -0
  337. package/dist/catalog/knowledge-catalogs/re/regional-middle-east/versions/2026.10.3/manifest.json +133 -0
  338. package/dist/catalog/knowledge-catalogs/re/regional-midwest/art.json +12 -0
  339. package/dist/catalog/knowledge-catalogs/re/regional-midwest/logo.webp +0 -0
  340. package/dist/catalog/knowledge-catalogs/re/regional-midwest/manifest.json +48 -0
  341. package/dist/catalog/knowledge-catalogs/re/regional-midwest/versions/2026.10.3/manifest.json +133 -0
  342. package/dist/catalog/knowledge-catalogs/re/regional-north-africa/art.json +12 -0
  343. package/dist/catalog/knowledge-catalogs/re/regional-north-africa/logo.webp +0 -0
  344. package/dist/catalog/knowledge-catalogs/re/regional-north-africa/manifest.json +48 -0
  345. package/dist/catalog/knowledge-catalogs/re/regional-north-africa/versions/2026.10.3/manifest.json +133 -0
  346. package/dist/catalog/knowledge-catalogs/re/regional-northeast/art.json +12 -0
  347. package/dist/catalog/knowledge-catalogs/re/regional-northeast/logo.webp +0 -0
  348. package/dist/catalog/knowledge-catalogs/re/regional-northeast/manifest.json +48 -0
  349. package/dist/catalog/knowledge-catalogs/re/regional-northeast/versions/2026.10.3/manifest.json +133 -0
  350. package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/art.json +12 -0
  351. package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/logo.webp +0 -0
  352. package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/manifest.json +48 -0
  353. package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/versions/2026.10.3/manifest.json +133 -0
  354. package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/art.json +12 -0
  355. package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/logo.webp +0 -0
  356. package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/manifest.json +48 -0
  357. package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/versions/2026.10.3/manifest.json +133 -0
  358. package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/art.json +12 -0
  359. package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/logo.webp +0 -0
  360. package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/manifest.json +48 -0
  361. package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/versions/2026.10.3/manifest.json +133 -0
  362. package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/art.json +12 -0
  363. package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/logo.webp +0 -0
  364. package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/manifest.json +48 -0
  365. package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/versions/2026.10.3/manifest.json +133 -0
  366. package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/art.json +12 -0
  367. package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/logo.webp +0 -0
  368. package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/manifest.json +48 -0
  369. package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/versions/2026.10.3/manifest.json +133 -0
  370. package/dist/catalog/knowledge-catalogs/re/regional-south-asia/art.json +12 -0
  371. package/dist/catalog/knowledge-catalogs/re/regional-south-asia/logo.webp +0 -0
  372. package/dist/catalog/knowledge-catalogs/re/regional-south-asia/manifest.json +48 -0
  373. package/dist/catalog/knowledge-catalogs/re/regional-south-asia/versions/2026.10.3/manifest.json +133 -0
  374. package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/art.json +12 -0
  375. package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/logo.webp +0 -0
  376. package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/manifest.json +48 -0
  377. package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/versions/2026.10.3/manifest.json +133 -0
  378. package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/art.json +12 -0
  379. package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/logo.webp +0 -0
  380. package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/manifest.json +48 -0
  381. package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/versions/2026.10.3/manifest.json +133 -0
  382. package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/art.json +12 -0
  383. package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/logo.webp +0 -0
  384. package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/manifest.json +48 -0
  385. package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/versions/2026.10.3/manifest.json +133 -0
  386. package/dist/catalog/knowledge-catalogs/re/regional-western-europe/art.json +12 -0
  387. package/dist/catalog/knowledge-catalogs/re/regional-western-europe/logo.webp +0 -0
  388. package/dist/catalog/knowledge-catalogs/re/regional-western-europe/manifest.json +48 -0
  389. package/dist/catalog/knowledge-catalogs/re/regional-western-europe/versions/2026.10.3/manifest.json +133 -0
  390. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/art.json +12 -0
  391. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/logo.webp +0 -0
  392. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/manifest.json +28 -0
  393. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.2/manifest.json +53 -0
  394. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.3/manifest.json +885 -0
  395. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.5/manifest.json +157 -0
  396. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/art.json +11 -0
  397. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/logo.webp +0 -0
  398. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/manifest.json +32 -0
  399. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.2/manifest.json +69 -0
  400. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.3/manifest.json +741 -0
  401. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.5/manifest.json +173 -0
  402. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/art.json +12 -0
  403. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/logo.webp +0 -0
  404. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/manifest.json +69 -0
  405. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.4/manifest.json +217 -0
  406. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.5/manifest.json +217 -0
  407. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/art.json +12 -0
  408. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/logo.webp +0 -0
  409. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/manifest.json +64 -0
  410. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.4/manifest.json +197 -0
  411. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.5/manifest.json +197 -0
  412. package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/art.json +12 -0
  413. package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/logo.webp +0 -0
  414. package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/manifest.json +64 -0
  415. package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.4.5/manifest.json +197 -0
  416. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/art.json +11 -0
  417. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/logo.webp +0 -0
  418. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/manifest.json +29 -0
  419. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.2/manifest.json +57 -0
  420. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.3/manifest.json +925 -0
  421. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.5/manifest.json +185 -0
  422. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/art.json +12 -0
  423. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/logo.webp +0 -0
  424. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/manifest.json +28 -0
  425. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.2/manifest.json +53 -0
  426. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.3/manifest.json +1665 -0
  427. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.5/manifest.json +133 -0
  428. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/art.json +12 -0
  429. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/logo.webp +0 -0
  430. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/manifest.json +29 -0
  431. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.2/manifest.json +57 -0
  432. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.3/manifest.json +1233 -0
  433. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.5/manifest.json +141 -0
  434. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/art.json +11 -0
  435. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/logo.webp +0 -0
  436. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/manifest.json +29 -0
  437. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.2/manifest.json +57 -0
  438. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.3/manifest.json +493 -0
  439. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.5/manifest.json +185 -0
  440. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/art.json +12 -0
  441. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/logo.webp +0 -0
  442. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/manifest.json +63 -0
  443. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.4/manifest.json +193 -0
  444. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.5/manifest.json +193 -0
  445. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/art.json +12 -0
  446. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/logo.webp +0 -0
  447. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/manifest.json +30 -0
  448. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.2/manifest.json +61 -0
  449. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.3/manifest.json +665 -0
  450. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.5/manifest.json +177 -0
  451. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/art.json +12 -0
  452. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/logo.webp +0 -0
  453. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/manifest.json +29 -0
  454. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.2/manifest.json +57 -0
  455. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.3/manifest.json +745 -0
  456. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.5/manifest.json +185 -0
  457. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/art.json +12 -0
  458. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/logo.webp +0 -0
  459. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/manifest.json +62 -0
  460. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.4/manifest.json +189 -0
  461. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.5/manifest.json +189 -0
  462. package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/art.json +12 -0
  463. package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/logo.webp +0 -0
  464. package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/manifest.json +64 -0
  465. package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.4.5/manifest.json +197 -0
  466. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/art.json +12 -0
  467. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/logo.webp +0 -0
  468. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/manifest.json +64 -0
  469. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.4/manifest.json +197 -0
  470. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.5/manifest.json +197 -0
  471. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/art.json +12 -0
  472. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/logo.webp +0 -0
  473. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/manifest.json +30 -0
  474. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.2/manifest.json +61 -0
  475. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.3/manifest.json +1253 -0
  476. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.5/manifest.json +189 -0
  477. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/art.json +12 -0
  478. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/logo.webp +0 -0
  479. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/manifest.json +29 -0
  480. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.2/manifest.json +57 -0
  481. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.3/manifest.json +1957 -0
  482. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.5/manifest.json +185 -0
  483. package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/art.json +12 -0
  484. package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/logo.webp +0 -0
  485. package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/manifest.json +63 -0
  486. package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.4.5/manifest.json +193 -0
  487. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/art.json +11 -0
  488. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/logo.webp +0 -0
  489. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/manifest.json +45 -0
  490. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.4/manifest.json +121 -0
  491. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.5/manifest.json +173 -0
  492. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/art.json +12 -0
  493. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/logo.webp +0 -0
  494. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/manifest.json +62 -0
  495. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.4/manifest.json +189 -0
  496. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.5/manifest.json +189 -0
  497. package/dist/catalog/provenance.json +8 -0
  498. package/dist/chat/catalog-model-lookup.d.ts +21 -0
  499. package/dist/chat/catalog-model-lookup.js +48 -0
  500. package/dist/chat/local-model-tier.d.ts +1 -0
  501. package/dist/chat/local-model-tier.js +2 -0
  502. package/dist/chat/vision-capability.d.ts +1 -0
  503. package/dist/chat/vision-capability.js +3 -0
  504. package/dist/engine-components.d.ts +30 -0
  505. package/dist/engine-components.js +144 -0
  506. package/dist/engines/electron-native-reuse.d.ts +65 -0
  507. package/dist/engines/electron-native-reuse.js +305 -0
  508. package/dist/engines/native-file-manifest.json +1320 -0
  509. package/dist/engines/native-manifest.d.ts +70 -0
  510. package/dist/engines/native-manifest.js +98 -0
  511. package/dist/engines/registry.d.ts +88 -0
  512. package/dist/engines/registry.js +217 -0
  513. package/dist/engines/resolver.d.ts +121 -0
  514. package/dist/engines/resolver.js +894 -0
  515. package/dist/engines/signature.d.ts +85 -0
  516. package/dist/engines/signature.js +231 -0
  517. package/dist/fs/atomic.d.ts +53 -0
  518. package/dist/fs/atomic.js +202 -0
  519. package/dist/fs/config-store.d.ts +14 -0
  520. package/dist/fs/config-store.js +101 -0
  521. package/dist/fs/home-permissions.d.ts +18 -0
  522. package/dist/fs/home-permissions.js +27 -0
  523. package/dist/fs/safe-paths.d.ts +107 -0
  524. package/dist/fs/safe-paths.js +264 -0
  525. package/dist/fs/security-json.d.ts +13 -0
  526. package/dist/fs/security-json.js +67 -0
  527. package/dist/http/auth-context.d.ts +23 -0
  528. package/dist/http/auth-context.js +1 -0
  529. package/dist/http/engine-runtime-context.d.ts +30 -0
  530. package/dist/http/engine-runtime-context.js +1 -0
  531. package/dist/http/external-conversation-contract.d.ts +49 -0
  532. package/dist/http/external-conversation-contract.js +1 -0
  533. package/dist/http/external-conversation-headers.d.ts +11 -0
  534. package/dist/http/external-conversation-headers.js +11 -0
  535. package/dist/http/inference-context.d.ts +36 -0
  536. package/dist/http/inference-context.js +1 -0
  537. package/dist/http/model-inventory-cache.d.ts +8 -0
  538. package/dist/http/model-inventory-cache.js +8 -0
  539. package/dist/http/openai-compat/action-ledger.d.ts +15 -0
  540. package/dist/http/openai-compat/action-ledger.js +119 -0
  541. package/dist/http/openai-compat/apple-model.d.ts +3 -0
  542. package/dist/http/openai-compat/apple-model.js +44 -0
  543. package/dist/http/openai-compat/caller-owned-profile.d.ts +7 -0
  544. package/dist/http/openai-compat/caller-owned-profile.js +18 -0
  545. package/dist/http/openai-compat/chat-progress.d.ts +9 -0
  546. package/dist/http/openai-compat/chat-progress.js +69 -0
  547. package/dist/http/openai-compat/chat-target.d.ts +76 -0
  548. package/dist/http/openai-compat/chat-target.js +97 -0
  549. package/dist/http/openai-compat/embeddings.d.ts +37 -0
  550. package/dist/http/openai-compat/embeddings.js +86 -0
  551. package/dist/http/openai-compat/request-tuning.d.ts +35 -0
  552. package/dist/http/openai-compat/request-tuning.js +87 -0
  553. package/dist/http/openai-compat/responses-streaming.d.ts +351 -0
  554. package/dist/http/openai-compat/responses-streaming.js +717 -0
  555. package/dist/http/openai-compat/responses-translate.d.ts +215 -0
  556. package/dist/http/openai-compat/responses-translate.js +377 -0
  557. package/dist/http/openai-compat/streaming-telemetry.d.ts +30 -0
  558. package/dist/http/openai-compat/streaming-telemetry.js +88 -0
  559. package/dist/http/openai-compat/streaming.d.ts +141 -0
  560. package/dist/http/openai-compat/streaming.js +687 -0
  561. package/dist/http/openai-compat/tool-call-stream-filter.d.ts +33 -0
  562. package/dist/http/openai-compat/tool-call-stream-filter.js +110 -0
  563. package/dist/http/openai-compat/translate.d.ts +254 -0
  564. package/dist/http/openai-compat/translate.js +485 -0
  565. package/dist/http/routes/engines.d.ts +13 -0
  566. package/dist/http/routes/engines.js +366 -0
  567. package/dist/http/routes/machine-engine-proxy.d.ts +26 -0
  568. package/dist/http/routes/machine-engine-proxy.js +43 -0
  569. package/dist/http/routes/model-bundles.d.ts +4 -0
  570. package/dist/http/routes/model-bundles.js +190 -0
  571. package/dist/http/routes/v1-chat.d.ts +72 -0
  572. package/dist/http/routes/v1-chat.js +645 -0
  573. package/dist/http/routes/v1-embeddings.d.ts +3 -0
  574. package/dist/http/routes/v1-embeddings.js +82 -0
  575. package/dist/http/routes/v1-knowledge.d.ts +4 -0
  576. package/dist/http/routes/v1-knowledge.js +304 -0
  577. package/dist/http/routes/v1-models-ensure.d.ts +32 -0
  578. package/dist/http/routes/v1-models-ensure.js +122 -0
  579. package/dist/http/routes/v1-models.d.ts +8 -0
  580. package/dist/http/routes/v1-models.js +189 -0
  581. package/dist/http/routes/v1-responses.d.ts +20 -0
  582. package/dist/http/routes/v1-responses.js +327 -0
  583. package/dist/index.d.ts +2 -0
  584. package/dist/index.js +2 -0
  585. package/dist/inference-service.d.ts +28 -0
  586. package/dist/inference-service.js +275 -0
  587. package/dist/knowledge/admission.d.ts +3 -0
  588. package/dist/knowledge/admission.js +22 -0
  589. package/dist/knowledge/bundled-catalog.d.ts +2 -0
  590. package/dist/knowledge/bundled-catalog.js +2 -0
  591. package/dist/knowledge/catalog-host.d.ts +103 -0
  592. package/dist/knowledge/catalog-host.js +180 -0
  593. package/dist/knowledge/catalog-source.d.ts +22 -0
  594. package/dist/knowledge/catalog-source.js +35 -0
  595. package/dist/knowledge/install.d.ts +55 -0
  596. package/dist/knowledge/install.js +274 -0
  597. package/dist/knowledge/manager.d.ts +287 -0
  598. package/dist/knowledge/manager.js +1540 -0
  599. package/dist/knowledge/registry.d.ts +35 -0
  600. package/dist/knowledge/registry.js +123 -0
  601. package/dist/knowledge/search-worker.d.ts +17 -0
  602. package/dist/knowledge/search-worker.js +36 -0
  603. package/dist/knowledge/shared-install-contract.d.ts +19 -0
  604. package/dist/knowledge/shared-install-contract.js +1 -0
  605. package/dist/knowledge/spatial-query.d.ts +11 -0
  606. package/dist/knowledge/spatial-query.js +33 -0
  607. package/dist/knowledge/trust-anchors.d.ts +11 -0
  608. package/dist/knowledge/trust-anchors.js +51 -0
  609. package/dist/knowledge/vector-floors.d.ts +44 -0
  610. package/dist/knowledge/vector-floors.js +92 -0
  611. package/dist/knowledge/worker-host.d.ts +9 -0
  612. package/dist/knowledge/worker-host.js +179 -0
  613. package/dist/kokoro-lexicon/LICENSE +202 -0
  614. package/dist/kokoro-lexicon/lexicon-gb-en.txt.gz +0 -0
  615. package/dist/kokoro-lexicon/lexicon-us-en.txt.gz +0 -0
  616. package/dist/kokoro-lexicon/manifest.json +23 -0
  617. package/dist/machine-engine/inspect-runtime.d.ts +3 -0
  618. package/dist/machine-engine/inspect-runtime.js +48 -0
  619. package/dist/machine-engine/knowledge-assets.d.ts +79 -0
  620. package/dist/machine-engine/knowledge-assets.js +505 -0
  621. package/dist/memory/embed-core.d.ts +131 -0
  622. package/dist/memory/embed-core.js +398 -0
  623. package/dist/memory/embed-worker.d.ts +23 -0
  624. package/dist/memory/embed-worker.js +49 -0
  625. package/dist/memory/embeddings.d.ts +105 -0
  626. package/dist/memory/embeddings.js +467 -0
  627. package/dist/model-profile/behaviors/tools-mlx-template-fix.d.ts +1 -0
  628. package/dist/model-profile/behaviors/tools-mlx-template-fix.js +2 -0
  629. package/dist/model-profile/behaviors/turn-ramble-detection.d.ts +1 -0
  630. package/dist/model-profile/behaviors/turn-ramble-detection.js +2 -0
  631. package/dist/model-profile/defaults.d.ts +1 -0
  632. package/dist/model-profile/defaults.js +2 -0
  633. package/dist/model-profile/index.d.ts +9 -0
  634. package/dist/model-profile/index.js +7 -0
  635. package/dist/model-profile/registry.d.ts +15 -0
  636. package/dist/model-profile/registry.js +18 -0
  637. package/dist/model-profile/runtime.d.ts +48 -0
  638. package/dist/model-profile/runtime.js +131 -0
  639. package/dist/model-profile/tool-grammar.d.ts +1 -0
  640. package/dist/model-profile/tool-grammar.js +2 -0
  641. package/dist/model-profile/tuning.d.ts +19 -0
  642. package/dist/model-profile/tuning.js +21 -0
  643. package/dist/model-profile/types.d.ts +1 -0
  644. package/dist/model-profile/types.js +2 -0
  645. package/dist/models/bundle-storage.d.ts +28 -0
  646. package/dist/models/bundle-storage.js +80 -0
  647. package/dist/models/catalog-drift.d.ts +48 -0
  648. package/dist/models/catalog-drift.js +94 -0
  649. package/dist/models/catalog-payload-identity.d.ts +107 -0
  650. package/dist/models/catalog-payload-identity.js +254 -0
  651. package/dist/models/ensure.d.ts +125 -0
  652. package/dist/models/ensure.js +205 -0
  653. package/dist/models/gezmodel.d.ts +47 -0
  654. package/dist/models/gezmodel.js +742 -0
  655. package/dist/models/install-registry.d.ts +101 -0
  656. package/dist/models/install-registry.js +216 -0
  657. package/dist/models/model-id.d.ts +22 -0
  658. package/dist/models/model-id.js +40 -0
  659. package/dist/models/storage-roots.d.ts +274 -0
  660. package/dist/models/storage-roots.js +865 -0
  661. package/dist/native-release-entry.d.ts +16 -0
  662. package/dist/native-release-entry.js +16 -0
  663. package/dist/perf/redact-path.d.ts +2 -0
  664. package/dist/perf/redact-path.js +27 -0
  665. package/dist/perf/responsiveness.d.ts +70 -0
  666. package/dist/perf/responsiveness.js +560 -0
  667. package/dist/providers/active-install-message.d.ts +42 -0
  668. package/dist/providers/active-install-message.js +49 -0
  669. package/dist/providers/apple-foundation-models/binary.d.ts +4 -0
  670. package/dist/providers/apple-foundation-models/binary.js +18 -0
  671. package/dist/providers/apple-foundation-models/helper.d.ts +66 -0
  672. package/dist/providers/apple-foundation-models/helper.js +262 -0
  673. package/dist/providers/apple-foundation-models/provider.d.ts +82 -0
  674. package/dist/providers/apple-foundation-models/provider.js +389 -0
  675. package/dist/providers/apple-foundation-models/status.d.ts +9 -0
  676. package/dist/providers/apple-foundation-models/status.js +49 -0
  677. package/dist/providers/audio/kokoro-frontend.d.ts +50 -0
  678. package/dist/providers/audio/kokoro-frontend.js +113 -0
  679. package/dist/providers/audio/managed-speech-model.d.ts +9 -0
  680. package/dist/providers/audio/managed-speech-model.js +86 -0
  681. package/dist/providers/audio/types.d.ts +202 -0
  682. package/dist/providers/audio/types.js +17 -0
  683. package/dist/providers/audio/whisper-cpp.d.ts +99 -0
  684. package/dist/providers/audio/whisper-cpp.js +420 -0
  685. package/dist/providers/audio-persister-contract.d.ts +13 -0
  686. package/dist/providers/audio-persister-contract.js +1 -0
  687. package/dist/providers/catalog-model-config.d.ts +63 -0
  688. package/dist/providers/catalog-model-config.js +95 -0
  689. package/dist/providers/code-block-salvage.d.ts +1 -0
  690. package/dist/providers/code-block-salvage.js +2 -0
  691. package/dist/providers/codex-cli/reasoning.d.ts +8 -0
  692. package/dist/providers/codex-cli/reasoning.js +17 -0
  693. package/dist/providers/complete-tool-call.d.ts +16 -0
  694. package/dist/providers/complete-tool-call.js +25 -0
  695. package/dist/providers/constrained-turn.d.ts +1 -0
  696. package/dist/providers/constrained-turn.js +2 -0
  697. package/dist/providers/deliverable-read-pacing.d.ts +1 -0
  698. package/dist/providers/deliverable-read-pacing.js +2 -0
  699. package/dist/providers/direct-file-work-prompt.d.ts +1 -0
  700. package/dist/providers/direct-file-work-prompt.js +2 -0
  701. package/dist/providers/ds4/build-provider.d.ts +100 -0
  702. package/dist/providers/ds4/build-provider.js +539 -0
  703. package/dist/providers/ds4/cache-adapter.d.ts +42 -0
  704. package/dist/providers/ds4/cache-adapter.js +110 -0
  705. package/dist/providers/ds4/dspark.d.ts +83 -0
  706. package/dist/providers/ds4/dspark.js +107 -0
  707. package/dist/providers/ds4/mtp.d.ts +32 -0
  708. package/dist/providers/ds4/mtp.js +46 -0
  709. package/dist/providers/ds4/provider.d.ts +67 -0
  710. package/dist/providers/ds4/provider.js +104 -0
  711. package/dist/providers/ds4/residency.d.ts +143 -0
  712. package/dist/providers/ds4/residency.js +139 -0
  713. package/dist/providers/ds4/stdout-parser.d.ts +47 -0
  714. package/dist/providers/ds4/stdout-parser.js +134 -0
  715. package/dist/providers/duplicate-tool-calls.d.ts +1 -0
  716. package/dist/providers/duplicate-tool-calls.js +2 -0
  717. package/dist/providers/file-repair-policy.d.ts +1 -0
  718. package/dist/providers/file-repair-policy.js +2 -0
  719. package/dist/providers/gpu-arbiter.d.ts +159 -0
  720. package/dist/providers/gpu-arbiter.js +301 -0
  721. package/dist/providers/image-persister-contract.d.ts +15 -0
  722. package/dist/providers/image-persister-contract.js +1 -0
  723. package/dist/providers/llama-cpp/build-metadata.d.ts +13 -0
  724. package/dist/providers/llama-cpp/build-metadata.js +39 -0
  725. package/dist/providers/llama-cpp/build-provider.d.ts +66 -0
  726. package/dist/providers/llama-cpp/build-provider.js +1491 -0
  727. package/dist/providers/llama-cpp/cache-adapter.d.ts +242 -0
  728. package/dist/providers/llama-cpp/cache-adapter.js +689 -0
  729. package/dist/providers/llama-cpp/devices.d.ts +130 -0
  730. package/dist/providers/llama-cpp/devices.js +256 -0
  731. package/dist/providers/llama-cpp/disk-cache.d.ts +8 -0
  732. package/dist/providers/llama-cpp/disk-cache.js +112 -0
  733. package/dist/providers/llama-cpp/engine-flags.d.ts +181 -0
  734. package/dist/providers/llama-cpp/engine-flags.js +279 -0
  735. package/dist/providers/llama-cpp/gguf-metadata-async.d.ts +11 -0
  736. package/dist/providers/llama-cpp/gguf-metadata-async.js +180 -0
  737. package/dist/providers/llama-cpp/gguf-metadata-worker.d.ts +7 -0
  738. package/dist/providers/llama-cpp/gguf-metadata-worker.js +27 -0
  739. package/dist/providers/llama-cpp/gguf-metadata.d.ts +198 -0
  740. package/dist/providers/llama-cpp/gguf-metadata.js +615 -0
  741. package/dist/providers/llama-cpp/gguf-quantization-backfill.d.ts +32 -0
  742. package/dist/providers/llama-cpp/gguf-quantization-backfill.js +75 -0
  743. package/dist/providers/llama-cpp/index.d.ts +10 -0
  744. package/dist/providers/llama-cpp/index.js +13 -0
  745. package/dist/providers/llama-cpp/kv-cache-type.d.ts +118 -0
  746. package/dist/providers/llama-cpp/kv-cache-type.js +140 -0
  747. package/dist/providers/llama-cpp/log.d.ts +92 -0
  748. package/dist/providers/llama-cpp/log.js +280 -0
  749. package/dist/providers/llama-cpp/models.d.ts +389 -0
  750. package/dist/providers/llama-cpp/models.js +1011 -0
  751. package/dist/providers/llama-cpp/offload-planner.d.ts +339 -0
  752. package/dist/providers/llama-cpp/offload-planner.js +524 -0
  753. package/dist/providers/llama-cpp/provider.d.ts +493 -0
  754. package/dist/providers/llama-cpp/provider.js +862 -0
  755. package/dist/providers/llama-cpp/reasoning-launch.d.ts +7 -0
  756. package/dist/providers/llama-cpp/reasoning-launch.js +14 -0
  757. package/dist/providers/llama-cpp/spec-draft.d.ts +44 -0
  758. package/dist/providers/llama-cpp/spec-draft.js +44 -0
  759. package/dist/providers/llama-cpp/stdout-parser.d.ts +70 -0
  760. package/dist/providers/llama-cpp/stdout-parser.js +197 -0
  761. package/dist/providers/local-tool-call-salvage.d.ts +1 -0
  762. package/dist/providers/local-tool-call-salvage.js +2 -0
  763. package/dist/providers/local-turn-policy.d.ts +1 -0
  764. package/dist/providers/local-turn-policy.js +2 -0
  765. package/dist/providers/mlx/async-file-handoff.d.ts +11 -0
  766. package/dist/providers/mlx/async-file-handoff.js +25 -0
  767. package/dist/providers/mlx/build-provider.d.ts +65 -0
  768. package/dist/providers/mlx/build-provider.js +717 -0
  769. package/dist/providers/mlx/cache-adapter.d.ts +161 -0
  770. package/dist/providers/mlx/cache-adapter.js +445 -0
  771. package/dist/providers/mlx/chat-protocol.d.ts +48 -0
  772. package/dist/providers/mlx/chat-protocol.js +8 -0
  773. package/dist/providers/mlx/config-parser.d.ts +29 -0
  774. package/dist/providers/mlx/config-parser.js +81 -0
  775. package/dist/providers/mlx/engine-gate.d.ts +51 -0
  776. package/dist/providers/mlx/engine-gate.js +207 -0
  777. package/dist/providers/mlx/engine-hold.d.ts +41 -0
  778. package/dist/providers/mlx/engine-hold.js +59 -0
  779. package/dist/providers/mlx/engine-log-router.d.ts +84 -0
  780. package/dist/providers/mlx/engine-log-router.js +137 -0
  781. package/dist/providers/mlx/engine-stats-sampler.d.ts +36 -0
  782. package/dist/providers/mlx/engine-stats-sampler.js +59 -0
  783. package/dist/providers/mlx/index.d.ts +10 -0
  784. package/dist/providers/mlx/index.js +10 -0
  785. package/dist/providers/mlx/log.d.ts +55 -0
  786. package/dist/providers/mlx/log.js +157 -0
  787. package/dist/providers/mlx/model-geometry.d.ts +35 -0
  788. package/dist/providers/mlx/model-geometry.js +118 -0
  789. package/dist/providers/mlx/models.d.ts +289 -0
  790. package/dist/providers/mlx/models.js +1079 -0
  791. package/dist/providers/mlx/provider.d.ts +404 -0
  792. package/dist/providers/mlx/provider.js +3017 -0
  793. package/dist/providers/mlx/python/cache_persist.py +348 -0
  794. package/dist/providers/mlx/python/cache_seed.py +402 -0
  795. package/dist/providers/mlx/python/gezel_mlx_server.py +4491 -0
  796. package/dist/providers/mlx/python/lfm2_compat.py +55 -0
  797. package/dist/providers/mlx/python/qwen3_5_text_compat.py +60 -0
  798. package/dist/providers/mlx/python/qwen4_ple.py +159 -0
  799. package/dist/providers/mlx/python/spec_decode.py +775 -0
  800. package/dist/providers/mlx/python/template_stability.py +133 -0
  801. package/dist/providers/mlx/python/think_budget.py +113 -0
  802. package/dist/providers/mlx/python/tool_args_json.py +297 -0
  803. package/dist/providers/mlx/python/tool_call_stream.py +265 -0
  804. package/dist/providers/mlx/python/tool_grammar.py +794 -0
  805. package/dist/providers/mlx/python/vision_inputs.py +64 -0
  806. package/dist/providers/mlx/python/wave_policy.py +147 -0
  807. package/dist/providers/mlx/reasoning-stream.d.ts +85 -0
  808. package/dist/providers/mlx/reasoning-stream.js +196 -0
  809. package/dist/providers/mlx/request-shape.d.ts +34 -0
  810. package/dist/providers/mlx/request-shape.js +42 -0
  811. package/dist/providers/mlx/runtime-diagnostics.d.ts +29 -0
  812. package/dist/providers/mlx/runtime-diagnostics.js +162 -0
  813. package/dist/providers/mlx/spec-drafter.d.ts +25 -0
  814. package/dist/providers/mlx/spec-drafter.js +73 -0
  815. package/dist/providers/mlx/stdout-parser.d.ts +60 -0
  816. package/dist/providers/mlx/stdout-parser.js +254 -0
  817. package/dist/providers/mlx/textual-tool-call-salvage.d.ts +46 -0
  818. package/dist/providers/mlx/textual-tool-call-salvage.js +396 -0
  819. package/dist/providers/mlx/tool-call-protocol.d.ts +65 -0
  820. package/dist/providers/mlx/tool-call-protocol.js +140 -0
  821. package/dist/providers/mlx/tool-call-stripper.d.ts +68 -0
  822. package/dist/providers/mlx/tool-call-stripper.js +153 -0
  823. package/dist/providers/mlx/tool-image-retention.d.ts +23 -0
  824. package/dist/providers/mlx/tool-image-retention.js +43 -0
  825. package/dist/providers/mlx/turn-telemetry.d.ts +22 -0
  826. package/dist/providers/mlx/turn-telemetry.js +45 -0
  827. package/dist/providers/mlx/venv.d.ts +91 -0
  828. package/dist/providers/mlx/venv.js +111 -0
  829. package/dist/providers/mlx/vision-mode.d.ts +92 -0
  830. package/dist/providers/mlx/vision-mode.js +187 -0
  831. package/dist/providers/mlx/vision.d.ts +2 -0
  832. package/dist/providers/mlx/vision.js +12 -0
  833. package/dist/providers/mlx/wire-transcript.d.ts +14 -0
  834. package/dist/providers/mlx/wire-transcript.js +43 -0
  835. package/dist/providers/native/capacity-broker.d.ts +812 -0
  836. package/dist/providers/native/capacity-broker.js +1058 -0
  837. package/dist/providers/native/capacity-budget.d.ts +133 -0
  838. package/dist/providers/native/capacity-budget.js +265 -0
  839. package/dist/providers/native/device-capacity-ledger.d.ts +31 -0
  840. package/dist/providers/native/device-capacity-ledger.js +196 -0
  841. package/dist/providers/native/device-capacity.d.ts +84 -0
  842. package/dist/providers/native/device-capacity.js +431 -0
  843. package/dist/providers/native/engine-api-key.d.ts +57 -0
  844. package/dist/providers/native/engine-api-key.js +72 -0
  845. package/dist/providers/native/engine-key.d.ts +18 -0
  846. package/dist/providers/native/engine-key.js +41 -0
  847. package/dist/providers/native/engine-router.d.ts +145 -0
  848. package/dist/providers/native/engine-router.js +191 -0
  849. package/dist/providers/native/gpu-panic-guard.d.ts +54 -0
  850. package/dist/providers/native/gpu-panic-guard.js +59 -0
  851. package/dist/providers/native/inference.d.ts +33 -0
  852. package/dist/providers/native/inference.js +49 -0
  853. package/dist/providers/native/local-engine-runtime.d.ts +412 -0
  854. package/dist/providers/native/local-engine-runtime.js +1714 -0
  855. package/dist/providers/native/measured-budget.d.ts +32 -0
  856. package/dist/providers/native/measured-budget.js +54 -0
  857. package/dist/providers/native/port.d.ts +11 -0
  858. package/dist/providers/native/port.js +29 -0
  859. package/dist/providers/native/provider-pool.d.ts +474 -0
  860. package/dist/providers/native/provider-pool.js +1166 -0
  861. package/dist/providers/native/supervisor.d.ts +503 -0
  862. package/dist/providers/native/supervisor.js +1466 -0
  863. package/dist/providers/observation-context.d.ts +16 -0
  864. package/dist/providers/observation-context.js +1 -0
  865. package/dist/providers/openai-compatible/sse.d.ts +1 -0
  866. package/dist/providers/openai-compatible/sse.js +2 -0
  867. package/dist/providers/patient-fetch.d.ts +36 -0
  868. package/dist/providers/patient-fetch.js +44 -0
  869. package/dist/providers/project-macro-loop-bail.d.ts +7 -0
  870. package/dist/providers/project-macro-loop-bail.js +21 -0
  871. package/dist/providers/prose-document-salvage.d.ts +1 -0
  872. package/dist/providers/prose-document-salvage.js +2 -0
  873. package/dist/providers/provider-disposal.d.ts +1 -0
  874. package/dist/providers/provider-disposal.js +2 -0
  875. package/dist/providers/queue.d.ts +15 -0
  876. package/dist/providers/queue.js +23 -0
  877. package/dist/providers/ramble-abort-message.d.ts +1 -0
  878. package/dist/providers/ramble-abort-message.js +2 -0
  879. package/dist/providers/ramble-detector.d.ts +1 -0
  880. package/dist/providers/ramble-detector.js +2 -0
  881. package/dist/providers/reasoning-depth.d.ts +1 -0
  882. package/dist/providers/reasoning-depth.js +2 -0
  883. package/dist/providers/required-input-reads.d.ts +1 -0
  884. package/dist/providers/required-input-reads.js +2 -0
  885. package/dist/providers/session-defaults.d.ts +13 -0
  886. package/dist/providers/session-defaults.js +49 -0
  887. package/dist/providers/session-hooks.d.ts +26 -0
  888. package/dist/providers/session-hooks.js +1 -0
  889. package/dist/providers/streaming-session.d.ts +1 -0
  890. package/dist/providers/streaming-session.js +2 -0
  891. package/dist/providers/terminal-tool-policy.d.ts +1 -0
  892. package/dist/providers/terminal-tool-policy.js +2 -0
  893. package/dist/providers/tool-arg-schema-coercion.d.ts +1 -0
  894. package/dist/providers/tool-arg-schema-coercion.js +2 -0
  895. package/dist/providers/tool-executor.d.ts +12 -0
  896. package/dist/providers/tool-executor.js +20 -0
  897. package/dist/providers/tool-failure-tracker.d.ts +1 -0
  898. package/dist/providers/tool-failure-tracker.js +2 -0
  899. package/dist/providers/tool-repeat-tracker.d.ts +1 -0
  900. package/dist/providers/tool-repeat-tracker.js +2 -0
  901. package/dist/providers/turn-timeout.d.ts +1 -0
  902. package/dist/providers/turn-timeout.js +1 -0
  903. package/dist/providers/types.d.ts +834 -0
  904. package/dist/providers/types.js +42 -0
  905. package/dist/providers/usage-builder.d.ts +1 -0
  906. package/dist/providers/usage-builder.js +2 -0
  907. package/dist/providers/vision-capability.d.ts +109 -0
  908. package/dist/providers/vision-capability.js +137 -0
  909. package/dist/python/mlx-runtime-status-bus.d.ts +39 -0
  910. package/dist/python/mlx-runtime-status-bus.js +27 -0
  911. package/dist/python/uv-runtime.d.ts +176 -0
  912. package/dist/python/uv-runtime.js +492 -0
  913. package/dist/relevance/install.d.ts +28 -0
  914. package/dist/relevance/install.js +114 -0
  915. package/dist/relevance/manager.d.ts +79 -0
  916. package/dist/relevance/manager.js +211 -0
  917. package/dist/relevance/registry.d.ts +11 -0
  918. package/dist/relevance/registry.js +158 -0
  919. package/dist/relevance/relevance-core.d.ts +67 -0
  920. package/dist/relevance/relevance-core.js +189 -0
  921. package/dist/relevance/relevance-model.d.ts +42 -0
  922. package/dist/relevance/relevance-model.js +292 -0
  923. package/dist/relevance/relevance-worker.d.ts +20 -0
  924. package/dist/relevance/relevance-worker.js +57 -0
  925. package/dist/relevance/settings.d.ts +30 -0
  926. package/dist/relevance/settings.js +81 -0
  927. package/dist/remotes/identity.d.ts +121 -0
  928. package/dist/remotes/identity.js +348 -0
  929. package/dist/remotes/pinned-fetch.d.ts +45 -0
  930. package/dist/remotes/pinned-fetch.js +193 -0
  931. package/dist/remotes/types.d.ts +54 -0
  932. package/dist/remotes/types.js +1 -0
  933. package/dist/runtime-lock.d.ts +29 -0
  934. package/dist/runtime-lock.js +85 -0
  935. package/dist/search/relevance-stage.d.ts +81 -0
  936. package/dist/search/relevance-stage.js +177 -0
  937. package/dist/secrets/types.d.ts +63 -0
  938. package/dist/secrets/types.js +64 -0
  939. package/dist/speech.d.ts +1 -0
  940. package/dist/speech.js +1 -0
  941. package/dist/system/darwin-memory.d.ts +26 -0
  942. package/dist/system/darwin-memory.js +81 -0
  943. package/dist/system/gezel-process-memory.d.ts +55 -0
  944. package/dist/system/gezel-process-memory.js +156 -0
  945. package/dist/system/memory.d.ts +154 -0
  946. package/dist/system/memory.js +501 -0
  947. package/dist/transformers-cache.d.ts +112 -0
  948. package/dist/transformers-cache.js +392 -0
  949. package/dist/utils/disk-space.d.ts +55 -0
  950. package/dist/utils/disk-space.js +72 -0
  951. package/dist/utils/download-common.d.ts +138 -0
  952. package/dist/utils/download-common.js +196 -0
  953. package/dist/utils/download-with-retry.d.ts +85 -0
  954. package/dist/utils/download-with-retry.js +522 -0
  955. package/dist/utils/extract-zip.d.ts +22 -0
  956. package/dist/utils/extract-zip.js +103 -0
  957. package/dist/utils/retire-model-worker.d.ts +15 -0
  958. package/dist/utils/retire-model-worker.js +24 -0
  959. package/dist/utils/service-worker-entry.d.ts +59 -0
  960. package/dist/utils/service-worker-entry.js +69 -0
  961. package/dist/utils/xet-download.d.ts +40 -0
  962. package/dist/utils/xet-download.js +526 -0
  963. package/dist/utils/xet.d.ts +86 -0
  964. package/dist/utils/xet.js +201 -0
  965. package/package.json +103 -3
  966. package/scripts/embedding-packaging.cjs +264 -0
  967. package/scripts/embedding-packaging.d.cts +16 -0
@@ -0,0 +1,862 @@
1
+ /**
2
+ * LlamaCppProvider — talks to a local `llama-server` binary over HTTP.
3
+ * The server speaks OpenAI-compatible `/v1/chat/completions` with SSE
4
+ * streaming and standard tool-calling when launched with `--jinja`.
5
+ *
6
+ * Session model is stateless (like Ollama): we keep the full transcript
7
+ * in memory and resend it each turn. `ProviderSessionState` is empty —
8
+ * the session record on disk is the source of truth.
9
+ *
10
+ * Lifecycle of the llama-server process itself is managed by a
11
+ * {@link NativeEngineSupervisor}: lazy-start on first turn, idle-stop,
12
+ * health-watch, restart budget. The provider asks `ensureRunning()`
13
+ * before each turn and `markUsed()` afterwards. A dev / LAN mode
14
+ * without a supervisor (just a `baseUrl`) is also supported for when
15
+ * the user runs their own llama-server.
16
+ *
17
+ * Each provider INSTANCE serves a single model (one llama-server
18
+ * process); multi-model is handled a layer up by the engine pool
19
+ * (`providers/native/provider-pool.ts`), which keys instances by
20
+ * `{provider, modelId, replicaIdx}` and spools/evicts them under a
21
+ * memory budget. An evicted instance is `disposed` — it must never
22
+ * lazily respawn its process (see {@link shutdown}).
23
+ */
24
+ import * as os from 'node:os';
25
+ import { createLogger } from '@bendyline/gezel';
26
+ import { DEFAULT_NUM_CTX, LlamaCppSession, NativeEngineCrashedError, TOOL_GRAMMAR_FALLBACK_ORDER, constrainedToolNoSignalMsForModel, engineRequestAbortError, parseEnvMs, } from '@bendyline/gezel/local-loop';
27
+ import { ProviderDisposedError } from '../provider-disposal.js';
28
+ import { ProviderQueue, QUEUE_WAIT_NOTICE_DELAY_MS, QUEUE_WAIT_NOTICE_REPEAT_MS, backgroundLaneCap, defaultAmbientQuietMs, } from '../queue.js';
29
+ import { createToolExecutor } from '../tool-executor.js';
30
+ import { classifyStartupLine } from './stdout-parser.js';
31
+ // The session and its helpers live in core so a phone runs the same loop.
32
+ export * from '@bendyline/gezel/local-loop';
33
+ export { isFileRepairTurn as isScenarioFileRepairTurn } from '@bendyline/gezel/local-loop';
34
+ const log = createLogger('llama-cpp');
35
+ export class LlamaCppProvider {
36
+ name = 'llama-cpp';
37
+ queue;
38
+ supportsExternalTools = true;
39
+ supportsPriorMessages = true;
40
+ /**
41
+ * What this engine build's aggregate tool-grammar converter has already
42
+ * proven it cannot take, remembered across sessions.
43
+ *
44
+ * The rejection is deterministic — a fixed build applied to a tool
45
+ * payload of a given size either compiles or doesn't — but the recovery
46
+ * ladder in `runSend` used to start from `'none'` on every turn, so a
47
+ * roster that fails re-paid two rejected round-trips *per turn*, forever.
48
+ * On one install that was 16 rejections in a single afternoon, every one
49
+ * of them re-deriving the same answer.
50
+ *
51
+ * Keyed on tool count rather than remembered flat, because the limit the
52
+ * failures actually hit is grammar SIZE ("number of repetitions exceeds
53
+ * sane defaults"): a 48-tool roster blowing up says nothing about a
54
+ * 5-tool one, and degrading the small roster's schemas would cost real
55
+ * tool-argument fidelity for no reason. A request at or above the
56
+ * smallest count known to fail starts at the tier that recovered it.
57
+ */
58
+ toolGrammarFloor = null;
59
+ supervisor;
60
+ /** Explicit base URL when no supervisor is managing the process. */
61
+ externalBaseUrl;
62
+ defaultModel;
63
+ /**
64
+ * Catalog model id for the on-disk weights llama-server is serving —
65
+ * `qwen3.5-9b-llama-cpp`, `gemma4-e4b-llama-cpp`, etc. Distinct from
66
+ * `defaultModel`, which holds the placeholder string llama-server
67
+ * accepts in the `model` request field (the engine ignores it when
68
+ * only one model is loaded). Surfaced via {@link getEffectiveModelId}
69
+ * so the chat manager can resolve a tier for sessions that don't
70
+ * have an explicit model selection (`record.model` undefined AND
71
+ * `config.defaultModel.llama-cpp` undefined). Without this, those
72
+ * sessions classify as `tier:tiny` because the tier resolver has
73
+ * nothing to parse — and the debug bundle can't print the model
74
+ * name either, so an engineer reading it sees `tier: tiny` against
75
+ * a 9B Qwen and is left guessing what model is actually loaded.
76
+ *
77
+ * Empty when the provider was constructed in external-baseUrl mode
78
+ * (we don't know what the user's llama-server is serving) or before
79
+ * the catalog has resolved a default model. Mirrors the same field
80
+ * on `MlxProvider`.
81
+ */
82
+ catalogModelId;
83
+ /**
84
+ * Catalog manager — when set, `listModels()` enumerates every model
85
+ * the user has installed (so `/v1/models` + Settings pickers see the
86
+ * full set the engine pool can serve), not just the resident one.
87
+ * Optional because external-baseUrl mode has no local catalog.
88
+ * Mirrors the same field on `MlxProvider`.
89
+ */
90
+ modelManager;
91
+ /** Owner key of our `'llm'` evictor registration; see constructor opts. */
92
+ evictorOwnerId;
93
+ /**
94
+ * Set once {@link shutdown} runs. A disposed provider must never
95
+ * lazily respawn its llama-server: the engine pool evicts replicas
96
+ * by calling `shutdown()`, and any session still holding the old
97
+ * instance would otherwise resurrect the process via
98
+ * `ensureRunning()` — a zombie engine outside the pool's capacity
99
+ * accounting.
100
+ */
101
+ disposed = false;
102
+ numCtx;
103
+ plannedReservation;
104
+ plannedGpu;
105
+ /**
106
+ * When true, append `stream_options:{include_usage:true}` to chat requests so
107
+ * the engine emits a final usage chunk. Off for llama-server (it surfaces its
108
+ * own custom timings/usage the session already parses); ds4-server emits
109
+ * usage ONLY when asked, so {@link buildDs4Provider} opts in — without this,
110
+ * ds4 turns record zero tokens and tok/s telemetry is null.
111
+ */
112
+ includeUsageInStream;
113
+ /**
114
+ * When true, assistant turns committed to the session transcript carry
115
+ * their verbatim SSE `reasoning_content` so later requests replay it.
116
+ * Off for llama-server (its templates drop reasoning on re-render, and
117
+ * echoing it back would *change* the rendered prompt on templates that
118
+ * honor the field). On for ds4-server, whose DeepSeek-V4 render replays
119
+ * `<think>{reasoning_content}</think>` for every assistant turn in tool
120
+ * context and keeps exact per-call DSML by tool-call id: with the
121
+ * reasoning echoed, the re-rendered history is byte-identical to what
122
+ * was generated, the engine's live-KV prefix match survives each tool
123
+ * iteration, and a continuation prefills only the new tool results.
124
+ * Without it, every iteration logs `live kv cache miss … reason=
125
+ * token-mismatch`, falls back to the system-prefix disk snapshot, and
126
+ * re-prefills the whole conversation tail (minutes per turn at DS4's
127
+ * SSD-streamed prefill speeds).
128
+ */
129
+ replayReasoningContent;
130
+ /**
131
+ * Whether this engine was launched with `--mmproj`, i.e. whether the server
132
+ * can actually decode an image. Gates the typed-content message shape:
133
+ * sending image parts to a text-only server just inflates the prompt with
134
+ * base64 the model can't interpret.
135
+ *
136
+ * Sourced from the installed model's projector path plus the user's
137
+ * per-model opt-in, resolved in `buildLlamaCppProvider`.
138
+ */
139
+ visionEnabled;
140
+ /** Read by the machine engine's `/v1/remote/infer`, which refuses image history otherwise. */
141
+ get supportsImageInput() {
142
+ return this.visionEnabled;
143
+ }
144
+ disableThinkingRequestShape;
145
+ /** Request-scoped effort shape for compatible wrappers such as ds4-server. */
146
+ reasoningEffortRequestShape;
147
+ /** Engine batch width; see the `batchMaxConcurrency` constructor opt. */
148
+ batchMaxConcurrency;
149
+ /**
150
+ * Number of real llama-server request slots (`--parallel`). The provider
151
+ * queue can intentionally be wider than this by one reserved background
152
+ * lane so an in-turn one-shot can dispatch without deadlocking behind the
153
+ * foreground turn that awaits it. This gate is the separate physical
154
+ * boundary: cache slot save/restore plus the streamed engine request must
155
+ * never exceed the slots the native server actually owns.
156
+ */
157
+ engineRequestWidth;
158
+ engineRequestsActive = 0;
159
+ engineRequestWaiters = [];
160
+ /**
161
+ * Mid-stream silence cap (ms). After this many ms with no SSE chunk,
162
+ * the in-flight `/v1/chat/completions` request is aborted with an
163
+ * idle-stall error so the runtime publishes `done`, the engine pill
164
+ * clears, and the user can retry. Without this cap a hung llama-cpp
165
+ * turn (model stalled, llama-server thread wedged, GPU eviction mid-
166
+ * generation) would hold the runtime's `await sendAndWait` forever.
167
+ * Mirrors Ollama's same-named knob (default 5 min); see Ollama's
168
+ * `streamingIdleMs` for the design notes.
169
+ */
170
+ streamingIdleMs;
171
+ /**
172
+ * Pre-first-byte cap (ms). Covers cold model load, prompt prefill,
173
+ * and the first-token wait. Separate from `streamingIdleMs` so a
174
+ * legitimately slow first-chunk on a 30B-class model doesn't trip
175
+ * the streaming-idle watchdog set for active-generation silence.
176
+ */
177
+ preFirstByteIdleMs;
178
+ /**
179
+ * Tight post-reasoning silent-stall cap (ms). Armed when the engine
180
+ * signals it finished thinking; fires if no SSE delta arrives within
181
+ * the window AND a `/slots` liveness probe shows the KV cache is not
182
+ * growing. Default 30s; overridable for tests. See the watchdog in
183
+ * `sendAndWaitInner`.
184
+ */
185
+ postReasoningWatchdogMs;
186
+ /**
187
+ * Constrained mutation turns should produce a tool signal quickly after
188
+ * the model has already inspected inputs. DS4 can otherwise burn the full
189
+ * turn in hidden/tool thinking with no SSE signal; this timer converts that
190
+ * into the existing no-mutation corrective retry.
191
+ */
192
+ constrainedToolNoSignalMs;
193
+ fetchImpl;
194
+ logFile;
195
+ /**
196
+ * Cross-engine GPU coordinator. When set (and we're running a
197
+ * supervised local llama-server, not an external base URL),
198
+ * `resolveBaseUrl` acquires the `'llm'` slot before each request,
199
+ * which evicts the image engine in `swap` mode. The provider also
200
+ * registers its supervisor's `stop()` as the `'llm'` evictor so
201
+ * image-gen requests can swap us out symmetrically.
202
+ */
203
+ arbiter;
204
+ /**
205
+ * Sessions currently inside `sendAndWaitInner` — used to fan-out
206
+ * supervisor-side phase events (model load progress parsed from
207
+ * llama-server stdout) to every caller waiting on the same engine
208
+ * startup. Sessions add themselves on turn entry and remove in the
209
+ * finally block. Empty when the engine is idle.
210
+ */
211
+ activeSessions = new Set();
212
+ /**
213
+ * Last phase observed from the stdout classifier, kept so newly-
214
+ * starting sessions can pick up the current state instead of waiting
215
+ * for the next log line. Cleared on `ready`.
216
+ */
217
+ lastStartupPhase = null;
218
+ /**
219
+ * Running total of bytes allocated across every `load_tensors:` /
220
+ * `llama_kv_cache_init:` line the stdout classifier has seen since
221
+ * the current engine start. Reset on `ready` so a later restart's
222
+ * allocation doesn't double-count. Published once per engine start
223
+ * as an `engine_stats` event fanning out to active sessions.
224
+ */
225
+ accumulatedRamBytes = 0;
226
+ /**
227
+ * Most recent ram total published — used so new sessions joining
228
+ * mid-lifecycle get the figure replayed (same pattern as
229
+ * `lastStartupPhase`).
230
+ */
231
+ lastEngineStats = null;
232
+ /**
233
+ * Stdout line → phase classifier used by {@link onStdoutLine}.
234
+ * Defaults to the llama-server classifier; engine wrappers that
235
+ * reuse this turn loop against a different binary (ds4-server via
236
+ * {@link Ds4Provider}) inject their own so phase events reflect
237
+ * that engine's actual log wording instead of silently matching
238
+ * nothing.
239
+ */
240
+ classifyLine;
241
+ constructor(opts) {
242
+ if (!opts.supervisor && !opts.baseUrl) {
243
+ throw new Error('[llama-cpp] need either a supervisor or baseUrl');
244
+ }
245
+ if (opts.supervisor && opts.baseUrl) {
246
+ throw new Error('[llama-cpp] supervisor and baseUrl are mutually exclusive');
247
+ }
248
+ if (opts.supervisor)
249
+ this.supervisor = opts.supervisor;
250
+ if (opts.baseUrl)
251
+ this.externalBaseUrl = opts.baseUrl.replace(/\/+$/, '');
252
+ // Only register an evictor when we own the lifecycle. External-baseUrl
253
+ // mode targets a llama-server the user runs themselves; we don't get
254
+ // to stop their process.
255
+ if (opts.arbiter && opts.supervisor) {
256
+ this.arbiter = opts.arbiter;
257
+ if (opts.evictorOwnerId)
258
+ this.evictorOwnerId = opts.evictorOwnerId;
259
+ this.arbiter.registerEvictor('llm', () => opts.supervisor.stop(), opts.evictorOwnerId ?? 'default');
260
+ }
261
+ // llama-server ignores the `model` field when only one model is
262
+ // loaded; use a short placeholder that still shows up sensibly in
263
+ // usage logs. Real per-install default comes from config.
264
+ this.defaultModel = opts.defaultModel ?? 'llama-cpp';
265
+ if (opts.catalogModelId)
266
+ this.catalogModelId = opts.catalogModelId;
267
+ if (opts.modelManager)
268
+ this.modelManager = opts.modelManager;
269
+ this.numCtx = opts.numCtx ?? DEFAULT_NUM_CTX;
270
+ this.plannedReservation = opts.plannedReservationBytes;
271
+ this.plannedGpu = opts.plannedGpuBytes;
272
+ this.includeUsageInStream = opts.includeUsageInStream ?? false;
273
+ this.replayReasoningContent = opts.replayReasoningContent ?? false;
274
+ this.visionEnabled = opts.visionEnabled ?? false;
275
+ this.disableThinkingRequestShape = opts.disableThinkingRequestShape ?? 'chat-template';
276
+ this.reasoningEffortRequestShape = opts.reasoningEffortRequestShape ?? 'none';
277
+ this.classifyLine = opts.classifyLine ?? classifyStartupLine;
278
+ // 5-minute defaults match Ollama. Generous enough to cover a 30B
279
+ // model's cold load + prefill on a single-GPU consumer box, tight
280
+ // enough that a wedged stream doesn't strand the runtime and the
281
+ // user retries within a coffee break. The `GEZEL_LLAMA_CPP_STREAMING_IDLE_MS`
282
+ // env var lets the eval harness (which has its own retry-loop watchdog
283
+ // that fires at ~3 min of sniff-plateau) tighten this without changing
284
+ // the production default — wild-caught squisq-review:
285
+ // qwen3.6 stream went silent mid-generation, harness retry-loop killed
286
+ // the trial 2m 45s later, well before the 5-min provider watchdog had
287
+ // a chance to abort and salvage the buffered content.
288
+ const envIdleMs = parseEnvMs(process.env.GEZEL_LLAMA_CPP_STREAMING_IDLE_MS);
289
+ this.streamingIdleMs = opts.streamingIdleMs ?? envIdleMs ?? 300_000;
290
+ // Pre-first-byte budget covers KV-cold prefill + engine warm-up.
291
+ // Hardware tiering empirically calibrated against the qwen3.5-9b
292
+ // matrix runs:
293
+ // - default 600s — adequate for x64 + non-Apple ARM and for warm
294
+ // Apple Silicon with the prompt cache hit.
295
+ // - 1500s on darwin-arm64 with ≤16 GB unified memory — cold-prefill
296
+ // of a 9B Q4 model with a ~16K-token system prompt on M2 Air
297
+ // blew through 600s AND 900s on every fresh gezel session in
298
+ // the matrix. Same machine, same Q4 9B, cold KV,
299
+ // 16K prefill → measured ~12-15 min. 1500s gives a 5-min
300
+ // headroom over the observed cliff without masking genuine
301
+ // hangs (the streaming-idle watchdog still catches mid-turn
302
+ // stalls at 300s).
303
+ // `GEZEL_LLAMA_CPP_PRE_FIRST_BYTE_IDLE_MS` overrides both for ops
304
+ // who need to tune further (e.g. 30B-class models on weaker hosts).
305
+ const envPreFirstByteMs = parseEnvMs(process.env.GEZEL_LLAMA_CPP_PRE_FIRST_BYTE_IDLE_MS);
306
+ const lowRamAppleSilicon = process.platform === 'darwin' &&
307
+ process.arch === 'arm64' &&
308
+ os.totalmem() <= 17 * 1024 * 1024 * 1024;
309
+ const platformDefaultPreFirstByteMs = lowRamAppleSilicon ? 1_500_000 : 600_000;
310
+ this.preFirstByteIdleMs =
311
+ opts.preFirstByteIdleMs ?? envPreFirstByteMs ?? platformDefaultPreFirstByteMs;
312
+ this.postReasoningWatchdogMs = opts.postReasoningWatchdogMs ?? 30_000;
313
+ const envConstrainedNoSignalMs = parseEnvMs(process.env.GEZEL_LLAMA_CPP_CONSTRAINED_TOOL_NO_SIGNAL_MS);
314
+ this.constrainedToolNoSignalMs =
315
+ opts.constrainedToolNoSignalMs ??
316
+ envConstrainedNoSignalMs ??
317
+ constrainedToolNoSignalMsForModel(opts.catalogModelId ?? opts.defaultModel);
318
+ this.fetchImpl = opts.fetchImpl ?? fetch;
319
+ if (opts.logFile)
320
+ this.logFile = opts.logFile;
321
+ if (opts.slotSavePath)
322
+ this.slotSavePath = opts.slotSavePath;
323
+ const slots = opts.concurrency ?? 2;
324
+ this.launchedSlots = slots;
325
+ this.engineRequestWidth = slots;
326
+ // A supervised engine's `concurrency` is the exact `--parallel` launch
327
+ // width, so it is also the safe interactive batch width. Keep external
328
+ // base-URL mode conservative: we may be configured with several client
329
+ // queue sockets without knowing how many native slots that server owns.
330
+ const batchMax = Math.max(1, opts.batchMaxConcurrency ?? (opts.supervisor ? slots : 1));
331
+ this.batchMaxConcurrency = batchMax;
332
+ // Slots are one fungible pool: chats may fill all of them. Background work
333
+ // is the only capped lane (`backgroundLaneCap` = width - 1), so a live turn
334
+ // can always start. Reserve at least ONE queue slot above the interactive
335
+ // cap for the background lane so a mid-turn one-shot pinned to this provider
336
+ // (compaction / memory extraction / summarization) can't deadlock behind a
337
+ // full interactive lane — without it, a lone slot plus a synchronous
338
+ // mid-turn compaction wedges the turn, the same failure the MLX
339
+ // single-slot path hit. See the matching note in the MLX provider.
340
+ const interactiveConcurrency = batchMax;
341
+ const queueConcurrency = opts.reserveBackgroundSlot === false ? slots : Math.max(slots, interactiveConcurrency + 1);
342
+ this.queue = new ProviderQueue({
343
+ // llama-server is launched with `--parallel ${slots}` (see
344
+ // `buildLlamaCppProvider` in chat/manager.ts) so the engine has matching
345
+ // KV slots. The queue may have one extra logical background lane, while
346
+ // `acquireExclusiveEngineRequest` caps actual cache+generation work at
347
+ // `slots`. A background chore the foreground awaits can therefore enter
348
+ // this queue and claim the physical slot between tool-loop round-trips,
349
+ // without two sessions ever pinning the same native slot concurrently.
350
+ concurrency: queueConcurrency,
351
+ interactiveConcurrency,
352
+ // Keyed to `slots` — the width `acquireExclusiveEngineRequest`
353
+ // enforces — not to the queue's deadlock reserve. This is a no-op
354
+ // for the serial and ds4 paths, where the old expression already
355
+ // came out to `slots - 1`; it only widens the batched path, which
356
+ // was pinned at 1. See `backgroundLaneCap`.
357
+ backgroundConcurrency: backgroundLaneCap(slots),
358
+ ...(opts.affinity !== undefined ? { affinity: opts.affinity } : {}),
359
+ // A single local GPU: hold ambient housekeeping (nudges,
360
+ // extraction, icon/about) while the user is actively engaged, so
361
+ // a multi-minute chore turn never lands right before their next
362
+ // move. Applies to ds4 too — its provider wraps this class.
363
+ ambientQuietMs: defaultAmbientQuietMs(),
364
+ });
365
+ }
366
+ /**
367
+ * Record that a tool payload of `toolCount` was rejected by the engine's
368
+ * grammar converter and needed `tier` to get through. See
369
+ * {@link toolGrammarFloor}.
370
+ *
371
+ * Both fields widen monotonically: the smallest failing count (so the
372
+ * floor covers every payload at least that large) and the most permissive
373
+ * tier we have had to reach (so a later turn never starts below a rung
374
+ * already known to be insufficient).
375
+ */
376
+ noteToolGrammarFloor(toolCount, tier) {
377
+ if (tier === 'none' || toolCount <= 0)
378
+ return;
379
+ const prev = this.toolGrammarFloor;
380
+ const prevRank = prev ? TOOL_GRAMMAR_FALLBACK_ORDER.indexOf(prev.tier) : -1;
381
+ this.toolGrammarFloor = {
382
+ minToolCount: Math.min(prev?.minToolCount ?? toolCount, toolCount),
383
+ tier: TOOL_GRAMMAR_FALLBACK_ORDER.indexOf(tier) > prevRank ? tier : (prev?.tier ?? tier),
384
+ };
385
+ }
386
+ /** Tier a request carrying `toolCount` tools should START at. */
387
+ toolGrammarFloorFor(toolCount) {
388
+ const floor = this.toolGrammarFloor;
389
+ return floor && toolCount >= floor.minToolCount ? floor.tier : 'none';
390
+ }
391
+ /**
392
+ * Set once the engine has rejected a forced tool call for this model, so
393
+ * every later constrained turn — in this session and every sibling on the
394
+ * same engine — advertises tools without `tool_choice: "required"` rather
395
+ * than replaying a rejection the payload cannot fix.
396
+ *
397
+ * Engine-scoped and monotonic for the same reason as
398
+ * {@link toolGrammarFloor}: the incompatibility is a property of the model
399
+ * plus the server build, not of one turn's tools, so re-probing per turn
400
+ * would burn a request each time a rescue fires — and rescues fire exactly
401
+ * when the turn is already in trouble.
402
+ */
403
+ forcedToolChoiceUnsupported = false;
404
+ /** Record that this engine rejected `tool_choice: "required"`. */
405
+ noteForcedToolChoiceUnsupported() {
406
+ this.forcedToolChoiceUnsupported = true;
407
+ }
408
+ /** Whether a constrained turn may ask the engine to force a tool call. */
409
+ get supportsForcedToolChoice() {
410
+ return !this.forcedToolChoiceUnsupported;
411
+ }
412
+ /**
413
+ * Batch capability — llama-server serves `--parallel N` concurrent KV
414
+ * slots, so when batched inference is enabled `maxConcurrency` is that
415
+ * slot count; otherwise 1 (we don't opt into co-batching). See
416
+ * {@link LLMProvider.batch}.
417
+ */
418
+ get batch() {
419
+ return { maxConcurrency: this.batchMaxConcurrency };
420
+ }
421
+ /**
422
+ * Cache adapter (Phase 1+) — set by ChatManager after construction
423
+ * and read by sessions on every send to derive `cache_prompt` +
424
+ * `id_slot` extras. Null when no controller is wired (cloud-only
425
+ * install, tests).
426
+ */
427
+ cacheAdapter = null;
428
+ slotSavePath;
429
+ launchedSlots;
430
+ setCacheAdapter(adapter) {
431
+ this.cacheAdapter = adapter;
432
+ }
433
+ getCacheAdapter() {
434
+ return this.cacheAdapter;
435
+ }
436
+ /**
437
+ * Directory passed to llama-server's `--slot-save-path` on launch.
438
+ * The cache adapter reads this to wire slot save/restore I/O.
439
+ * Undefined on external-baseUrl mode (we don't control the launch).
440
+ */
441
+ getSlotSavePath() {
442
+ return this.slotSavePath;
443
+ }
444
+ /**
445
+ * The `--parallel` slot count this provider was constructed for — the
446
+ * ENGINE's slot space, which is what the cache adapter must size its
447
+ * slot model to. Deliberately NOT `queue.concurrency`: the queue
448
+ * reserves a background lane ABOVE the engine slots
449
+ * (`max(slots, interactive+1)`), so on a single-slot launch the queue
450
+ * reads 2 — and an adapter sized off it binds sessions to slot ids the
451
+ * server doesn't have. Wild-caught 2026-08-03: the adapter "bound"
452
+ * slot 1 on a `--parallel 1` server; every save/restore against it
453
+ * would 400 silently, and the debug probe's slot narration was fiction.
454
+ */
455
+ getLaunchedSlots() {
456
+ return this.launchedSlots;
457
+ }
458
+ /**
459
+ * Claim one physical llama-server request slot.
460
+ *
461
+ * This is deliberately narrower than {@link queue}: a logical turn holds its
462
+ * ProviderQueue lease across the whole tool loop, while this lease covers one
463
+ * cache-prepare + `/v1/chat/completions` round-trip. On a one-slot launch that
464
+ * lets a synchronous background one-shot run between foreground iterations,
465
+ * but prevents the wild-caught failure where a recovery nudge saved/restored
466
+ * slot 0 while another session was still generating on slot 0, leaving the
467
+ * native prompt processor stuck forever.
468
+ */
469
+ async acquireExclusiveEngineRequest(label, signal, onWait) {
470
+ if (signal?.aborted)
471
+ throw engineRequestAbortError(label);
472
+ if (this.supervisor?.coordinatesCapacity)
473
+ await this.supervisor.yieldForWaitingCapacity(signal);
474
+ const waitStartedAt = Date.now();
475
+ if (this.engineRequestsActive < this.engineRequestWidth) {
476
+ this.engineRequestsActive++;
477
+ }
478
+ else {
479
+ let waitNotice = null;
480
+ let waitNoticeDelay = null;
481
+ try {
482
+ await new Promise((resolve, reject) => {
483
+ const waiter = {
484
+ resolve,
485
+ reject,
486
+ ...(signal ? { signal } : {}),
487
+ };
488
+ if (signal) {
489
+ waiter.onAbort = () => {
490
+ const idx = this.engineRequestWaiters.indexOf(waiter);
491
+ if (idx === -1)
492
+ return;
493
+ this.engineRequestWaiters.splice(idx, 1);
494
+ signal.removeEventListener('abort', waiter.onAbort);
495
+ reject(engineRequestAbortError(label));
496
+ };
497
+ signal.addEventListener('abort', waiter.onAbort, { once: true });
498
+ }
499
+ this.engineRequestWaiters.push(waiter);
500
+ // This wait was invisible to everything above it. A logical turn
501
+ // holds its ProviderQueue lease across the whole tool loop, so a
502
+ // turn that already cleared that queue can still park HERE for the
503
+ // full length of another session's round-trip — on a one-slot
504
+ // launch, minutes — emitting nothing but a debug line. The user
505
+ // saw a turn with no queue badge and no tokens, which the silence
506
+ // banner then reported as a wedged model.
507
+ if (onWait) {
508
+ const publish = () => {
509
+ const idx = this.engineRequestWaiters.indexOf(waiter);
510
+ if (idx === -1)
511
+ return;
512
+ onWait({ aheadOf: this.engineRequestsActive + idx });
513
+ };
514
+ waitNoticeDelay = setTimeout(() => {
515
+ publish();
516
+ waitNotice = setInterval(publish, QUEUE_WAIT_NOTICE_REPEAT_MS);
517
+ waitNotice.unref?.();
518
+ }, QUEUE_WAIT_NOTICE_DELAY_MS);
519
+ waitNoticeDelay.unref?.();
520
+ }
521
+ });
522
+ }
523
+ finally {
524
+ if (waitNoticeDelay)
525
+ clearTimeout(waitNoticeDelay);
526
+ if (waitNotice)
527
+ clearInterval(waitNotice);
528
+ }
529
+ }
530
+ const waitedMs = Date.now() - waitStartedAt;
531
+ if (waitedMs > 1_000) {
532
+ log.debug(`[llama-cpp] engine request ${label} waited ${waitedMs}ms for a physical slot`);
533
+ }
534
+ let released = false;
535
+ return () => {
536
+ if (released)
537
+ return;
538
+ released = true;
539
+ const next = this.engineRequestWaiters.shift();
540
+ if (next) {
541
+ if (next.signal && next.onAbort) {
542
+ next.signal.removeEventListener('abort', next.onAbort);
543
+ }
544
+ // Hand the physical slot straight to the next waiter. The active count
545
+ // stays unchanged across the handoff, so it can never exceed width.
546
+ next.resolve();
547
+ }
548
+ else {
549
+ this.engineRequestsActive--;
550
+ }
551
+ };
552
+ }
553
+ /**
554
+ * Current base URL (when supervised) or the externally-configured
555
+ * one. `undefined` when the supervised engine hasn't started yet —
556
+ * the cache adapter treats that as "engine not ready, return empty
557
+ * usage."
558
+ */
559
+ currentBaseUrl() {
560
+ if (this.externalBaseUrl)
561
+ return this.externalBaseUrl;
562
+ return this.supervisor?.currentBaseUrl() ?? null;
563
+ }
564
+ /** True only while this native engine is serving or queuing a physical request. */
565
+ isEngineBusy() {
566
+ return this.engineRequestsActive > 0 || this.engineRequestWaiters.length > 0;
567
+ }
568
+ engineLifecycleSnapshot() {
569
+ return this.supervisor?.lifecycleSnapshot();
570
+ }
571
+ async initialize() {
572
+ // No client object to construct. The supervisor starts the child
573
+ // lazily on the first `sendAndWait` — keeping initialize() a
574
+ // no-op avoids spinning up the engine just because someone asked
575
+ // the provider to exist.
576
+ }
577
+ get isDisposed() {
578
+ return this.disposed;
579
+ }
580
+ async shutdown() {
581
+ // Poison FIRST so a turn racing the shutdown can't lazily respawn
582
+ // llama-server after the stop below (see `disposed` field doc).
583
+ this.disposed = true;
584
+ // Only pool replicas (explicit ownerId) unregister: a singleton's
585
+ // 'default' registration may have been replaced by a successor
586
+ // instance, and unregistering here would drop the successor's.
587
+ if (this.arbiter && this.supervisor && this.evictorOwnerId) {
588
+ this.arbiter.unregisterEvictor('llm', this.evictorOwnerId);
589
+ }
590
+ // Flush slot caches BEFORE stopping the supervisor — once
591
+ // llama-server exits the slot save endpoint is gone. flushAll is
592
+ // best-effort; failures during shutdown shouldn't block the stop.
593
+ if (this.cacheAdapter) {
594
+ try {
595
+ await this.cacheAdapter.flushAll();
596
+ }
597
+ catch {
598
+ // Best-effort persistence — failure here just means the next
599
+ // boot pays the prefill cost on resume, same as before.
600
+ }
601
+ }
602
+ await this.supervisor?.stop();
603
+ }
604
+ async createSession(opts) {
605
+ if (this.disposed) {
606
+ throw new ProviderDisposedError('llama-cpp');
607
+ }
608
+ const bridges = await createToolExecutor(opts, '[llama-cpp]');
609
+ return new LlamaCppSession({
610
+ resolveBaseUrl: () => this.resolveBaseUrl(),
611
+ acquireGpuLease: () => this.acquireGpuLease(),
612
+ markUsed: () => this.supervisor?.markUsed(),
613
+ ...(this.supervisor
614
+ ? {
615
+ waitForNativeEngineExit: async (sinceMs) => await this.supervisor?.waitForUnexpectedExitSince?.(sinceMs),
616
+ }
617
+ : {}),
618
+ fetchImpl: this.fetchImpl,
619
+ model: opts.model ?? this.defaultModel,
620
+ numCtx: this.numCtx,
621
+ includeUsageInStream: this.includeUsageInStream,
622
+ replayReasoningContent: this.replayReasoningContent,
623
+ visionEnabled: this.visionEnabled,
624
+ disableThinkingRequestShape: this.disableThinkingRequestShape,
625
+ reasoningEffortRequestShape: this.reasoningEffortRequestShape,
626
+ ...(opts.reasoningEffort ? { reasoningEffort: opts.reasoningEffort } : {}),
627
+ reasoningBudgetOverride: () => process.env.GEZEL_LLAMA_REASONING_BUDGET_TOKENS,
628
+ systemMessage: opts.systemMessage,
629
+ ...(opts.systemPromptLayers ? { systemPromptLayers: opts.systemPromptLayers } : {}),
630
+ ...(opts.volatileContext ? { volatileContext: opts.volatileContext } : {}),
631
+ // Pass widened priorMessages through — the session translates
632
+ // tool-role entries into ChatMessage tool_calls / role:'tool'
633
+ // entries at construction time.
634
+ priorMessages: opts.priorMessages ?? [],
635
+ bridges,
636
+ queue: this.queue,
637
+ provider: this,
638
+ streamingIdleMs: this.streamingIdleMs,
639
+ preFirstByteIdleMs: this.preFirstByteIdleMs,
640
+ postReasoningWatchdogMs: this.postReasoningWatchdogMs,
641
+ constrainedToolNoSignalMs: this.constrainedToolNoSignalMs,
642
+ ...(opts.externalTools && opts.externalTools.length > 0
643
+ ? { externalTools: opts.externalTools }
644
+ : {}),
645
+ ...(opts.requestCompaction ? { requestCompaction: opts.requestCompaction } : {}),
646
+ ...(opts.forceDirectFileWork ? { forceDirectFileWork: true } : {}),
647
+ ...(opts.directFileWorkTargetPath
648
+ ? { directFileWorkTargetPath: opts.directFileWorkTargetPath }
649
+ : {}),
650
+ ...(opts.profile ? { profile: opts.profile } : {}),
651
+ ...(opts.activeCraftbookStep ? { activeCraftbookStep: opts.activeCraftbookStep } : {}),
652
+ ...(opts.tuning ? { tuning: opts.tuning } : {}),
653
+ ...(opts.terminalToolPolicy ? { terminalToolPolicy: opts.terminalToolPolicy } : {}),
654
+ });
655
+ }
656
+ getContextWindow() {
657
+ return this.numCtx;
658
+ }
659
+ /**
660
+ * Live engine launch provenance (granted context, slots, KV dtype) from
661
+ * the supervisor — undefined in external base-URL mode or when no child
662
+ * process is up. See `LLMProvider.engineLaunchSnapshot`.
663
+ */
664
+ engineLaunchSnapshot() {
665
+ return this.supervisor?.launchSnapshot();
666
+ }
667
+ /**
668
+ * Weights + KV at the granted window/cache mode, from the launch
669
+ * admission pass. See `LLMProvider.plannedReservationBytes`.
670
+ */
671
+ plannedReservationBytes() {
672
+ return this.plannedReservation;
673
+ }
674
+ /** See `LLMProvider.plannedGpuBytes`. */
675
+ plannedGpuBytes() {
676
+ return this.plannedGpu;
677
+ }
678
+ /**
679
+ * Classifier hook the supervisor wires into its `onRawLine`. Runs
680
+ * on every stdout/stderr line from llama-server; when the line
681
+ * maps to a known startup phase, fans the descriptor out to every
682
+ * currently-waiting session so the UI surfaces "loading model 42%"
683
+ * instead of a silent spinner.
684
+ *
685
+ * Public so `buildLlamaCppProvider` can register it on the
686
+ * supervisor it constructs; not something external callers should
687
+ * invoke directly.
688
+ */
689
+ onStdoutLine(line) {
690
+ // Reasoning-budget transitions are out-of-band engine signals,
691
+ // not startup-phase events. When the engine reports the natural
692
+ // end of its reasoning budget, fan the signal to every active
693
+ // session so each can arm its post-reasoning silent-stall
694
+ // watchdog. Slot-id attribution isn't available on these lines
695
+ // (they're emitted before the next `slot ...` line carrying the
696
+ // id), so we fan out; sessions that ARE streaming content will
697
+ // cancel their watchdog on the next `delta.content` and the
698
+ // fan-out is harmless for them.
699
+ //
700
+ // Match the exact upstream wording — line shape has been stable
701
+ // across recent llama.cpp versions, and a loose regex risks
702
+ // false-positives on test logs or future format changes.
703
+ if (line.includes('reasoning-budget: deactivated (natural end)')) {
704
+ for (const s of this.activeSessions) {
705
+ try {
706
+ s.notifyReasoningEnded();
707
+ }
708
+ catch (err) {
709
+ log.warn(`[llama-cpp] notifyReasoningEnded threw: ${err instanceof Error ? err.message : String(err)}`);
710
+ }
711
+ }
712
+ }
713
+ const phase = this.classifyLine(line);
714
+ if (!phase)
715
+ return;
716
+ // Accumulate memory footprint from every buffer-allocation line
717
+ // the classifier identifies. Runs BEFORE the dedupe check below
718
+ // so two tensor-load lines with identical "size =" text still
719
+ // both count (different buffers usually have distinct sizes, but
720
+ // an edge case shouldn't silently discard memory).
721
+ if (phase.bufferBytes !== undefined && phase.bufferBytes > 0) {
722
+ this.accumulatedRamBytes += phase.bufferBytes;
723
+ }
724
+ // On `ready` — engine has finished loading. Publish the total
725
+ // RAM figure to every active session, remember it for late
726
+ // joiners, and reset the counter for the next engine lifecycle
727
+ // (idle-stop + restart = fresh allocation).
728
+ if (phase.phase === 'ready' && this.accumulatedRamBytes > 0) {
729
+ const stats = { ramAllocBytes: this.accumulatedRamBytes };
730
+ this.lastEngineStats = stats;
731
+ for (const s of this.activeSessions)
732
+ s.publishEngineStats(stats);
733
+ this.accumulatedRamBytes = 0;
734
+ }
735
+ // These logs have no request identity. Only attribute inference progress
736
+ // when one session owns the engine; concurrent sessions get their own
737
+ // stream's counters instead. Never replay one request's prefill to another.
738
+ if (phase.phase === 'prefill' || phase.phase === 'generating') {
739
+ this.lastStartupPhase = null;
740
+ if (this.activeSessions.size !== 1)
741
+ return;
742
+ }
743
+ // Suppress identical engine startup lines, retaining measured progress.
744
+ if (this.lastStartupPhase &&
745
+ this.lastStartupPhase.phase === phase.phase &&
746
+ this.lastStartupPhase.detail === phase.detail &&
747
+ this.lastStartupPhase.progress === phase.progress) {
748
+ return;
749
+ }
750
+ const phaseEvent = {
751
+ provider: 'llama-cpp',
752
+ phase: phase.phase,
753
+ ...(phase.detail ? { detail: phase.detail } : {}),
754
+ ...(typeof phase.progress === 'number' ? { progress: phase.progress } : {}),
755
+ ...(typeof phase.outputTokens === 'number' ? { outputTokens: phase.outputTokens } : {}),
756
+ ...(typeof phase.tokensPerSec === 'number' ? { tokensPerSec: phase.tokensPerSec } : {}),
757
+ };
758
+ this.lastStartupPhase =
759
+ phase.phase === 'starting' || phase.phase === 'loading_model' ? phaseEvent : null;
760
+ for (const s of this.activeSessions)
761
+ s.publishEnginePhase(phaseEvent);
762
+ }
763
+ /**
764
+ * Surface the rolling log-file handle so the service's HTTP layer
765
+ * can tail it for the Settings → On-device log viewer. Returns
766
+ * undefined when no supervised process is running (external
767
+ * baseUrl mode — there's no stdout for us to capture).
768
+ */
769
+ getLogFile() {
770
+ return this.logFile;
771
+ }
772
+ /** Internal — called by LlamaCppSession to register itself for startup fan-out. */
773
+ _registerActiveSession(session) {
774
+ this.activeSessions.add(session);
775
+ // If we already have a startup phase in-flight (another session
776
+ // triggered the engine boot), replay it to the new session so it
777
+ // isn't stuck on a bare spinner until the next log line.
778
+ if (this.lastStartupPhase)
779
+ session.publishEnginePhase(this.lastStartupPhase);
780
+ // Same replay for engine stats — a session opened after the
781
+ // engine is warm still deserves to know the RAM footprint for
782
+ // its UI dropdown, without waiting for a restart.
783
+ if (this.lastEngineStats)
784
+ session.publishEngineStats(this.lastEngineStats);
785
+ }
786
+ _deregisterActiveSession(session) {
787
+ this.activeSessions.delete(session);
788
+ }
789
+ async listModels() {
790
+ // Enumerate every installed model so pickers and `/v1/models`
791
+ // advertise the full set the engine pool can actually serve —
792
+ // not just the one currently resident. Mirrors MlxProvider.
793
+ if (this.modelManager) {
794
+ try {
795
+ const installed = await this.modelManager.listInstalled();
796
+ if (installed.length > 0) {
797
+ return installed.map((m) => {
798
+ const sizeGb = m.approxSizeBytes / (1024 * 1024 * 1024);
799
+ const sizeLabel = sizeGb >= 0.1 ? ` · ${sizeGb.toFixed(1)} GB` : '';
800
+ const ctxLabel = m.contextWindow ? ` · ${Math.round(m.contextWindow / 1024)}k ctx` : '';
801
+ return {
802
+ id: m.id,
803
+ name: `${m.name}${sizeLabel}${ctxLabel}`,
804
+ supportsTools: true,
805
+ ...(m.contextWindow ? { contextWindow: m.contextWindow } : {}),
806
+ };
807
+ });
808
+ }
809
+ }
810
+ catch {
811
+ // Fall through to the default-only entry — enumeration is a
812
+ // UI/discovery nicety, not load-bearing for chat.
813
+ }
814
+ }
815
+ // No manager wired (external-baseUrl mode) or nothing installed:
816
+ // a single entry describing the running config.
817
+ return [
818
+ {
819
+ id: this.defaultModel,
820
+ name: this.defaultModel,
821
+ supportsTools: true,
822
+ },
823
+ ];
824
+ }
825
+ getEffectiveModelId() {
826
+ return this.catalogModelId;
827
+ }
828
+ async resolveBaseUrl() {
829
+ if (this.externalBaseUrl)
830
+ return this.externalBaseUrl;
831
+ if (this.disposed) {
832
+ throw new Error('[llama-cpp] provider disposed (engine was evicted) — re-resolve it');
833
+ }
834
+ if (!this.supervisor)
835
+ throw new Error('[llama-cpp] no base URL resolver configured');
836
+ // Acquire the GPU slot BEFORE asking the supervisor to start. In
837
+ // `swap` policy this evicts a running image engine so its VRAM is
838
+ // released by the time llama-server tries to load weights. In
839
+ // `coexist` policy the call returns immediately. The arbiter is
840
+ // only set on the supervised path (see constructor).
841
+ if (this.arbiter)
842
+ await this.arbiter.acquire('llm');
843
+ const ensureStartedAt = Date.now();
844
+ let launch;
845
+ try {
846
+ launch = await this.supervisor.ensureRunning();
847
+ }
848
+ catch (err) {
849
+ const nativeExit = this.supervisor.lastExitSnapshot?.();
850
+ if (nativeExit && !nativeExit.expected && nativeExit.exitedAt >= ensureStartedAt) {
851
+ throw new NativeEngineCrashedError(nativeExit, err);
852
+ }
853
+ throw err;
854
+ }
855
+ return launch.baseUrl.replace(/\/+$/, '');
856
+ }
857
+ async acquireGpuLease() {
858
+ if (this.externalBaseUrl || !this.arbiter)
859
+ return undefined;
860
+ return this.arbiter.acquireLease('llm');
861
+ }
862
+ }