@bendyline/gezel-inference 0.0.0-stage → 1.0.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.
- package/LICENSE +21 -0
- package/README.md +13 -2
- package/dist/cache/adapter.d.ts +115 -0
- package/dist/cache/adapter.js +23 -0
- package/dist/cache/budget.d.ts +15 -0
- package/dist/cache/budget.js +31 -0
- package/dist/cache/controller.d.ts +205 -0
- package/dist/cache/controller.js +377 -0
- package/dist/catalog/LICENSE +21 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/manifest.json +146 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-35b-q4/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/manifest.json +146 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/bt/btl4-compact-iq2/versions/1.0.2/manifest.json +15 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/manifest.json +166 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.0/manifest.json +62 -0
- package/dist/catalog/chat-models/de/deepseek-r1-8b-q4/versions/1.1.1/manifest.json +61 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/manifest.json +125 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-mxfp4/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/manifest.json +125 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2/versions/1.1.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/manifest.json +126 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q2q4/versions/1.0.0/manifest.json +27 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/manifest.json +318 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.0.0/manifest.json +225 -0
- package/dist/catalog/chat-models/de/deepseek-v4-flash-284b-q4/versions/1.1.0/manifest.json +225 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/manifest.json +249 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.0.0/manifest.json +70 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.2/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.1.3/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q4/versions/1.2.0/manifest.json +98 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/manifest.json +228 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.2/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.0.3/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-12b-q8/versions/1.1.0/manifest.json +78 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/manifest.json +220 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.1.0/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.0/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.1/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.2.2/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-26b-q4/versions/1.3.0/manifest.json +81 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/manifest.json +226 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.0/manifest.json +80 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.1.1/manifest.json +82 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.0/manifest.json +82 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.1/manifest.json +95 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.2.2/manifest.json +95 -0
- package/dist/catalog/chat-models/ge/gemma4-31b-q4/versions/1.3.0/manifest.json +86 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/manifest.json +213 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.0/manifest.json +67 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.1.2/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.0/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.2.1/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e2b-q4/versions/1.3.0/manifest.json +71 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/manifest.json +205 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.1.2/manifest.json +75 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.0/manifest.json +76 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.2.1/manifest.json +76 -0
- package/dist/catalog/chat-models/ge/gemma4-e4b-q4/versions/1.3.0/manifest.json +76 -0
- package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/manifest.json +127 -0
- package/dist/catalog/chat-models/gl/glm-5.2-754b-q2/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/manifest.json +140 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.0/manifest.json +23 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.1/manifest.json +26 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/manifest.json +247 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.0.0/manifest.json +137 -0
- package/dist/catalog/chat-models/gp/gpt-oss-120b-q4/versions/1.1.0/manifest.json +135 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/manifest.json +195 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.0/manifest.json +72 -0
- package/dist/catalog/chat-models/gp/gpt-oss-20b-q4/versions/1.1.1/manifest.json +71 -0
- package/dist/catalog/chat-models/gr/granite4.2-30b-q4/manifest.json +200 -0
- package/dist/catalog/chat-models/gr/granite4.2-30b-q4/versions/1.0.0/manifest.json +72 -0
- package/dist/catalog/chat-models/gr/granite4.2-3b-q4/manifest.json +196 -0
- package/dist/catalog/chat-models/gr/granite4.2-3b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/gr/granite4.2-8b-q4/manifest.json +189 -0
- package/dist/catalog/chat-models/gr/granite4.2-8b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/index.json +1 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/manifest.json +235 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.0/manifest.json +124 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.1/manifest.json +124 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q4/versions/1.0.2/manifest.json +123 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/manifest.json +257 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.0/manifest.json +145 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q6/versions/1.0.1/manifest.json +145 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/manifest.json +285 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.0/manifest.json +174 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.1/manifest.json +174 -0
- package/dist/catalog/chat-models/la/laguna-s-2.1-118b-q8/versions/1.0.2/manifest.json +173 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/manifest.json +162 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.0/manifest.json +59 -0
- package/dist/catalog/chat-models/lf/lfm2.5-2.6b-q4/versions/1.0.1/manifest.json +58 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/manifest.json +134 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.0/manifest.json +57 -0
- package/dist/catalog/chat-models/ll/llama3.2-3b-q4/versions/1.1.1/manifest.json +56 -0
- package/dist/catalog/chat-models/mi/minicpm5-1b-q4/manifest.json +156 -0
- package/dist/catalog/chat-models/mi/minicpm5-1b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/mi/minicpm5-2b-q4/manifest.json +161 -0
- package/dist/catalog/chat-models/mi/minicpm5-2b-q4/versions/1.0.0/manifest.json +57 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/manifest.json +159 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.0/manifest.json +62 -0
- package/dist/catalog/chat-models/mi/mistral-7b-q4/versions/1.1.1/manifest.json +61 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/manifest.json +275 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.0/manifest.json +154 -0
- package/dist/catalog/chat-models/mi/mistral-medium-3.5-128b-q4/versions/1.0.1/manifest.json +153 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/manifest.json +135 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.1/manifest.json +20 -0
- package/dist/catalog/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.2/manifest.json +20 -0
- package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/manifest.json +138 -0
- package/dist/catalog/chat-models/na/nanbeige4.2-3b-q4/versions/1.0.0/manifest.json +14 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/manifest.json +212 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.0/manifest.json +94 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.1/manifest.json +94 -0
- package/dist/catalog/chat-models/ne/nemotron3-nano-30b-q4/versions/1.0.2/manifest.json +93 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/manifest.json +135 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.0/manifest.json +30 -0
- package/dist/catalog/chat-models/ne/nemotron3-super-120b-q4/versions/1.0.1/manifest.json +30 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/manifest.json +192 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.0/manifest.json +74 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q4/versions/1.0.1/manifest.json +73 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/manifest.json +207 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.0/manifest.json +89 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-lightning-30b-q8/versions/1.0.1/manifest.json +88 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/manifest.json +224 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.0/manifest.json +94 -0
- package/dist/catalog/chat-models/or/ornith-35b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/manifest.json +244 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.0/manifest.json +114 -0
- package/dist/catalog/chat-models/or/ornith-35b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/manifest.json +215 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.0/manifest.json +84 -0
- package/dist/catalog/chat-models/or/ornith-9b-q4/versions/1.0.1/manifest.json +83 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/manifest.json +208 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q4/versions/1.0.0/manifest.json +74 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/manifest.json +223 -0
- package/dist/catalog/chat-models/or/ornith1.5-35b-a3b-q8/versions/1.0.0/manifest.json +89 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/manifest.json +187 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.0/manifest.json +53 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q4/versions/1.0.1/manifest.json +77 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/manifest.json +192 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.0/manifest.json +58 -0
- package/dist/catalog/chat-models/or/ornith1.5-9b-q8/versions/1.0.1/manifest.json +82 -0
- package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/manifest.json +192 -0
- package/dist/catalog/chat-models/qw/qwen3.5-0.8b-q4/versions/1.0.0/manifest.json +75 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/manifest.json +315 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.0/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.1/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.2/manifest.json +164 -0
- package/dist/catalog/chat-models/qw/qwen3.5-122b-a10b-q4/versions/1.0.3/manifest.json +163 -0
- package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/manifest.json +217 -0
- package/dist/catalog/chat-models/qw/qwen3.5-27b-q4/versions/1.0.0/manifest.json +90 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.0/manifest.json +77 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.2/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-2b-q4/versions/1.1.3/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/manifest.json +188 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.0/manifest.json +77 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.2/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-4b-q4/versions/1.1.3/manifest.json +76 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/manifest.json +205 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.0/manifest.json +82 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.2/manifest.json +81 -0
- package/dist/catalog/chat-models/qw/qwen3.5-9b-q4/versions/1.1.3/manifest.json +81 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/manifest.json +230 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.0/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.4/manifest.json +91 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.5/manifest.json +91 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q4/versions/1.1.6/manifest.json +115 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/manifest.json +240 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.0/manifest.json +102 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.2/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.3/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.6-27b-q8/versions/1.0.4/manifest.json +127 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/manifest.json +233 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.0/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.2/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q4/versions/1.0.3/manifest.json +117 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/manifest.json +252 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.0/manifest.json +112 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.2/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.6-35b-a3b-q8/versions/1.0.3/manifest.json +137 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/manifest.json +195 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-iq1-s/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q2/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/manifest.json +194 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.0/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q3/versions/1.0.1/manifest.json +19 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/manifest.json +291 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.1/manifest.json +93 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.2/manifest.json +92 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.3/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.4/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q4/versions/1.0.5/manifest.json +116 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/manifest.json +278 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.0/manifest.json +20 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.1/manifest.json +104 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.2/manifest.json +103 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q6/versions/1.0.3/manifest.json +127 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/manifest.json +278 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.0/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.1/manifest.json +113 -0
- package/dist/catalog/chat-models/qw/qwen3.8-27b-q8/versions/1.0.2/manifest.json +137 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/manifest.json +221 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq3/versions/1.0.0/manifest.json +36 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/manifest.json +429 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.0.0/manifest.json +36 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.0/manifest.json +205 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-iq4/versions/1.1.1/manifest.json +244 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/manifest.json +203 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.0/manifest.json +21 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.1/manifest.json +31 -0
- package/dist/catalog/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.2/manifest.json +30 -0
- package/dist/catalog/chat-models/raw-index.json +1 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/manifest.json +79 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/ta/talkie-1930-13b-q4/versions/1.0.1/manifest.json +15 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/manifest.json +204 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.0/manifest.json +70 -0
- package/dist/catalog/chat-models/te/ternary-bonsai-27b-q2/versions/1.0.1/manifest.json +70 -0
- package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/manifest.json +164 -0
- package/dist/catalog/chat-models/un/underdog-saluki-27b-iq2-mix/versions/1.0.0/manifest.json +14 -0
- package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/manifest.json +26 -0
- package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/versions/2026.10.8/manifest.json +8950 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/versions/2026.10.1/manifest.json +658 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/versions/2026.10.1/manifest.json +666 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/versions/2026.10.2/manifest.json +182 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/manifest.json +25 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/versions/2026.10.5/manifest.json +38 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/versions/2026.10.1/manifest.json +558 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/versions/2026.10.1/manifest.json +258 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/versions/2026.10.1/manifest.json +318 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/versions/2026.10.1/manifest.json +266 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/versions/2026.10.1/manifest.json +186 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/versions/2026.10.1/manifest.json +138 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/versions/2026.10.1/manifest.json +138 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/manifest.json +24 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/versions/2026.10.3/manifest.json +626 -0
- package/dist/catalog/knowledge-catalogs/index.json +1 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/versions/2026.10.16/manifest.json +18270 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/versions/2026.10.16/manifest.json +1098 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/versions/2026.10.16/manifest.json +722 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/versions/2026.10.16/manifest.json +530 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/versions/2026.10.16/manifest.json +602 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/manifest.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/versions/2026.10.16/manifest.json +250 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/versions/2026.10.16/manifest.json +16794 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/versions/2026.10.16/manifest.json +1106 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/versions/2026.10.16/manifest.json +234 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/versions/2026.10.16/manifest.json +522 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/versions/2026.10.16/manifest.json +1850 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/versions/2026.10.16/manifest.json +1734 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/manifest.json +22 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/versions/2026.10.16/manifest.json +774 -0
- package/dist/catalog/knowledge-catalogs/raw-index.json +1 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/manifest.json +48 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/versions/2026.10.3/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/manifest.json +28 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.2/manifest.json +53 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.3/manifest.json +885 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.4.5/manifest.json +157 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/manifest.json +32 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.2/manifest.json +69 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.3/manifest.json +741 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.4.5/manifest.json +173 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/manifest.json +69 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.4/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.4.5/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.4/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.3/manifest.json +925 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/manifest.json +28 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.2/manifest.json +53 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.3/manifest.json +1665 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.4.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.3/manifest.json +1233 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.4.5/manifest.json +141 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.3/manifest.json +493 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/manifest.json +63 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.4/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.4.5/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/manifest.json +30 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.2/manifest.json +61 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.3/manifest.json +665 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.4.5/manifest.json +177 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.3/manifest.json +745 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/manifest.json +62 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.4/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.4/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.4.5/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/manifest.json +30 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.2/manifest.json +61 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.3/manifest.json +1253 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/manifest.json +29 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.2/manifest.json +57 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.3/manifest.json +1957 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.4.5/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/manifest.json +63 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.4.5/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/art.json +11 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/manifest.json +45 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.4/manifest.json +121 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.4.5/manifest.json +173 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/art.json +12 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/logo.webp +0 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/manifest.json +62 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.4/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.4.5/manifest.json +189 -0
- package/dist/catalog/provenance.json +8 -0
- package/dist/chat/catalog-model-lookup.d.ts +21 -0
- package/dist/chat/catalog-model-lookup.js +48 -0
- package/dist/chat/local-model-tier.d.ts +1 -0
- package/dist/chat/local-model-tier.js +2 -0
- package/dist/chat/vision-capability.d.ts +1 -0
- package/dist/chat/vision-capability.js +3 -0
- package/dist/engine-components.d.ts +30 -0
- package/dist/engine-components.js +144 -0
- package/dist/engines/electron-native-reuse.d.ts +65 -0
- package/dist/engines/electron-native-reuse.js +305 -0
- package/dist/engines/native-file-manifest.json +1320 -0
- package/dist/engines/native-manifest.d.ts +70 -0
- package/dist/engines/native-manifest.js +98 -0
- package/dist/engines/registry.d.ts +88 -0
- package/dist/engines/registry.js +217 -0
- package/dist/engines/resolver.d.ts +121 -0
- package/dist/engines/resolver.js +894 -0
- package/dist/engines/signature.d.ts +85 -0
- package/dist/engines/signature.js +231 -0
- package/dist/fs/atomic.d.ts +53 -0
- package/dist/fs/atomic.js +202 -0
- package/dist/fs/config-store.d.ts +14 -0
- package/dist/fs/config-store.js +101 -0
- package/dist/fs/home-permissions.d.ts +18 -0
- package/dist/fs/home-permissions.js +27 -0
- package/dist/fs/safe-paths.d.ts +107 -0
- package/dist/fs/safe-paths.js +264 -0
- package/dist/fs/security-json.d.ts +13 -0
- package/dist/fs/security-json.js +67 -0
- package/dist/http/auth-context.d.ts +23 -0
- package/dist/http/auth-context.js +1 -0
- package/dist/http/engine-runtime-context.d.ts +30 -0
- package/dist/http/engine-runtime-context.js +1 -0
- package/dist/http/external-conversation-contract.d.ts +49 -0
- package/dist/http/external-conversation-contract.js +1 -0
- package/dist/http/external-conversation-headers.d.ts +11 -0
- package/dist/http/external-conversation-headers.js +11 -0
- package/dist/http/inference-context.d.ts +36 -0
- package/dist/http/inference-context.js +1 -0
- package/dist/http/model-inventory-cache.d.ts +8 -0
- package/dist/http/model-inventory-cache.js +8 -0
- package/dist/http/openai-compat/action-ledger.d.ts +15 -0
- package/dist/http/openai-compat/action-ledger.js +119 -0
- package/dist/http/openai-compat/apple-model.d.ts +3 -0
- package/dist/http/openai-compat/apple-model.js +44 -0
- package/dist/http/openai-compat/caller-owned-profile.d.ts +7 -0
- package/dist/http/openai-compat/caller-owned-profile.js +18 -0
- package/dist/http/openai-compat/chat-progress.d.ts +9 -0
- package/dist/http/openai-compat/chat-progress.js +69 -0
- package/dist/http/openai-compat/chat-target.d.ts +76 -0
- package/dist/http/openai-compat/chat-target.js +97 -0
- package/dist/http/openai-compat/embeddings.d.ts +37 -0
- package/dist/http/openai-compat/embeddings.js +86 -0
- package/dist/http/openai-compat/request-tuning.d.ts +35 -0
- package/dist/http/openai-compat/request-tuning.js +87 -0
- package/dist/http/openai-compat/responses-streaming.d.ts +351 -0
- package/dist/http/openai-compat/responses-streaming.js +717 -0
- package/dist/http/openai-compat/responses-translate.d.ts +215 -0
- package/dist/http/openai-compat/responses-translate.js +377 -0
- package/dist/http/openai-compat/streaming-telemetry.d.ts +30 -0
- package/dist/http/openai-compat/streaming-telemetry.js +88 -0
- package/dist/http/openai-compat/streaming.d.ts +141 -0
- package/dist/http/openai-compat/streaming.js +687 -0
- package/dist/http/openai-compat/tool-call-stream-filter.d.ts +33 -0
- package/dist/http/openai-compat/tool-call-stream-filter.js +110 -0
- package/dist/http/openai-compat/translate.d.ts +254 -0
- package/dist/http/openai-compat/translate.js +485 -0
- package/dist/http/routes/engines.d.ts +13 -0
- package/dist/http/routes/engines.js +366 -0
- package/dist/http/routes/machine-engine-proxy.d.ts +26 -0
- package/dist/http/routes/machine-engine-proxy.js +43 -0
- package/dist/http/routes/model-bundles.d.ts +4 -0
- package/dist/http/routes/model-bundles.js +190 -0
- package/dist/http/routes/v1-chat.d.ts +72 -0
- package/dist/http/routes/v1-chat.js +645 -0
- package/dist/http/routes/v1-embeddings.d.ts +3 -0
- package/dist/http/routes/v1-embeddings.js +82 -0
- package/dist/http/routes/v1-knowledge.d.ts +4 -0
- package/dist/http/routes/v1-knowledge.js +304 -0
- package/dist/http/routes/v1-models-ensure.d.ts +32 -0
- package/dist/http/routes/v1-models-ensure.js +122 -0
- package/dist/http/routes/v1-models.d.ts +8 -0
- package/dist/http/routes/v1-models.js +189 -0
- package/dist/http/routes/v1-responses.d.ts +20 -0
- package/dist/http/routes/v1-responses.js +327 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/inference-service.d.ts +28 -0
- package/dist/inference-service.js +275 -0
- package/dist/knowledge/admission.d.ts +3 -0
- package/dist/knowledge/admission.js +22 -0
- package/dist/knowledge/bundled-catalog.d.ts +2 -0
- package/dist/knowledge/bundled-catalog.js +2 -0
- package/dist/knowledge/catalog-host.d.ts +103 -0
- package/dist/knowledge/catalog-host.js +180 -0
- package/dist/knowledge/catalog-source.d.ts +22 -0
- package/dist/knowledge/catalog-source.js +35 -0
- package/dist/knowledge/install.d.ts +55 -0
- package/dist/knowledge/install.js +274 -0
- package/dist/knowledge/manager.d.ts +287 -0
- package/dist/knowledge/manager.js +1540 -0
- package/dist/knowledge/registry.d.ts +35 -0
- package/dist/knowledge/registry.js +123 -0
- package/dist/knowledge/search-worker.d.ts +17 -0
- package/dist/knowledge/search-worker.js +36 -0
- package/dist/knowledge/shared-install-contract.d.ts +19 -0
- package/dist/knowledge/shared-install-contract.js +1 -0
- package/dist/knowledge/spatial-query.d.ts +11 -0
- package/dist/knowledge/spatial-query.js +33 -0
- package/dist/knowledge/trust-anchors.d.ts +11 -0
- package/dist/knowledge/trust-anchors.js +51 -0
- package/dist/knowledge/vector-floors.d.ts +44 -0
- package/dist/knowledge/vector-floors.js +92 -0
- package/dist/knowledge/worker-host.d.ts +9 -0
- package/dist/knowledge/worker-host.js +179 -0
- package/dist/kokoro-lexicon/LICENSE +202 -0
- package/dist/kokoro-lexicon/lexicon-gb-en.txt.gz +0 -0
- package/dist/kokoro-lexicon/lexicon-us-en.txt.gz +0 -0
- package/dist/kokoro-lexicon/manifest.json +23 -0
- package/dist/machine-engine/inspect-runtime.d.ts +3 -0
- package/dist/machine-engine/inspect-runtime.js +48 -0
- package/dist/machine-engine/knowledge-assets.d.ts +79 -0
- package/dist/machine-engine/knowledge-assets.js +505 -0
- package/dist/memory/embed-core.d.ts +131 -0
- package/dist/memory/embed-core.js +398 -0
- package/dist/memory/embed-worker.d.ts +23 -0
- package/dist/memory/embed-worker.js +49 -0
- package/dist/memory/embeddings.d.ts +105 -0
- package/dist/memory/embeddings.js +467 -0
- package/dist/model-profile/behaviors/tools-mlx-template-fix.d.ts +1 -0
- package/dist/model-profile/behaviors/tools-mlx-template-fix.js +2 -0
- package/dist/model-profile/behaviors/turn-ramble-detection.d.ts +1 -0
- package/dist/model-profile/behaviors/turn-ramble-detection.js +2 -0
- package/dist/model-profile/defaults.d.ts +1 -0
- package/dist/model-profile/defaults.js +2 -0
- package/dist/model-profile/index.d.ts +9 -0
- package/dist/model-profile/index.js +7 -0
- package/dist/model-profile/registry.d.ts +15 -0
- package/dist/model-profile/registry.js +18 -0
- package/dist/model-profile/runtime.d.ts +48 -0
- package/dist/model-profile/runtime.js +131 -0
- package/dist/model-profile/tool-grammar.d.ts +1 -0
- package/dist/model-profile/tool-grammar.js +2 -0
- package/dist/model-profile/tuning.d.ts +19 -0
- package/dist/model-profile/tuning.js +21 -0
- package/dist/model-profile/types.d.ts +1 -0
- package/dist/model-profile/types.js +2 -0
- package/dist/models/bundle-storage.d.ts +28 -0
- package/dist/models/bundle-storage.js +80 -0
- package/dist/models/catalog-drift.d.ts +48 -0
- package/dist/models/catalog-drift.js +94 -0
- package/dist/models/catalog-payload-identity.d.ts +107 -0
- package/dist/models/catalog-payload-identity.js +254 -0
- package/dist/models/ensure.d.ts +125 -0
- package/dist/models/ensure.js +205 -0
- package/dist/models/gezmodel.d.ts +47 -0
- package/dist/models/gezmodel.js +742 -0
- package/dist/models/install-registry.d.ts +101 -0
- package/dist/models/install-registry.js +216 -0
- package/dist/models/model-id.d.ts +22 -0
- package/dist/models/model-id.js +40 -0
- package/dist/models/storage-roots.d.ts +274 -0
- package/dist/models/storage-roots.js +865 -0
- package/dist/native-release-entry.d.ts +16 -0
- package/dist/native-release-entry.js +16 -0
- package/dist/perf/redact-path.d.ts +2 -0
- package/dist/perf/redact-path.js +27 -0
- package/dist/perf/responsiveness.d.ts +70 -0
- package/dist/perf/responsiveness.js +560 -0
- package/dist/providers/active-install-message.d.ts +42 -0
- package/dist/providers/active-install-message.js +49 -0
- package/dist/providers/apple-foundation-models/binary.d.ts +4 -0
- package/dist/providers/apple-foundation-models/binary.js +18 -0
- package/dist/providers/apple-foundation-models/helper.d.ts +66 -0
- package/dist/providers/apple-foundation-models/helper.js +262 -0
- package/dist/providers/apple-foundation-models/provider.d.ts +82 -0
- package/dist/providers/apple-foundation-models/provider.js +389 -0
- package/dist/providers/apple-foundation-models/status.d.ts +9 -0
- package/dist/providers/apple-foundation-models/status.js +49 -0
- package/dist/providers/audio/kokoro-frontend.d.ts +50 -0
- package/dist/providers/audio/kokoro-frontend.js +113 -0
- package/dist/providers/audio/managed-speech-model.d.ts +9 -0
- package/dist/providers/audio/managed-speech-model.js +86 -0
- package/dist/providers/audio/types.d.ts +202 -0
- package/dist/providers/audio/types.js +17 -0
- package/dist/providers/audio/whisper-cpp.d.ts +99 -0
- package/dist/providers/audio/whisper-cpp.js +420 -0
- package/dist/providers/audio-persister-contract.d.ts +13 -0
- package/dist/providers/audio-persister-contract.js +1 -0
- package/dist/providers/catalog-model-config.d.ts +63 -0
- package/dist/providers/catalog-model-config.js +95 -0
- package/dist/providers/code-block-salvage.d.ts +1 -0
- package/dist/providers/code-block-salvage.js +2 -0
- package/dist/providers/codex-cli/reasoning.d.ts +8 -0
- package/dist/providers/codex-cli/reasoning.js +17 -0
- package/dist/providers/complete-tool-call.d.ts +16 -0
- package/dist/providers/complete-tool-call.js +25 -0
- package/dist/providers/constrained-turn.d.ts +1 -0
- package/dist/providers/constrained-turn.js +2 -0
- package/dist/providers/deliverable-read-pacing.d.ts +1 -0
- package/dist/providers/deliverable-read-pacing.js +2 -0
- package/dist/providers/direct-file-work-prompt.d.ts +1 -0
- package/dist/providers/direct-file-work-prompt.js +2 -0
- package/dist/providers/ds4/build-provider.d.ts +100 -0
- package/dist/providers/ds4/build-provider.js +539 -0
- package/dist/providers/ds4/cache-adapter.d.ts +42 -0
- package/dist/providers/ds4/cache-adapter.js +110 -0
- package/dist/providers/ds4/dspark.d.ts +83 -0
- package/dist/providers/ds4/dspark.js +107 -0
- package/dist/providers/ds4/mtp.d.ts +32 -0
- package/dist/providers/ds4/mtp.js +46 -0
- package/dist/providers/ds4/provider.d.ts +67 -0
- package/dist/providers/ds4/provider.js +104 -0
- package/dist/providers/ds4/residency.d.ts +143 -0
- package/dist/providers/ds4/residency.js +139 -0
- package/dist/providers/ds4/stdout-parser.d.ts +47 -0
- package/dist/providers/ds4/stdout-parser.js +134 -0
- package/dist/providers/duplicate-tool-calls.d.ts +1 -0
- package/dist/providers/duplicate-tool-calls.js +2 -0
- package/dist/providers/file-repair-policy.d.ts +1 -0
- package/dist/providers/file-repair-policy.js +2 -0
- package/dist/providers/gpu-arbiter.d.ts +159 -0
- package/dist/providers/gpu-arbiter.js +301 -0
- package/dist/providers/image-persister-contract.d.ts +15 -0
- package/dist/providers/image-persister-contract.js +1 -0
- package/dist/providers/llama-cpp/build-metadata.d.ts +13 -0
- package/dist/providers/llama-cpp/build-metadata.js +39 -0
- package/dist/providers/llama-cpp/build-provider.d.ts +66 -0
- package/dist/providers/llama-cpp/build-provider.js +1491 -0
- package/dist/providers/llama-cpp/cache-adapter.d.ts +242 -0
- package/dist/providers/llama-cpp/cache-adapter.js +689 -0
- package/dist/providers/llama-cpp/devices.d.ts +130 -0
- package/dist/providers/llama-cpp/devices.js +256 -0
- package/dist/providers/llama-cpp/disk-cache.d.ts +8 -0
- package/dist/providers/llama-cpp/disk-cache.js +112 -0
- package/dist/providers/llama-cpp/engine-flags.d.ts +181 -0
- package/dist/providers/llama-cpp/engine-flags.js +279 -0
- package/dist/providers/llama-cpp/gguf-metadata-async.d.ts +11 -0
- package/dist/providers/llama-cpp/gguf-metadata-async.js +180 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.d.ts +7 -0
- package/dist/providers/llama-cpp/gguf-metadata-worker.js +27 -0
- package/dist/providers/llama-cpp/gguf-metadata.d.ts +198 -0
- package/dist/providers/llama-cpp/gguf-metadata.js +615 -0
- package/dist/providers/llama-cpp/gguf-quantization-backfill.d.ts +32 -0
- package/dist/providers/llama-cpp/gguf-quantization-backfill.js +75 -0
- package/dist/providers/llama-cpp/index.d.ts +10 -0
- package/dist/providers/llama-cpp/index.js +13 -0
- package/dist/providers/llama-cpp/kv-cache-type.d.ts +118 -0
- package/dist/providers/llama-cpp/kv-cache-type.js +140 -0
- package/dist/providers/llama-cpp/log.d.ts +92 -0
- package/dist/providers/llama-cpp/log.js +280 -0
- package/dist/providers/llama-cpp/models.d.ts +389 -0
- package/dist/providers/llama-cpp/models.js +1011 -0
- package/dist/providers/llama-cpp/offload-planner.d.ts +339 -0
- package/dist/providers/llama-cpp/offload-planner.js +524 -0
- package/dist/providers/llama-cpp/provider.d.ts +493 -0
- package/dist/providers/llama-cpp/provider.js +862 -0
- package/dist/providers/llama-cpp/reasoning-launch.d.ts +7 -0
- package/dist/providers/llama-cpp/reasoning-launch.js +14 -0
- package/dist/providers/llama-cpp/spec-draft.d.ts +44 -0
- package/dist/providers/llama-cpp/spec-draft.js +44 -0
- package/dist/providers/llama-cpp/stdout-parser.d.ts +70 -0
- package/dist/providers/llama-cpp/stdout-parser.js +197 -0
- package/dist/providers/local-tool-call-salvage.d.ts +1 -0
- package/dist/providers/local-tool-call-salvage.js +2 -0
- package/dist/providers/local-turn-policy.d.ts +1 -0
- package/dist/providers/local-turn-policy.js +2 -0
- package/dist/providers/mlx/async-file-handoff.d.ts +11 -0
- package/dist/providers/mlx/async-file-handoff.js +25 -0
- package/dist/providers/mlx/build-provider.d.ts +65 -0
- package/dist/providers/mlx/build-provider.js +717 -0
- package/dist/providers/mlx/cache-adapter.d.ts +161 -0
- package/dist/providers/mlx/cache-adapter.js +445 -0
- package/dist/providers/mlx/chat-protocol.d.ts +48 -0
- package/dist/providers/mlx/chat-protocol.js +8 -0
- package/dist/providers/mlx/config-parser.d.ts +29 -0
- package/dist/providers/mlx/config-parser.js +81 -0
- package/dist/providers/mlx/engine-gate.d.ts +51 -0
- package/dist/providers/mlx/engine-gate.js +207 -0
- package/dist/providers/mlx/engine-hold.d.ts +41 -0
- package/dist/providers/mlx/engine-hold.js +59 -0
- package/dist/providers/mlx/engine-log-router.d.ts +84 -0
- package/dist/providers/mlx/engine-log-router.js +137 -0
- package/dist/providers/mlx/engine-stats-sampler.d.ts +36 -0
- package/dist/providers/mlx/engine-stats-sampler.js +59 -0
- package/dist/providers/mlx/index.d.ts +10 -0
- package/dist/providers/mlx/index.js +10 -0
- package/dist/providers/mlx/log.d.ts +55 -0
- package/dist/providers/mlx/log.js +157 -0
- package/dist/providers/mlx/model-geometry.d.ts +35 -0
- package/dist/providers/mlx/model-geometry.js +118 -0
- package/dist/providers/mlx/models.d.ts +289 -0
- package/dist/providers/mlx/models.js +1079 -0
- package/dist/providers/mlx/provider.d.ts +404 -0
- package/dist/providers/mlx/provider.js +3017 -0
- package/dist/providers/mlx/python/cache_persist.py +348 -0
- package/dist/providers/mlx/python/cache_seed.py +402 -0
- package/dist/providers/mlx/python/gezel_mlx_server.py +4491 -0
- package/dist/providers/mlx/python/lfm2_compat.py +55 -0
- package/dist/providers/mlx/python/qwen3_5_text_compat.py +60 -0
- package/dist/providers/mlx/python/qwen4_ple.py +159 -0
- package/dist/providers/mlx/python/spec_decode.py +775 -0
- package/dist/providers/mlx/python/template_stability.py +133 -0
- package/dist/providers/mlx/python/think_budget.py +113 -0
- package/dist/providers/mlx/python/tool_args_json.py +297 -0
- package/dist/providers/mlx/python/tool_call_stream.py +265 -0
- package/dist/providers/mlx/python/tool_grammar.py +794 -0
- package/dist/providers/mlx/python/vision_inputs.py +64 -0
- package/dist/providers/mlx/python/wave_policy.py +147 -0
- package/dist/providers/mlx/reasoning-stream.d.ts +85 -0
- package/dist/providers/mlx/reasoning-stream.js +196 -0
- package/dist/providers/mlx/request-shape.d.ts +34 -0
- package/dist/providers/mlx/request-shape.js +42 -0
- package/dist/providers/mlx/runtime-diagnostics.d.ts +29 -0
- package/dist/providers/mlx/runtime-diagnostics.js +162 -0
- package/dist/providers/mlx/spec-drafter.d.ts +25 -0
- package/dist/providers/mlx/spec-drafter.js +73 -0
- package/dist/providers/mlx/stdout-parser.d.ts +60 -0
- package/dist/providers/mlx/stdout-parser.js +254 -0
- package/dist/providers/mlx/textual-tool-call-salvage.d.ts +46 -0
- package/dist/providers/mlx/textual-tool-call-salvage.js +396 -0
- package/dist/providers/mlx/tool-call-protocol.d.ts +65 -0
- package/dist/providers/mlx/tool-call-protocol.js +140 -0
- package/dist/providers/mlx/tool-call-stripper.d.ts +68 -0
- package/dist/providers/mlx/tool-call-stripper.js +153 -0
- package/dist/providers/mlx/tool-image-retention.d.ts +23 -0
- package/dist/providers/mlx/tool-image-retention.js +43 -0
- package/dist/providers/mlx/turn-telemetry.d.ts +22 -0
- package/dist/providers/mlx/turn-telemetry.js +45 -0
- package/dist/providers/mlx/venv.d.ts +91 -0
- package/dist/providers/mlx/venv.js +111 -0
- package/dist/providers/mlx/vision-mode.d.ts +92 -0
- package/dist/providers/mlx/vision-mode.js +187 -0
- package/dist/providers/mlx/vision.d.ts +2 -0
- package/dist/providers/mlx/vision.js +12 -0
- package/dist/providers/mlx/wire-transcript.d.ts +14 -0
- package/dist/providers/mlx/wire-transcript.js +43 -0
- package/dist/providers/native/capacity-broker.d.ts +812 -0
- package/dist/providers/native/capacity-broker.js +1058 -0
- package/dist/providers/native/capacity-budget.d.ts +133 -0
- package/dist/providers/native/capacity-budget.js +265 -0
- package/dist/providers/native/device-capacity-ledger.d.ts +31 -0
- package/dist/providers/native/device-capacity-ledger.js +196 -0
- package/dist/providers/native/device-capacity.d.ts +84 -0
- package/dist/providers/native/device-capacity.js +431 -0
- package/dist/providers/native/engine-api-key.d.ts +57 -0
- package/dist/providers/native/engine-api-key.js +72 -0
- package/dist/providers/native/engine-key.d.ts +18 -0
- package/dist/providers/native/engine-key.js +41 -0
- package/dist/providers/native/engine-router.d.ts +145 -0
- package/dist/providers/native/engine-router.js +191 -0
- package/dist/providers/native/gpu-panic-guard.d.ts +54 -0
- package/dist/providers/native/gpu-panic-guard.js +59 -0
- package/dist/providers/native/inference.d.ts +33 -0
- package/dist/providers/native/inference.js +49 -0
- package/dist/providers/native/local-engine-runtime.d.ts +412 -0
- package/dist/providers/native/local-engine-runtime.js +1714 -0
- package/dist/providers/native/measured-budget.d.ts +32 -0
- package/dist/providers/native/measured-budget.js +54 -0
- package/dist/providers/native/port.d.ts +11 -0
- package/dist/providers/native/port.js +29 -0
- package/dist/providers/native/provider-pool.d.ts +474 -0
- package/dist/providers/native/provider-pool.js +1166 -0
- package/dist/providers/native/supervisor.d.ts +503 -0
- package/dist/providers/native/supervisor.js +1466 -0
- package/dist/providers/observation-context.d.ts +16 -0
- package/dist/providers/observation-context.js +1 -0
- package/dist/providers/openai-compatible/sse.d.ts +1 -0
- package/dist/providers/openai-compatible/sse.js +2 -0
- package/dist/providers/patient-fetch.d.ts +36 -0
- package/dist/providers/patient-fetch.js +44 -0
- package/dist/providers/project-macro-loop-bail.d.ts +7 -0
- package/dist/providers/project-macro-loop-bail.js +21 -0
- package/dist/providers/prose-document-salvage.d.ts +1 -0
- package/dist/providers/prose-document-salvage.js +2 -0
- package/dist/providers/provider-disposal.d.ts +1 -0
- package/dist/providers/provider-disposal.js +2 -0
- package/dist/providers/queue.d.ts +15 -0
- package/dist/providers/queue.js +23 -0
- package/dist/providers/ramble-abort-message.d.ts +1 -0
- package/dist/providers/ramble-abort-message.js +2 -0
- package/dist/providers/ramble-detector.d.ts +1 -0
- package/dist/providers/ramble-detector.js +2 -0
- package/dist/providers/reasoning-depth.d.ts +1 -0
- package/dist/providers/reasoning-depth.js +2 -0
- package/dist/providers/required-input-reads.d.ts +1 -0
- package/dist/providers/required-input-reads.js +2 -0
- package/dist/providers/session-defaults.d.ts +13 -0
- package/dist/providers/session-defaults.js +49 -0
- package/dist/providers/session-hooks.d.ts +26 -0
- package/dist/providers/session-hooks.js +1 -0
- package/dist/providers/streaming-session.d.ts +1 -0
- package/dist/providers/streaming-session.js +2 -0
- package/dist/providers/terminal-tool-policy.d.ts +1 -0
- package/dist/providers/terminal-tool-policy.js +2 -0
- package/dist/providers/tool-arg-schema-coercion.d.ts +1 -0
- package/dist/providers/tool-arg-schema-coercion.js +2 -0
- package/dist/providers/tool-executor.d.ts +12 -0
- package/dist/providers/tool-executor.js +20 -0
- package/dist/providers/tool-failure-tracker.d.ts +1 -0
- package/dist/providers/tool-failure-tracker.js +2 -0
- package/dist/providers/tool-repeat-tracker.d.ts +1 -0
- package/dist/providers/tool-repeat-tracker.js +2 -0
- package/dist/providers/turn-timeout.d.ts +1 -0
- package/dist/providers/turn-timeout.js +1 -0
- package/dist/providers/types.d.ts +834 -0
- package/dist/providers/types.js +42 -0
- package/dist/providers/usage-builder.d.ts +1 -0
- package/dist/providers/usage-builder.js +2 -0
- package/dist/providers/vision-capability.d.ts +109 -0
- package/dist/providers/vision-capability.js +137 -0
- package/dist/python/mlx-runtime-status-bus.d.ts +39 -0
- package/dist/python/mlx-runtime-status-bus.js +27 -0
- package/dist/python/uv-runtime.d.ts +176 -0
- package/dist/python/uv-runtime.js +492 -0
- package/dist/relevance/install.d.ts +28 -0
- package/dist/relevance/install.js +114 -0
- package/dist/relevance/manager.d.ts +79 -0
- package/dist/relevance/manager.js +211 -0
- package/dist/relevance/registry.d.ts +11 -0
- package/dist/relevance/registry.js +158 -0
- package/dist/relevance/relevance-core.d.ts +67 -0
- package/dist/relevance/relevance-core.js +189 -0
- package/dist/relevance/relevance-model.d.ts +42 -0
- package/dist/relevance/relevance-model.js +292 -0
- package/dist/relevance/relevance-worker.d.ts +20 -0
- package/dist/relevance/relevance-worker.js +57 -0
- package/dist/relevance/settings.d.ts +30 -0
- package/dist/relevance/settings.js +81 -0
- package/dist/remotes/identity.d.ts +121 -0
- package/dist/remotes/identity.js +348 -0
- package/dist/remotes/pinned-fetch.d.ts +45 -0
- package/dist/remotes/pinned-fetch.js +193 -0
- package/dist/remotes/types.d.ts +54 -0
- package/dist/remotes/types.js +1 -0
- package/dist/runtime-lock.d.ts +29 -0
- package/dist/runtime-lock.js +85 -0
- package/dist/search/relevance-stage.d.ts +81 -0
- package/dist/search/relevance-stage.js +177 -0
- package/dist/secrets/types.d.ts +63 -0
- package/dist/secrets/types.js +64 -0
- package/dist/speech.d.ts +1 -0
- package/dist/speech.js +1 -0
- package/dist/system/darwin-memory.d.ts +26 -0
- package/dist/system/darwin-memory.js +81 -0
- package/dist/system/gezel-process-memory.d.ts +55 -0
- package/dist/system/gezel-process-memory.js +156 -0
- package/dist/system/memory.d.ts +154 -0
- package/dist/system/memory.js +501 -0
- package/dist/transformers-cache.d.ts +112 -0
- package/dist/transformers-cache.js +392 -0
- package/dist/utils/disk-space.d.ts +55 -0
- package/dist/utils/disk-space.js +72 -0
- package/dist/utils/download-common.d.ts +138 -0
- package/dist/utils/download-common.js +196 -0
- package/dist/utils/download-with-retry.d.ts +85 -0
- package/dist/utils/download-with-retry.js +522 -0
- package/dist/utils/extract-zip.d.ts +22 -0
- package/dist/utils/extract-zip.js +103 -0
- package/dist/utils/retire-model-worker.d.ts +15 -0
- package/dist/utils/retire-model-worker.js +24 -0
- package/dist/utils/service-worker-entry.d.ts +59 -0
- package/dist/utils/service-worker-entry.js +69 -0
- package/dist/utils/xet-download.d.ts +40 -0
- package/dist/utils/xet-download.js +526 -0
- package/dist/utils/xet.d.ts +86 -0
- package/dist/utils/xet.js +201 -0
- package/package.json +103 -3
- package/scripts/embedding-packaging.cjs +264 -0
- package/scripts/embedding-packaging.d.cts +16 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
"""MTP speculative decoding for the batch engine — the sidecar-owned spec wave.
|
|
2
|
+
|
|
3
|
+
Measured basis (reports/mlx-mtp-rig-20260828.md, 2026-08-28): +34% decode
|
|
4
|
+
over the shipped config at both 11k and 73k context on qwen3.8-27b-q4,
|
|
5
|
+
greedy-exact on mlx-vlm 0.6.17 — and NOT exact on 0.6.6, which is why the
|
|
6
|
+
pin gate exists. Config-default block size (mtp layers + 2) measured
|
|
7
|
+
optimal; deeper drafting went net-negative. Upstream's own spec batch
|
|
8
|
+
honors per-sequence logits processors for the FIRST token only and then
|
|
9
|
+
silently drops them, so `eligibility` keeps processor-armed requests off
|
|
10
|
+
the spec path entirely until the processed verify walk ships.
|
|
11
|
+
|
|
12
|
+
"Sidecar-owned" means no upstream generator runs the wave: BatchEngine
|
|
13
|
+
admits one eligible sub, `chunked_prefill_steps` fills its (possibly
|
|
14
|
+
seeded) cache with direct language-tower calls, and upstream's serial
|
|
15
|
+
`_mtp_rounds` produces tokens. The engine keeps its own emit, liveness,
|
|
16
|
+
snapshot, cancellation, and save machinery, so a spec turn is
|
|
17
|
+
indistinguishable downstream from a batch turn. Only probeable mlx_vlm
|
|
18
|
+
surfaces are touched; every degrade logs one `[spec]` reason and falls
|
|
19
|
+
back to the normal path.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import os
|
|
25
|
+
from dataclasses import dataclass
|
|
26
|
+
from typing import Any, Callable, Iterator, List, Optional, Sequence, Tuple
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class SpecState:
|
|
31
|
+
drafter: Any
|
|
32
|
+
kind: str
|
|
33
|
+
block_size: Optional[int]
|
|
34
|
+
drafter_dir: str
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _off(log: Callable[[str], None], reason: str) -> None:
|
|
38
|
+
log(f"[spec] off ({reason})")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def resolve_spec(args, model, text_tower: Optional[str], log=print) -> Optional[SpecState]:
|
|
42
|
+
"""Boot-time capability probe. Every failure logs one `[spec] off`
|
|
43
|
+
line and degrades to no-speculation — never raises. Returns an armed
|
|
44
|
+
SpecState only when the drafter loads, validates against the target,
|
|
45
|
+
and the vlm tower's rollback surface is present."""
|
|
46
|
+
draft_dir = getattr(args, "spec_draft_model", None)
|
|
47
|
+
if not draft_dir:
|
|
48
|
+
return None
|
|
49
|
+
env = os.environ.get("GEZEL_MLX_SPEC", "").strip().lower()
|
|
50
|
+
if env in ("0", "off", "false"):
|
|
51
|
+
_off(log, "GEZEL_MLX_SPEC=off")
|
|
52
|
+
return None
|
|
53
|
+
if text_tower == "mlx_lm":
|
|
54
|
+
_off(
|
|
55
|
+
log,
|
|
56
|
+
"mlx_lm text tower active — MTP verify needs the vlm tower's "
|
|
57
|
+
"rollback_speculative_cache (drop GEZEL_MLX_TEXT_TOWER=force to enable spec)",
|
|
58
|
+
)
|
|
59
|
+
return None
|
|
60
|
+
if not os.path.isdir(str(draft_dir)):
|
|
61
|
+
_off(log, f"drafter dir not found: {draft_dir}")
|
|
62
|
+
return None
|
|
63
|
+
# 0.6.6's MTP verify is measured-INEXACT (greedy spec diverged from
|
|
64
|
+
# greedy nospec — reports/mlx-mtp-rig-20260828.md); exactness was
|
|
65
|
+
# proven on 0.6.17. A stale venv must never serve speculation.
|
|
66
|
+
try:
|
|
67
|
+
from importlib.metadata import version as _pkgver
|
|
68
|
+
|
|
69
|
+
ver = tuple(int(x) for x in _pkgver("mlx-vlm").split(".")[:3])
|
|
70
|
+
if ver < (0, 6, 17):
|
|
71
|
+
_off(log, f"mlx-vlm {'.'.join(map(str, ver))} < 0.6.17 — MTP verify inexact below the pin")
|
|
72
|
+
return None
|
|
73
|
+
except Exception as exc: # noqa: BLE001
|
|
74
|
+
_off(log, f"cannot determine mlx-vlm version: {exc}")
|
|
75
|
+
return None
|
|
76
|
+
lm = getattr(model, "language_model", model)
|
|
77
|
+
if not hasattr(lm, "rollback_speculative_cache"):
|
|
78
|
+
_off(log, f"language tower {type(lm).__name__} lacks rollback_speculative_cache")
|
|
79
|
+
return None
|
|
80
|
+
try:
|
|
81
|
+
from mlx_vlm.speculative import mtp as _mtp
|
|
82
|
+
from mlx_vlm.speculative.drafters import (
|
|
83
|
+
load_drafter,
|
|
84
|
+
validate_drafter_compatibility,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
for attr in (
|
|
88
|
+
"_mtp_rounds",
|
|
89
|
+
"_mtp_shared_kv_from_prompt_cache",
|
|
90
|
+
"_buffer_mtp_target_cache",
|
|
91
|
+
# assisted (sampled/processed) rounds drive these directly:
|
|
92
|
+
"_mtp_verify_target",
|
|
93
|
+
"_mtp_draft_hidden",
|
|
94
|
+
"_mtp_draft_position",
|
|
95
|
+
"_mtp_cache_offset_max",
|
|
96
|
+
"_mtp_next_block_size",
|
|
97
|
+
"_slice_shared_kv_after_reject",
|
|
98
|
+
):
|
|
99
|
+
if not hasattr(_mtp, attr):
|
|
100
|
+
_off(log, f"mlx_vlm.speculative.mtp lacks {attr}")
|
|
101
|
+
return None
|
|
102
|
+
except Exception as exc: # noqa: BLE001
|
|
103
|
+
_off(log, f"mlx_vlm speculative surface unavailable: {exc}")
|
|
104
|
+
return None
|
|
105
|
+
try:
|
|
106
|
+
drafter, kind = load_drafter(
|
|
107
|
+
str(draft_dir), getattr(args, "spec_draft_kind", None) or None
|
|
108
|
+
)
|
|
109
|
+
except Exception as exc: # noqa: BLE001
|
|
110
|
+
_off(log, f"drafter load failed: {exc}")
|
|
111
|
+
return None
|
|
112
|
+
if kind != "mtp":
|
|
113
|
+
_off(log, f"drafter kind {kind!r} — only mtp is wired")
|
|
114
|
+
return None
|
|
115
|
+
try:
|
|
116
|
+
validate_drafter_compatibility(model, drafter, kind)
|
|
117
|
+
except Exception as exc: # noqa: BLE001
|
|
118
|
+
_off(log, f"drafter incompatible with target: {exc}")
|
|
119
|
+
return None
|
|
120
|
+
if not install_chunked_draft_prefill(
|
|
121
|
+
drafter, int(getattr(args, "prefill_step_size", 0) or 0), log=log
|
|
122
|
+
):
|
|
123
|
+
log(
|
|
124
|
+
"[spec] drafter has no incremental prefill surface — long prompts "
|
|
125
|
+
f"(> {UNCHUNKED_DRAFT_PREFILL_LIMIT} tokens) will run without speculation"
|
|
126
|
+
)
|
|
127
|
+
block = getattr(args, "spec_block_size", None)
|
|
128
|
+
return SpecState(
|
|
129
|
+
drafter=drafter,
|
|
130
|
+
kind=kind,
|
|
131
|
+
block_size=int(block) if block else None,
|
|
132
|
+
drafter_dir=str(draft_dir),
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# ── Drafter prompt-prefill ──
|
|
137
|
+
#
|
|
138
|
+
# The drafter's `prefill_from_target_hidden` runs ONE forward over every
|
|
139
|
+
# prefilled position, so its attention mask is quadratic in prompt length
|
|
140
|
+
# while the target tower's own prefill is chunked (`chunked_prefill_steps`).
|
|
141
|
+
# At 61,523 tokens that asked Metal for 61523 * 61523 * 48 bytes = 181 GB and
|
|
142
|
+
# raised mid-turn on a healthy engine. Both round loops reach the drafter
|
|
143
|
+
# through the same `prefill_from_target_hidden` attribute — ours positionally,
|
|
144
|
+
# upstream `_mtp_rounds` via `sampler_rng.draft_call` — so wrapping it once on
|
|
145
|
+
# the instance covers every path.
|
|
146
|
+
#
|
|
147
|
+
# Chunking is exact, not an approximation: `_forward_tokens` appends to the
|
|
148
|
+
# drafter's own KV cache and advances `_next_position` by the chunk length,
|
|
149
|
+
# and `_position_ids` derives from `_next_position`, so N sliced calls build
|
|
150
|
+
# the identical cache one call would. Same argument the target tower's chunked
|
|
151
|
+
# prefill rests on.
|
|
152
|
+
DRAFT_PREFILL_STEP = int(os.environ.get("GEZEL_MLX_SPEC_DRAFT_STEP") or 2048)
|
|
153
|
+
|
|
154
|
+
# Ceiling for a drafter we could NOT wrap. Peak is `L^2 * bytes-per-(query,
|
|
155
|
+
# key) pair`; at the 48 B/pair measured on qwen3_5_mtp, 4096 tokens is
|
|
156
|
+
# ~800 MB — a transient allocation an engine can absorb. Above it we refuse
|
|
157
|
+
# the wave rather than gamble the whole engine on an unbounded allocation.
|
|
158
|
+
UNCHUNKED_DRAFT_PREFILL_LIMIT = int(
|
|
159
|
+
os.environ.get("GEZEL_MLX_SPEC_UNCHUNKED_LIMIT") or 4096
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def draft_prefill_chunks(total: int, step: int) -> List[Tuple[int, int]]:
|
|
164
|
+
"""`[start, end)` spans covering `total` positions, `step` at a time."""
|
|
165
|
+
if int(total) <= 0:
|
|
166
|
+
return []
|
|
167
|
+
size = int(step) if step and int(step) > 0 else DRAFT_PREFILL_STEP
|
|
168
|
+
return [(i, min(int(total), i + size)) for i in range(0, int(total), size)]
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def drafter_supports_chunked_prefill(drafter) -> bool:
|
|
172
|
+
"""Whether the drafter exposes the incremental surface chunking needs:
|
|
173
|
+
`_forward_tokens` (the per-call step that appends to the drafter's own
|
|
174
|
+
cache), `_set_seed_from_hidden` (plants the seed the first draft block
|
|
175
|
+
reads), and `_cache` (what we evaluate against between chunks). A family
|
|
176
|
+
missing any of them keeps the one-shot path and the length gate."""
|
|
177
|
+
return (
|
|
178
|
+
callable(getattr(drafter, "_forward_tokens", None))
|
|
179
|
+
and callable(getattr(drafter, "_set_seed_from_hidden", None))
|
|
180
|
+
and getattr(drafter, "_cache", None) is not None
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def install_chunked_draft_prefill(drafter, step: int = 0, log=print) -> bool:
|
|
185
|
+
"""Replace the drafter's one-shot prompt-prefill with a chunked one.
|
|
186
|
+
|
|
187
|
+
Bound to the instance, not the class: `resolve_spec` owns exactly one
|
|
188
|
+
drafter per process, and leaving other instances untouched keeps the
|
|
189
|
+
seam narrow. Idempotent — re-arming a resolved drafter is a no-op.
|
|
190
|
+
"""
|
|
191
|
+
if not drafter_supports_chunked_prefill(drafter):
|
|
192
|
+
return False
|
|
193
|
+
if not callable(getattr(drafter, "prefill_from_target_hidden", None)):
|
|
194
|
+
return False
|
|
195
|
+
if getattr(drafter, "_gezel_chunked_prefill", False):
|
|
196
|
+
return True
|
|
197
|
+
size = int(step) if step and int(step) > 0 else DRAFT_PREFILL_STEP
|
|
198
|
+
|
|
199
|
+
def chunked(
|
|
200
|
+
input_ids, hidden, bonus_token, sampler, token_dtype=None, greedy=False
|
|
201
|
+
) -> None:
|
|
202
|
+
import mlx.core as mx
|
|
203
|
+
|
|
204
|
+
dtype = token_dtype if token_dtype is not None else mx.int32
|
|
205
|
+
if int(input_ids.shape[1]) == 0:
|
|
206
|
+
return
|
|
207
|
+
if isinstance(bonus_token, int):
|
|
208
|
+
bonus = mx.array([[bonus_token]], dtype=dtype)
|
|
209
|
+
else:
|
|
210
|
+
bonus = bonus_token[:, None].astype(dtype)
|
|
211
|
+
# Upstream's alignment: the drafter predicts token t+1 from token
|
|
212
|
+
# t+1's embedding paired with the target hidden at t, so the token
|
|
213
|
+
# stream shifts left one and closes with the bonus token.
|
|
214
|
+
shifted = mx.concatenate([input_ids[:, 1:].astype(dtype), bonus], axis=1)
|
|
215
|
+
aligned = hidden[:, : shifted.shape[1], :]
|
|
216
|
+
drafter._next_position = 0
|
|
217
|
+
out = None
|
|
218
|
+
for start, end in draft_prefill_chunks(int(shifted.shape[1]), size):
|
|
219
|
+
out = drafter._forward_tokens(
|
|
220
|
+
shifted[:, start:end], aligned[:, start:end, :], dtype
|
|
221
|
+
)
|
|
222
|
+
# Evaluate against the drafter's cache each chunk. Holding the
|
|
223
|
+
# lazy graph across the whole prompt rebuilds the peak this
|
|
224
|
+
# chunking exists to remove.
|
|
225
|
+
mx.eval([c.state for c in drafter._cache], out)
|
|
226
|
+
if out is not None:
|
|
227
|
+
drafter._set_seed_from_hidden(out[:, -1:, :], sampler, greedy)
|
|
228
|
+
|
|
229
|
+
drafter.prefill_from_target_hidden = chunked
|
|
230
|
+
drafter._gezel_chunked_prefill = True
|
|
231
|
+
log(f"[spec] drafter prompt-prefill chunked at {size} tokens")
|
|
232
|
+
return True
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def draft_prefill_gate(spec: Optional[SpecState], prompt_len: int) -> Tuple[bool, str]:
|
|
236
|
+
"""Admission gate for a wave whose drafter prefill could not be wrapped.
|
|
237
|
+
|
|
238
|
+
Runs before the wave starts, because by the time `assisted_rounds` reaches
|
|
239
|
+
the drafter the target's prefill is already spent — refusing there would
|
|
240
|
+
throw that work away."""
|
|
241
|
+
if spec is None:
|
|
242
|
+
return True, ""
|
|
243
|
+
if getattr(spec.drafter, "_gezel_chunked_prefill", False):
|
|
244
|
+
return True, ""
|
|
245
|
+
if int(prompt_len) > UNCHUNKED_DRAFT_PREFILL_LIMIT:
|
|
246
|
+
return (
|
|
247
|
+
False,
|
|
248
|
+
f"drafter prompt-prefill is unchunked and this prompt is "
|
|
249
|
+
f"{int(prompt_len)} tokens (> {UNCHUNKED_DRAFT_PREFILL_LIMIT}) — "
|
|
250
|
+
f"its attention mask is quadratic in prompt length",
|
|
251
|
+
)
|
|
252
|
+
return True, ""
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def eligibility(request, grammar) -> Tuple[bool, str]:
|
|
256
|
+
"""v1 gate: greedy + processor-free requests only. Sampled acceptance
|
|
257
|
+
needs the positioned-sampler bridge, and processors under upstream
|
|
258
|
+
speculation fire once then vanish (measured) — for a tool grammar
|
|
259
|
+
that is worse than no grammar at all."""
|
|
260
|
+
t = getattr(request, "temperature", None)
|
|
261
|
+
if t not in (None, 0, 0.0):
|
|
262
|
+
return False, f"sampled (temperature={t})"
|
|
263
|
+
if grammar is not None:
|
|
264
|
+
return False, "logits processors present (tool grammar / think budget)"
|
|
265
|
+
if getattr(request, "repetition_penalty", None) is not None:
|
|
266
|
+
return False, "repetition_penalty set"
|
|
267
|
+
if getattr(request, "top_k", None):
|
|
268
|
+
return False, "top_k set"
|
|
269
|
+
return True, ""
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def cache_matches_tower(layers, tower) -> bool:
|
|
273
|
+
"""Seed-guard: a persisted entry with another tower's layer layout must
|
|
274
|
+
become a miss, not a crash deep inside a spec round."""
|
|
275
|
+
try:
|
|
276
|
+
expect = tower.make_cache()
|
|
277
|
+
except Exception: # noqa: BLE001
|
|
278
|
+
return False
|
|
279
|
+
if layers is None or len(layers) != len(expect):
|
|
280
|
+
return False
|
|
281
|
+
return all(
|
|
282
|
+
type(a).__name__ == type(b).__name__ for a, b in zip(layers, expect)
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def clone_layers(layers) -> List[Any]:
|
|
287
|
+
"""Reconstruct standalone cache layers from live ones via the
|
|
288
|
+
state/meta_state round-trip (the same contract cache_persist relies
|
|
289
|
+
on). MLX arrays are functionally immutable, so sharing buffers with
|
|
290
|
+
the live cache is safe — later writes rebind, never mutate."""
|
|
291
|
+
out = []
|
|
292
|
+
for c in layers:
|
|
293
|
+
out.append(type(c).from_state(c.state, c.meta_state))
|
|
294
|
+
return out
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def chunked_prefill_steps(
|
|
298
|
+
tower,
|
|
299
|
+
cache,
|
|
300
|
+
tokens: List[int],
|
|
301
|
+
step: int,
|
|
302
|
+
*,
|
|
303
|
+
cuts: Sequence[int] = (),
|
|
304
|
+
) -> Iterator[Tuple[str, int, int, Any]]:
|
|
305
|
+
"""Prefill `tokens` into `cache` with direct tower calls, one chunk per
|
|
306
|
+
yield so the async worker can breathe, emit liveness, and check
|
|
307
|
+
cancellation between chunks.
|
|
308
|
+
|
|
309
|
+
Each of `cuts` (indexes into `tokens`) forces a chunk edge so the caller
|
|
310
|
+
can capture a boundary snapshot from a quiescent cache. Yields
|
|
311
|
+
("cut"|"chunk", done, total, None) per chunk and finally
|
|
312
|
+
("final", n, n, bundle) where bundle carries the last chunk's logits,
|
|
313
|
+
the hidden states CONCATENATED across all chunks (the MTP drafter's
|
|
314
|
+
prompt-prefill needs hidden aligned with every prefilled token, and
|
|
315
|
+
the tower does not accumulate across cache-continued calls), and the
|
|
316
|
+
final shared_kv_states (empty-by-design on qwen3_5 — its drafter
|
|
317
|
+
builds its own KV from token+hidden pairs).
|
|
318
|
+
"""
|
|
319
|
+
import types as _types
|
|
320
|
+
|
|
321
|
+
import mlx.core as mx
|
|
322
|
+
|
|
323
|
+
n = len(tokens)
|
|
324
|
+
i = 0
|
|
325
|
+
out = None
|
|
326
|
+
hidden_parts: List[Any] = []
|
|
327
|
+
edges = {int(c) for c in cuts}
|
|
328
|
+
while i < n:
|
|
329
|
+
j = min(n, i + int(step or 2048))
|
|
330
|
+
j = min([c for c in edges if i < c < j] or [j])
|
|
331
|
+
last = j >= n
|
|
332
|
+
chunk = mx.array([tokens[i:j]])
|
|
333
|
+
out = tower(
|
|
334
|
+
chunk,
|
|
335
|
+
cache=cache,
|
|
336
|
+
skip_logits=not last,
|
|
337
|
+
return_hidden=True,
|
|
338
|
+
return_shared_kv=True,
|
|
339
|
+
)
|
|
340
|
+
part = out.hidden_states[-1]
|
|
341
|
+
hidden_parts.append(part)
|
|
342
|
+
# Evaluate hidden with the cache each chunk — holding lazy graphs
|
|
343
|
+
# across a 70k-token prefill is how peak memory runaways start.
|
|
344
|
+
if last:
|
|
345
|
+
mx.eval(out.logits, part)
|
|
346
|
+
else:
|
|
347
|
+
mx.eval([c.state for c in cache], part)
|
|
348
|
+
i = j
|
|
349
|
+
yield (
|
|
350
|
+
"cut" if i in edges else "chunk",
|
|
351
|
+
i,
|
|
352
|
+
n,
|
|
353
|
+
None,
|
|
354
|
+
)
|
|
355
|
+
hidden = (
|
|
356
|
+
hidden_parts[0]
|
|
357
|
+
if len(hidden_parts) == 1
|
|
358
|
+
else mx.concatenate(hidden_parts, axis=1)
|
|
359
|
+
)
|
|
360
|
+
bundle = _types.SimpleNamespace(
|
|
361
|
+
logits=out.logits,
|
|
362
|
+
hidden_states=[hidden],
|
|
363
|
+
shared_kv_states=getattr(out, "shared_kv_states", None) or {},
|
|
364
|
+
)
|
|
365
|
+
yield ("final", n, n, bundle)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def first_token_from(last_output) -> int:
|
|
369
|
+
import mlx.core as mx
|
|
370
|
+
|
|
371
|
+
return int(mx.argmax(last_output.logits[:, -1, :], axis=-1).item())
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
def make_rounds(
|
|
375
|
+
model,
|
|
376
|
+
spec: SpecState,
|
|
377
|
+
cache,
|
|
378
|
+
hidden_tokens: List[int],
|
|
379
|
+
last_output,
|
|
380
|
+
first_bonus: int,
|
|
381
|
+
max_tokens: int,
|
|
382
|
+
):
|
|
383
|
+
"""Build the serial MTP round generator over a prefilled cache — the
|
|
384
|
+
B==1 branch of upstream run_speculative_rounds, with one deliberate
|
|
385
|
+
difference: the caller's chunked prefill ran every chunk with the MTP
|
|
386
|
+
capture kwargs, so the final output's shared-kv covers the full
|
|
387
|
+
context."""
|
|
388
|
+
import mlx.core as mx
|
|
389
|
+
from mlx_vlm.speculative.mtp import (
|
|
390
|
+
_buffer_mtp_target_cache,
|
|
391
|
+
_mtp_rounds,
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
# shared_kv_states comes from the final prefill chunk: with the MTP
|
|
395
|
+
# capture kwargs on every chunk (see chunked_prefill_steps) the tower
|
|
396
|
+
# accumulates it across chunks, so the last output covers the full
|
|
397
|
+
# context. (_mtp_shared_kv_from_prompt_cache is NOT usable here — it
|
|
398
|
+
# keys on layer.layer_type, which qwen3_5 decoder layers don't expose.)
|
|
399
|
+
shared_kv = last_output.shared_kv_states
|
|
400
|
+
hidden = last_output.hidden_states[-1]
|
|
401
|
+
# No-op for the qwen3_5 stack (only Rotating caches get wrapped); kept
|
|
402
|
+
# for parity with upstream's round setup so other archs stay correct.
|
|
403
|
+
_buffer_mtp_target_cache(cache, spec.drafter, spec.block_size)
|
|
404
|
+
# The tokens whose target hidden the caller actually computed — the
|
|
405
|
+
# newly-prefilled span. On a fresh prefill that is the whole prompt
|
|
406
|
+
# (upstream parity); on a seeded resume the drafter's own context
|
|
407
|
+
# covers just the tail, which can cost acceptance, never correctness
|
|
408
|
+
# (the full-context target verify decides every token).
|
|
409
|
+
prompt_ids = mx.array([[int(t) for t in hidden_tokens]])
|
|
410
|
+
|
|
411
|
+
def _greedy(logprobs):
|
|
412
|
+
return mx.argmax(logprobs, axis=-1)
|
|
413
|
+
|
|
414
|
+
return _mtp_rounds(
|
|
415
|
+
model,
|
|
416
|
+
spec.drafter,
|
|
417
|
+
cache,
|
|
418
|
+
hidden,
|
|
419
|
+
shared_kv,
|
|
420
|
+
prompt_tokens=prompt_ids,
|
|
421
|
+
first_bonus=int(first_bonus),
|
|
422
|
+
max_tokens=int(max_tokens),
|
|
423
|
+
sampler=_greedy,
|
|
424
|
+
draft_block_size=spec.block_size,
|
|
425
|
+
token_dtype=prompt_ids.dtype,
|
|
426
|
+
greedy_sampling=True,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def stats_line(spec: SpecState) -> Optional[str]:
|
|
431
|
+
"""Per-wave acceptance telemetry (drafter counters reset per wave by
|
|
432
|
+
upstream's round setup). An A/B arm without this line is retracted."""
|
|
433
|
+
try:
|
|
434
|
+
from mlx_vlm.speculative.utils import format_speculative_stats
|
|
435
|
+
|
|
436
|
+
return format_speculative_stats(spec.drafter)
|
|
437
|
+
except Exception: # noqa: BLE001
|
|
438
|
+
return None
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def spec_mode(request, grammar) -> Tuple[Optional[str], str]:
|
|
442
|
+
"""Which spec route serves this request.
|
|
443
|
+
|
|
444
|
+
"greedy" — temp 0/unset, no processors: the C1 path, proven exact
|
|
445
|
+
against plain greedy decode.
|
|
446
|
+
"assisted" — everything else: positioned target sampling (temperature/
|
|
447
|
+
top_p/top_k, deterministic per-(seed,position) keys) and/or
|
|
448
|
+
the processed sequential walk, where every emitted token is
|
|
449
|
+
a draw from the PROCESSED target distribution — lossless by
|
|
450
|
+
construction, so grammar and think-budget ride speculation.
|
|
451
|
+
None — operator restricted (`GEZEL_MLX_SPEC=greedy-only`).
|
|
452
|
+
|
|
453
|
+
Gate-C measured why "assisted" exists: gezel's tuned profiles sample at
|
|
454
|
+
temp 0.6–1.0 with top_k 20–40 on every profile, so a greedy-only gate
|
|
455
|
+
reaches ~0% of product traffic.
|
|
456
|
+
"""
|
|
457
|
+
if bool(getattr(request, "disable_speculation", False)):
|
|
458
|
+
return None, "request disabled speculative decoding after a grammar-contract violation"
|
|
459
|
+
|
|
460
|
+
t = getattr(request, "temperature", None)
|
|
461
|
+
greedy = t in (None, 0, 0.0)
|
|
462
|
+
has_procs = (
|
|
463
|
+
grammar is not None
|
|
464
|
+
or getattr(request, "repetition_penalty", None) is not None
|
|
465
|
+
)
|
|
466
|
+
if greedy and not has_procs:
|
|
467
|
+
return "greedy", ""
|
|
468
|
+
env = os.environ.get("GEZEL_MLX_SPEC", "").strip().lower()
|
|
469
|
+
if env == "greedy-only":
|
|
470
|
+
why = "processor-armed" if has_procs else f"sampled (temperature={t})"
|
|
471
|
+
return None, f"GEZEL_MLX_SPEC=greedy-only and request is {why}"
|
|
472
|
+
return "assisted", ""
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
class PositionedSampler:
|
|
476
|
+
"""Target sampler with stateless draws keyed by (seed, row, position).
|
|
477
|
+
|
|
478
|
+
Same protocol as upstream's `_PositionedTargetSampler` (`sample_target`
|
|
479
|
+
+ plain `__call__`), extended with top_k — which upstream lacks and
|
|
480
|
+
every gezel tuning profile sets (20–40). Deterministic given the seed:
|
|
481
|
+
replaying a wave with the same seed reproduces it token-for-token,
|
|
482
|
+
which is what makes sampled A/Bs and incident replays possible.
|
|
483
|
+
"""
|
|
484
|
+
|
|
485
|
+
def __init__(self, *, temperature: float, top_p: float = 0.0,
|
|
486
|
+
top_k: int = 0, seed: int = 0):
|
|
487
|
+
self.temperature = max(float(temperature), 1e-6)
|
|
488
|
+
self.top_p = float(top_p or 0.0)
|
|
489
|
+
self.top_k = int(top_k or 0)
|
|
490
|
+
self.seed = int(seed)
|
|
491
|
+
|
|
492
|
+
def _filtered(self, logprobs):
|
|
493
|
+
import mlx.core as mx
|
|
494
|
+
|
|
495
|
+
lp = logprobs.astype(mx.float32) if logprobs.dtype != mx.float32 else logprobs
|
|
496
|
+
if self.top_k > 0 and self.top_k < lp.shape[-1]:
|
|
497
|
+
kth = mx.sort(lp, axis=-1)[..., -self.top_k : -self.top_k + 1]
|
|
498
|
+
lp = mx.where(lp < kth, mx.array(-float("inf")), lp)
|
|
499
|
+
if 0.0 < self.top_p < 1.0:
|
|
500
|
+
probs = mx.softmax(lp / self.temperature, axis=-1)
|
|
501
|
+
order = mx.argsort(probs, axis=-1)
|
|
502
|
+
sorted_probs = mx.take_along_axis(probs, order, axis=-1)
|
|
503
|
+
cum = mx.cumsum(sorted_probs, axis=-1)
|
|
504
|
+
keep_sorted = cum > (1.0 - self.top_p)
|
|
505
|
+
keep = mx.zeros_like(keep_sorted)
|
|
506
|
+
keep = mx.put_along_axis(keep, order, keep_sorted, axis=-1)
|
|
507
|
+
lp = mx.where(keep, lp, mx.array(-float("inf")))
|
|
508
|
+
return lp
|
|
509
|
+
|
|
510
|
+
def _key(self, row: int, position: int):
|
|
511
|
+
import mlx.core as mx
|
|
512
|
+
|
|
513
|
+
mixed = (
|
|
514
|
+
(self.seed * 0x9E3779B97F4A7C15)
|
|
515
|
+
^ ((int(row) + 1) * 0xBF58476D1CE4E5B9)
|
|
516
|
+
^ ((int(position) + 1) * 0x94D049BB133111EB)
|
|
517
|
+
) & 0x7FFFFFFFFFFFFFFF
|
|
518
|
+
return mx.random.key(mixed)
|
|
519
|
+
|
|
520
|
+
def sample_target(self, logprobs, *, row_ids, positions):
|
|
521
|
+
import mlx.core as mx
|
|
522
|
+
|
|
523
|
+
if logprobs.shape[0] != len(row_ids) or len(row_ids) != len(positions):
|
|
524
|
+
raise ValueError("row_ids and positions must match logprobs batch size.")
|
|
525
|
+
lp = self._filtered(logprobs)
|
|
526
|
+
outs = [
|
|
527
|
+
mx.random.categorical(lp[i : i + 1] / self.temperature, key=self._key(r, pos))
|
|
528
|
+
for i, (r, pos) in enumerate(zip(row_ids, positions))
|
|
529
|
+
]
|
|
530
|
+
return mx.concatenate(outs, axis=0)
|
|
531
|
+
|
|
532
|
+
def __call__(self, logprobs):
|
|
533
|
+
import mlx.core as mx
|
|
534
|
+
|
|
535
|
+
return mx.random.categorical(self._filtered(logprobs) / self.temperature)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def _argmax(logprobs):
|
|
539
|
+
import mlx.core as mx
|
|
540
|
+
|
|
541
|
+
return mx.argmax(logprobs, axis=-1)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
def processed_first_token(last_output, sampler, processors, context_tokens) -> int:
|
|
545
|
+
"""First token of an assisted wave: processors then a positioned draw
|
|
546
|
+
(or argmax) over the final prefill logits — the same treatment every
|
|
547
|
+
subsequent token gets, so the grammar FSM sees position 0 too."""
|
|
548
|
+
import mlx.core as mx
|
|
549
|
+
|
|
550
|
+
logits = last_output.logits[:, -1, :]
|
|
551
|
+
if processors:
|
|
552
|
+
ctx = mx.array([int(t) for t in context_tokens])
|
|
553
|
+
for proc in processors:
|
|
554
|
+
logits = proc(ctx, logits)
|
|
555
|
+
logprobs = logits - mx.logsumexp(logits, axis=-1, keepdims=True)
|
|
556
|
+
if sampler is not None:
|
|
557
|
+
tok = sampler.sample_target(logprobs, row_ids=[0], positions=[0])
|
|
558
|
+
else:
|
|
559
|
+
tok = _argmax(logprobs)
|
|
560
|
+
return int(tok.reshape(-1).item())
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
def processed_walk(lm, target_hidden, draft_tokens, sampler, processors,
|
|
564
|
+
history, budget: int, base_position: int):
|
|
565
|
+
"""Sequential per-position acceptance walk with logits processors.
|
|
566
|
+
|
|
567
|
+
Mirrors upstream `_speculative_walk_deferred_greedy` and adds the one
|
|
568
|
+
thing it lacks: each position's target logits pass through the
|
|
569
|
+
request's processor list with the token history ending at the
|
|
570
|
+
previously emitted token — so a grammar FSM consumes tokens exactly
|
|
571
|
+
once, in order, and positions past a rejection are never processed.
|
|
572
|
+
Every emitted token is a draw from the processed target distribution.
|
|
573
|
+
`history` is mutated in place as tokens are emitted.
|
|
574
|
+
"""
|
|
575
|
+
import mlx.core as mx
|
|
576
|
+
|
|
577
|
+
n_draft = draft_tokens.shape[1]
|
|
578
|
+
draft_list = [int(x) for x in draft_tokens.reshape(-1).tolist()]
|
|
579
|
+
accepted = 0
|
|
580
|
+
new_tokens: List[int] = []
|
|
581
|
+
|
|
582
|
+
for pos in range(n_draft + 1):
|
|
583
|
+
logits = lm.speculative_logits_from_hidden(target_hidden[:, pos : pos + 1, :])
|
|
584
|
+
if logits.ndim == 3 and logits.shape[1] == 1:
|
|
585
|
+
logits = logits[:, 0, :]
|
|
586
|
+
if processors:
|
|
587
|
+
ctx = mx.array(history)
|
|
588
|
+
for proc in processors:
|
|
589
|
+
logits = proc(ctx, logits)
|
|
590
|
+
logprobs = logits - mx.logsumexp(logits, axis=-1, keepdims=True)
|
|
591
|
+
if sampler is not None:
|
|
592
|
+
tok_arr = sampler.sample_target(
|
|
593
|
+
logprobs, row_ids=[0], positions=[int(base_position) + pos]
|
|
594
|
+
)
|
|
595
|
+
else:
|
|
596
|
+
tok_arr = _argmax(logprobs)
|
|
597
|
+
token = int(tok_arr.reshape(-1).item())
|
|
598
|
+
|
|
599
|
+
if pos < n_draft and token == draft_list[pos]:
|
|
600
|
+
accepted += 1
|
|
601
|
+
if len(new_tokens) < budget:
|
|
602
|
+
new_tokens.append(token)
|
|
603
|
+
history.append(token)
|
|
604
|
+
continue
|
|
605
|
+
|
|
606
|
+
if len(new_tokens) < budget:
|
|
607
|
+
new_tokens.append(token)
|
|
608
|
+
history.append(token)
|
|
609
|
+
break
|
|
610
|
+
|
|
611
|
+
return accepted, new_tokens
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
def commit_verify_round(verify, lm, cache, accepted: int, block_size: int) -> None:
|
|
615
|
+
"""Commit one target-verification transaction across mlx-vlm releases.
|
|
616
|
+
|
|
617
|
+
mlx-vlm 0.7.1 replaced the public-ish ``gdn_states`` result field plus
|
|
618
|
+
direct ``rollback_speculative_cache`` call with a transaction-owned
|
|
619
|
+
``verify.commit(...)`` method. The latter must run on every round, not
|
|
620
|
+
only a rejection: Qwen4's sparse-attention verifier uses it to finalize
|
|
621
|
+
the target cache even when every draft token was accepted. Keep the
|
|
622
|
+
legacy branch for operator-provided runtimes on the 0.6.17 line.
|
|
623
|
+
"""
|
|
624
|
+
commit = getattr(verify, "commit", None)
|
|
625
|
+
if callable(commit):
|
|
626
|
+
commit(lm, cache, accepted, block_size)
|
|
627
|
+
return
|
|
628
|
+
|
|
629
|
+
rollback = getattr(lm, "rollback_speculative_cache", None)
|
|
630
|
+
if accepted < block_size - 1 and callable(rollback):
|
|
631
|
+
rollback(cache, getattr(verify, "gdn_states", None), accepted, block_size)
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
def abort_verify_round(verify) -> None:
|
|
635
|
+
"""Abort a 0.7.1 verification transaction after a contained round error."""
|
|
636
|
+
abort = getattr(verify, "abort", None)
|
|
637
|
+
if callable(abort):
|
|
638
|
+
abort()
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
def assisted_rounds(model, spec: SpecState, cache, hidden_tokens: List[int],
|
|
642
|
+
last_output, first_bonus: int, max_tokens: int, *,
|
|
643
|
+
sampler, processors, history):
|
|
644
|
+
"""Sampled/processed MTP round loop — upstream `_mtp_rounds`' exact
|
|
645
|
+
structure (draft → verify → walk → bookkeeping → rollback → shared-kv
|
|
646
|
+
slide) with two substitutions: the acceptance walk is the processed
|
|
647
|
+
sequential walk above, and verify never pre-samples target tokens
|
|
648
|
+
(`sample_target_tokens=False`) so the walk owns every draw. The RNG
|
|
649
|
+
shuffle upstream does for un-positioned samplers is unnecessary here —
|
|
650
|
+
drafting is greedy (deterministic) and target draws are positioned.
|
|
651
|
+
`history` must already include the emitted first bonus.
|
|
652
|
+
"""
|
|
653
|
+
import mlx.core as mx
|
|
654
|
+
from mlx_vlm.speculative.common import _record_speculative_round
|
|
655
|
+
from mlx_vlm.speculative.dflash import _dflash_block_total
|
|
656
|
+
from mlx_vlm.speculative.mtp import (
|
|
657
|
+
_buffer_mtp_target_cache,
|
|
658
|
+
_mtp_cache_offset_max,
|
|
659
|
+
_mtp_draft_hidden,
|
|
660
|
+
_mtp_draft_position,
|
|
661
|
+
_mtp_next_block_size,
|
|
662
|
+
_mtp_verify_target,
|
|
663
|
+
_slice_shared_kv_after_reject,
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
drafter = spec.drafter
|
|
667
|
+
lm = getattr(model, "language_model", model)
|
|
668
|
+
hidden = last_output.hidden_states[-1]
|
|
669
|
+
shared_kv = getattr(last_output, "shared_kv_states", None) or {}
|
|
670
|
+
_buffer_mtp_target_cache(cache, drafter, spec.block_size)
|
|
671
|
+
prompt_ids = mx.array([[int(t) for t in hidden_tokens]])
|
|
672
|
+
token_dtype = prompt_ids.dtype
|
|
673
|
+
draw = sampler if sampler is not None else _argmax
|
|
674
|
+
|
|
675
|
+
block_total = _dflash_block_total(drafter, spec.block_size)
|
|
676
|
+
configured_block_total = int(getattr(drafter.config, "block_size", block_total))
|
|
677
|
+
drafter.reset(model)
|
|
678
|
+
draft_kwargs = (
|
|
679
|
+
{"greedy": True}
|
|
680
|
+
if getattr(drafter, "supports_greedy_draft_argmax", False)
|
|
681
|
+
else {}
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
prefill_draft = getattr(drafter, "prefill_from_target_hidden", None)
|
|
685
|
+
if callable(prefill_draft):
|
|
686
|
+
prefill_draft(prompt_ids, hidden, int(first_bonus), draw, token_dtype, **draft_kwargs)
|
|
687
|
+
|
|
688
|
+
if hidden.shape[1] > 1:
|
|
689
|
+
hidden = hidden[:, -1:, :]
|
|
690
|
+
hidden = _mtp_draft_hidden(lm, hidden)
|
|
691
|
+
|
|
692
|
+
kv_offset = _mtp_cache_offset_max(cache)
|
|
693
|
+
drafter.set_shared_kv(
|
|
694
|
+
shared_kv, kv_offset, position=_mtp_draft_position(kv_offset), kv_valid_len=kv_offset
|
|
695
|
+
)
|
|
696
|
+
|
|
697
|
+
b = int(first_bonus)
|
|
698
|
+
emitted = 1
|
|
699
|
+
while emitted < max_tokens:
|
|
700
|
+
bs = _mtp_next_block_size(
|
|
701
|
+
drafter, block_total, configured_block_total, max_tokens - emitted + 1
|
|
702
|
+
)
|
|
703
|
+
if bs <= 1:
|
|
704
|
+
break
|
|
705
|
+
|
|
706
|
+
verify = None
|
|
707
|
+
try:
|
|
708
|
+
draft_tokens = drafter.draft_block(
|
|
709
|
+
b, hidden, None, bs, draw, token_dtype, **draft_kwargs
|
|
710
|
+
)
|
|
711
|
+
mx.async_eval(draft_tokens)
|
|
712
|
+
|
|
713
|
+
verify_input = mx.concatenate(
|
|
714
|
+
[mx.array([[b]], dtype=token_dtype), draft_tokens], axis=1
|
|
715
|
+
)
|
|
716
|
+
verify = _mtp_verify_target(
|
|
717
|
+
lm, verify_input, cache, draw, sample_target_tokens=False
|
|
718
|
+
)
|
|
719
|
+
accepted, new_tokens = processed_walk(
|
|
720
|
+
lm,
|
|
721
|
+
verify.hidden,
|
|
722
|
+
draft_tokens,
|
|
723
|
+
sampler,
|
|
724
|
+
processors,
|
|
725
|
+
history,
|
|
726
|
+
max_tokens - emitted,
|
|
727
|
+
base_position=emitted,
|
|
728
|
+
)
|
|
729
|
+
_record_speculative_round(drafter, accepted, bs - 1)
|
|
730
|
+
|
|
731
|
+
accept_verified = getattr(drafter, "accept_verified_tokens", None)
|
|
732
|
+
if callable(accept_verified):
|
|
733
|
+
accept_verified(
|
|
734
|
+
verify.hidden,
|
|
735
|
+
draft_tokens,
|
|
736
|
+
accepted,
|
|
737
|
+
new_tokens,
|
|
738
|
+
draw,
|
|
739
|
+
token_dtype,
|
|
740
|
+
**draft_kwargs,
|
|
741
|
+
)
|
|
742
|
+
|
|
743
|
+
# Commit before exposing tokens to the stream: a failed commit
|
|
744
|
+
# must not leave the client with output backed by a dirty cache.
|
|
745
|
+
commit_verify_round(verify, lm, cache, accepted, bs)
|
|
746
|
+
except BaseException:
|
|
747
|
+
if verify is not None:
|
|
748
|
+
abort_verify_round(verify)
|
|
749
|
+
abort_draft = getattr(drafter, "abort_draft_round", None)
|
|
750
|
+
if callable(abort_draft):
|
|
751
|
+
abort_draft()
|
|
752
|
+
raise
|
|
753
|
+
|
|
754
|
+
budget_hit = False
|
|
755
|
+
for tok in new_tokens:
|
|
756
|
+
yield tok, None
|
|
757
|
+
emitted += 1
|
|
758
|
+
if emitted >= max_tokens:
|
|
759
|
+
budget_hit = True
|
|
760
|
+
break
|
|
761
|
+
|
|
762
|
+
hidden = _mtp_draft_hidden(lm, verify.hidden[:, accepted : accepted + 1, :])
|
|
763
|
+
b = new_tokens[-1] if new_tokens else b
|
|
764
|
+
|
|
765
|
+
shared_kv = _slice_shared_kv_after_reject(
|
|
766
|
+
verify.shared_kv_states, bs - (accepted + 1)
|
|
767
|
+
)
|
|
768
|
+
kv_offset += accepted + 1
|
|
769
|
+
drafter.set_shared_kv(
|
|
770
|
+
shared_kv, kv_offset, position=_mtp_draft_position(kv_offset), kv_valid_len=kv_offset
|
|
771
|
+
)
|
|
772
|
+
if budget_hit:
|
|
773
|
+
return
|
|
774
|
+
if emitted % 256 == 0:
|
|
775
|
+
mx.clear_cache()
|