@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,794 @@
|
|
|
1
|
+
"""tool_grammar — decode-time tool-call grammar for the gezel MLX server.
|
|
2
|
+
|
|
3
|
+
Why this exists: the MLX engine does no server-side tool parsing, so a
|
|
4
|
+
quantized model that mangles the tool-call format (classically: a
|
|
5
|
+
*parameter* name emitted as the *function* name) sails straight into the
|
|
6
|
+
gezel TS salvage layer, which rejects it as malformed/unknown — and the
|
|
7
|
+
model apologizes and retries the same bad call, making no progress.
|
|
8
|
+
llama.cpp avoids this because `--jinja` makes it derive a grammar from the
|
|
9
|
+
chat template and constrain sampling; we do the same here with llguidance
|
|
10
|
+
(already a transitive mlx-vlm dependency, and the same backend
|
|
11
|
+
`mlx_vlm.structured` uses for `response_format`).
|
|
12
|
+
|
|
13
|
+
The Hermes tier constrains the function name, parameter keys, and required-key
|
|
14
|
+
presence. The model may emit optional parameters anywhere and (for ordinary
|
|
15
|
+
schemas) required parameters in any order, but it cannot close a call before
|
|
16
|
+
every required top-level key has appeared. Values stay shallow so this does
|
|
17
|
+
not recreate the recursive-schema / ParserTooComplex failures that motivated
|
|
18
|
+
the original name-only grammar.
|
|
19
|
+
|
|
20
|
+
Special-token reality (verified against the installed Qwen 3.6 and 3.8 tokenizers):
|
|
21
|
+
`<think>`, `</think>`, `<tool_call>`, `</tool_call>` are each a SINGLE
|
|
22
|
+
special token, while `<function=` / `<parameter=` are ordinary multi-token
|
|
23
|
+
text. llguidance regex lexemes (`/(.|\n)*/`) match only text bytes and
|
|
24
|
+
stop at special-token atoms — so we list the special tokens the model
|
|
25
|
+
legitimately emits as grammar terminals (`<token_name>` syntax) and let
|
|
26
|
+
free text flow between them. The name right after `<function=` is pinned to
|
|
27
|
+
the known-tool enum; the model can also end the turn with no call at all.
|
|
28
|
+
|
|
29
|
+
Kept as a sibling module (like cache_persist) so it imports only
|
|
30
|
+
llguidance — the pure grammar builder is unit-testable without loading
|
|
31
|
+
mlx-vlm or a model (string-level); token-level accept/reject is proven by
|
|
32
|
+
tool_grammar_modeltest.py against a real tokenizer.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from __future__ import annotations
|
|
36
|
+
|
|
37
|
+
import json
|
|
38
|
+
import re
|
|
39
|
+
from typing import Any, Dict, List, Optional
|
|
40
|
+
|
|
41
|
+
# Tool-call grammar formats this module can build. Only formats verified at
|
|
42
|
+
# the token level against a real tokenizer live here (tool_grammar_modeltest.py).
|
|
43
|
+
# `hermes` covers Qwen 3.5/3.6/3.8 + the Hermes nesting
|
|
44
|
+
# (`<tool_call>\n<function=NAME>...`).
|
|
45
|
+
# `gemma` covers Gemma 4's native special-token call
|
|
46
|
+
# (`<|tool_call>call:NAME{key:<|"|>val<|"|>}<tool_call|>`).
|
|
47
|
+
# `glm` covers GLM-4.5/4.6 (`<tool_call>NAME<arg_key>K</arg_key><arg_value>V</arg_value></tool_call>`).
|
|
48
|
+
SUPPORTED_FORMATS = frozenset({"hermes", "gemma", "glm"})
|
|
49
|
+
|
|
50
|
+
_LLG_TOKENIZER_CACHE: Dict[int, Any] = {}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _resolve_hf_tokenizer(tokenizer: Any) -> Any:
|
|
54
|
+
"""Unwrap mlx-lm's TokenizerWrapper for llguidance.
|
|
55
|
+
|
|
56
|
+
The fast text-tower path exposes a ``TokenizerWrapper`` whose own
|
|
57
|
+
``is_fast`` flag is true, but ``llguidance.hf.from_tokenizer`` only accepts
|
|
58
|
+
the underlying Hugging Face tokenizer. Hugging Face fast tokenizers also
|
|
59
|
+
have an ``_tokenizer`` attribute, but that object is a low-level
|
|
60
|
+
``tokenizers.Tokenizer`` without ``is_fast``; requiring the inner object to
|
|
61
|
+
advertise ``is_fast`` therefore unwraps mlx-lm without over-unwrapping an
|
|
62
|
+
ordinary Transformers tokenizer.
|
|
63
|
+
"""
|
|
64
|
+
inner = getattr(tokenizer, "_tokenizer", None)
|
|
65
|
+
return inner if getattr(inner, "is_fast", False) else tokenizer
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _get_llg_tokenizer(tokenizer: Any) -> Any:
|
|
69
|
+
"""Build (and cache) an llguidance tokenizer for a HF tokenizer.
|
|
70
|
+
|
|
71
|
+
Walking the vocab to build the llguidance tokenizer costs ~1.5s on a
|
|
72
|
+
150k-token model, so we keep it for the process lifetime — the same
|
|
73
|
+
trick mlx_vlm.structured uses. Keyed by id() since the tokenizer is a
|
|
74
|
+
singleton held by the loaded model.
|
|
75
|
+
"""
|
|
76
|
+
tokenizer = _resolve_hf_tokenizer(tokenizer)
|
|
77
|
+
cached = _LLG_TOKENIZER_CACHE.get(id(tokenizer))
|
|
78
|
+
if cached is not None:
|
|
79
|
+
return cached
|
|
80
|
+
import llguidance.hf
|
|
81
|
+
|
|
82
|
+
llg_tok = llguidance.hf.from_tokenizer(tokenizer)
|
|
83
|
+
_LLG_TOKENIZER_CACHE[id(tokenizer)] = llg_tok
|
|
84
|
+
return llg_tok
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class SafeToolGrammarProcessor:
|
|
88
|
+
"""Wrap an llguidance logits processor so a matcher fault degrades to
|
|
89
|
+
unconstrained decoding instead of killing the turn.
|
|
90
|
+
|
|
91
|
+
llguidance's LLGuidanceLogitsProcessor raises when its matcher hits an
|
|
92
|
+
error state (e.g. ParserTooComplex, or an internal inconsistency). If
|
|
93
|
+
that propagated out of the `stream_generate` loop it would 500 the
|
|
94
|
+
whole turn. Instead we catch it, stop constraining for the remainder
|
|
95
|
+
of this turn, and let the model finish unconstrained — the gezel TS
|
|
96
|
+
salvage layer is still there as the post-hoc safety net.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
def __init__(self, inner: Any) -> None:
|
|
100
|
+
self._inner = inner
|
|
101
|
+
self.disabled = False
|
|
102
|
+
|
|
103
|
+
def __call__(self, input_ids: Any, logits: Any) -> Any:
|
|
104
|
+
if self.disabled:
|
|
105
|
+
return logits
|
|
106
|
+
try:
|
|
107
|
+
return self._inner(input_ids, logits)
|
|
108
|
+
except Exception as exc: # noqa: BLE001 - defensive: any matcher fault
|
|
109
|
+
print(
|
|
110
|
+
f"[tool-grammar] matcher error; disabling grammar for the rest of "
|
|
111
|
+
f"this turn (falling back to unconstrained + TS salvage): {exc}",
|
|
112
|
+
flush=True,
|
|
113
|
+
)
|
|
114
|
+
self.disabled = True
|
|
115
|
+
return logits
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def tool_name_alternation(tool_names: List[str]) -> str:
|
|
119
|
+
"""Regex alternation of the known tool names, escaped, longest-first.
|
|
120
|
+
|
|
121
|
+
Longest-first so a name that is a prefix of another (`list` vs
|
|
122
|
+
`list_projects`) can't shadow the longer match in the lexer.
|
|
123
|
+
"""
|
|
124
|
+
ordered = sorted({n for n in tool_names if n}, key=len, reverse=True)
|
|
125
|
+
return "|".join(re.escape(n) for n in ordered)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# Shared preamble for both Hermes tiers. `<think>`/`</think>`/`<tool_call>`/
|
|
129
|
+
# `</tool_call>` are single special tokens (listed as terminals); the
|
|
130
|
+
# free-text regex matches only ordinary bytes and stops at them. `start:
|
|
131
|
+
# (seg)*` is accepting at any point, so the model may end the turn with no
|
|
132
|
+
# call at all.
|
|
133
|
+
_HERMES_HEAD = (
|
|
134
|
+
"%llguidance {}\n"
|
|
135
|
+
"start: (seg)*\n"
|
|
136
|
+
"seg: TEXT | <think> | </think> | tool_call\n"
|
|
137
|
+
"TEXT: /(.|\\n)*/\n"
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _hermes_name_only(alts: str, json_branch: str = "") -> str:
|
|
142
|
+
"""Tier 1 — constrain only the function name (arguments fully free).
|
|
143
|
+
|
|
144
|
+
`<tool_call>\\n<function=NAME>\\n…\\n</tool_call>` with NAME pinned to the
|
|
145
|
+
known-tool enum; everything after the name is free.
|
|
146
|
+
|
|
147
|
+
Note that tier 1 still pins the `<function=` wrapper, so it does NOT
|
|
148
|
+
on its own let a model reach for the JSON envelope — dropping from
|
|
149
|
+
tier 2 to tier 1 is not a fix for unrepresentable nested arguments.
|
|
150
|
+
That is what the constrained `json_branch` is for.
|
|
151
|
+
"""
|
|
152
|
+
if json_branch:
|
|
153
|
+
return (
|
|
154
|
+
_HERMES_HEAD
|
|
155
|
+
+ "tool_call: <tool_call> (hermes_call | json_call) </tool_call>\n"
|
|
156
|
+
+ "hermes_call: PRE NAME POST\n"
|
|
157
|
+
+ f"NAME: /({alts})/\n"
|
|
158
|
+
+ "PRE: /\\s*<function=/\n"
|
|
159
|
+
+ "POST: /(.|\\n)*/\n"
|
|
160
|
+
+ json_branch
|
|
161
|
+
)
|
|
162
|
+
return (
|
|
163
|
+
_HERMES_HEAD
|
|
164
|
+
+ "tool_call: <tool_call> PRE NAME POST </tool_call>\n"
|
|
165
|
+
+ f"NAME: /({alts})/\n"
|
|
166
|
+
+ "PRE: /\\s*<function=/\n"
|
|
167
|
+
+ "POST: /(.|\\n)*/\n"
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
# Gemma 4 emits tool calls as `<|tool_call>call:NAME{key:<|"|>val<|"|>,...}<tool_call|>`.
|
|
172
|
+
# `<|tool_call>` (id 48), `<tool_call|>` (49) and the string-value delimiter
|
|
173
|
+
# `<|"|>` (52) are each a SINGLE special token (verified against the installed
|
|
174
|
+
# Gemma 4 tokenizers in tool_grammar_modeltest.py). The reasoning/turn tokens
|
|
175
|
+
# Gemma can also emit in output — `<|think|>`, `<|channel>`/`<channel|>`,
|
|
176
|
+
# `<|turn>`/`<turn|>` — plus the tool framing tokens are all listed as terminals
|
|
177
|
+
# in `seg`, so the grammar constrains ONLY the call name and never blocks
|
|
178
|
+
# legitimate reasoning. Inside a call, free text and the `<|"|>` delimiter flow
|
|
179
|
+
# freely, so a string value can carry newlines / braces / quotes.
|
|
180
|
+
_GEMMA_HEAD = (
|
|
181
|
+
"%llguidance {}\n"
|
|
182
|
+
"start: (seg)*\n"
|
|
183
|
+
"seg: TEXT | <|tool> | <tool|> | <|tool_response> | <tool_response|>"
|
|
184
|
+
" | <|think|> | <|channel> | <channel|> | <|turn> | <turn|> | tool_call\n"
|
|
185
|
+
"TEXT: /(.|\\n)*/\n"
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def _gemma_name_only(alts: str) -> str:
|
|
190
|
+
"""Tier 1 for Gemma — constrain the function name; arguments fully free.
|
|
191
|
+
|
|
192
|
+
`<|tool_call>call:NAME{...}<tool_call|>` with NAME pinned to the known-tool
|
|
193
|
+
enum. The body is free text interleaved with the `<|"|>` string-delimiter
|
|
194
|
+
token, so argument *content* is never constrained — the existing TS salvage
|
|
195
|
+
layer keeps handling argument repair. Makes the hallucinated-function-name
|
|
196
|
+
failure unrepresentable with zero recursion / ParserTooComplex risk.
|
|
197
|
+
"""
|
|
198
|
+
return (
|
|
199
|
+
_GEMMA_HEAD
|
|
200
|
+
+ "tool_call: <|tool_call> PRE NAME body <tool_call|>\n"
|
|
201
|
+
+ f"NAME: /({alts})/\n"
|
|
202
|
+
+ "PRE: /call:/\n"
|
|
203
|
+
+ 'body: (TEXT | <|"|>)*\n'
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
# GLM-4.5/4.6 emit `<tool_call>NAME<arg_key>K</arg_key><arg_value>V</arg_value></tool_call>`.
|
|
208
|
+
# Verified against the installed laguna-s-118b tokenizer_config.json:
|
|
209
|
+
# `<tool_call>` (25) and `</tool_call>` (26) are single special tokens, while
|
|
210
|
+
# `<arg_key>` / `<arg_value>` are ORDINARY byte sequences (not in
|
|
211
|
+
# added_tokens) — the same split Hermes has between its `<tool_call>` envelope
|
|
212
|
+
# and `<function=` inner markup. So the name-only grammar is Hermes-shaped:
|
|
213
|
+
# pin NAME right after the `<tool_call>` special token (GLM writes the bare
|
|
214
|
+
# function name with no `<function=` wrapper), then free text up to the
|
|
215
|
+
# `</tool_call>` special token. `<think>`/`</think>` (18/19) are listed so
|
|
216
|
+
# reasoning is never blocked.
|
|
217
|
+
_GLM_HEAD = (
|
|
218
|
+
"%llguidance {}\n"
|
|
219
|
+
"start: (seg)*\n"
|
|
220
|
+
"seg: TEXT | <think> | </think> | tool_call\n"
|
|
221
|
+
"TEXT: /(.|\\n)*/\n"
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def _glm_name_only(alts: str) -> str:
|
|
226
|
+
"""Tier 1 for GLM — constrain the function name; arguments fully free.
|
|
227
|
+
|
|
228
|
+
`<tool_call>NAME<arg_key>…</arg_key><arg_value>…</arg_value></tool_call>`
|
|
229
|
+
with NAME pinned to the known-tool enum. The `<arg_key>`/`<arg_value>`
|
|
230
|
+
body is ordinary bytes (free text), so argument content is never
|
|
231
|
+
constrained — the TS salvage layer keeps handling argument parsing. Makes
|
|
232
|
+
the hallucinated-function-name failure unrepresentable with zero recursion
|
|
233
|
+
/ ParserTooComplex risk. Leading whitespace before NAME is tolerated (the
|
|
234
|
+
template emits none, but a model may add a newline).
|
|
235
|
+
"""
|
|
236
|
+
return (
|
|
237
|
+
_GLM_HEAD
|
|
238
|
+
+ "tool_call: <tool_call> NAME POST </tool_call>\n"
|
|
239
|
+
+ f"NAME: /\\s*({alts})/\n"
|
|
240
|
+
+ "POST: /(.|\\n)*/\n"
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def _schema_is_structural(schema: Any, depth: int = 0) -> bool:
|
|
245
|
+
"""True if this property schema wants an object or array value.
|
|
246
|
+
|
|
247
|
+
Conservative on purpose: an unresolvable `$ref` counts as structural.
|
|
248
|
+
Guessing "structural" only widens the grammar (see
|
|
249
|
+
`_has_structural_params`); guessing "scalar" would keep the model
|
|
250
|
+
trapped in a shape that cannot express the value.
|
|
251
|
+
"""
|
|
252
|
+
if not isinstance(schema, dict) or depth > 4:
|
|
253
|
+
return False
|
|
254
|
+
if "$ref" in schema:
|
|
255
|
+
return True
|
|
256
|
+
t = schema.get("type")
|
|
257
|
+
if isinstance(t, str) and t in ("object", "array"):
|
|
258
|
+
return True
|
|
259
|
+
if isinstance(t, list) and any(x in ("object", "array") for x in t):
|
|
260
|
+
return True
|
|
261
|
+
if "properties" in schema or "items" in schema:
|
|
262
|
+
return True
|
|
263
|
+
for key in ("anyOf", "oneOf", "allOf"):
|
|
264
|
+
branches = schema.get(key)
|
|
265
|
+
if isinstance(branches, list) and any(
|
|
266
|
+
_schema_is_structural(b, depth + 1) for b in branches
|
|
267
|
+
):
|
|
268
|
+
return True
|
|
269
|
+
return False
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def _has_structural_params(tools: List[Dict[str, Any]]) -> bool:
|
|
273
|
+
"""True if any wired tool declares a top-level object/array parameter.
|
|
274
|
+
|
|
275
|
+
Wild-caught before schema coercion existed: DocBlocks'
|
|
276
|
+
`convert_document.source` / `targets` failed 19 consecutive attempts, the
|
|
277
|
+
model emitting correct JSON inside `<parameter=…>` and the flat markup
|
|
278
|
+
reaching the validator as a string. Coercion now repairs that value, and
|
|
279
|
+
the markup branch holds it to JSON (`_markup_json_value_schema`), so the
|
|
280
|
+
in-tag form — the Qwen template's own — is the primary one.
|
|
281
|
+
|
|
282
|
+
When this returns True the Hermes grammar also admits a raw JSON body
|
|
283
|
+
inside the `<tool_call>` envelope as a fallback. That branch is
|
|
284
|
+
schema-constrained too, so function names, top-level keys, and required
|
|
285
|
+
fields stay pinned. The prompt never asks for it: see
|
|
286
|
+
model-profile/tool-call-idiom.ts.
|
|
287
|
+
"""
|
|
288
|
+
for tool in tools:
|
|
289
|
+
fn = tool.get("function") if isinstance(tool, dict) else None
|
|
290
|
+
params = fn.get("parameters") if isinstance(fn, dict) else None
|
|
291
|
+
props = params.get("properties") if isinstance(params, dict) else None
|
|
292
|
+
if not isinstance(props, dict):
|
|
293
|
+
continue
|
|
294
|
+
if any(_schema_is_structural(v) for v in props.values()):
|
|
295
|
+
return True
|
|
296
|
+
return False
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def _required_param_keys_from_tool(tool: Dict[str, Any], keys: List[str]) -> List[str]:
|
|
300
|
+
"""Declared top-level required keys that the markup grammar can emit.
|
|
301
|
+
|
|
302
|
+
A malformed schema can mention a required key absent from `properties`.
|
|
303
|
+
Ignoring that impossible key is the safe direction: requiring it would
|
|
304
|
+
make every call to the tool unrepresentable at decode time.
|
|
305
|
+
"""
|
|
306
|
+
fn = tool.get("function") if isinstance(tool, dict) else None
|
|
307
|
+
params = fn.get("parameters") if isinstance(fn, dict) else None
|
|
308
|
+
required = params.get("required") if isinstance(params, dict) else None
|
|
309
|
+
if not isinstance(required, list):
|
|
310
|
+
return []
|
|
311
|
+
available = set(keys)
|
|
312
|
+
out: List[str] = []
|
|
313
|
+
for value in required:
|
|
314
|
+
if isinstance(value, str) and value in available and value not in out:
|
|
315
|
+
out.append(value)
|
|
316
|
+
return out
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def _shallow_json_property(schema: Any) -> Dict[str, Any]:
|
|
320
|
+
"""Keep cheap value constraints for the raw-JSON escape branch.
|
|
321
|
+
|
|
322
|
+
Full MCP schemas contain deep unions that can trip llguidance's parser
|
|
323
|
+
complexity ceiling. The service remains the authoritative validator; at
|
|
324
|
+
decode time we enforce the function name, top-level keys, and required
|
|
325
|
+
list, plus inexpensive type/enum/const hints where available.
|
|
326
|
+
"""
|
|
327
|
+
if not isinstance(schema, dict):
|
|
328
|
+
return {}
|
|
329
|
+
out: Dict[str, Any] = {}
|
|
330
|
+
declared = schema.get("type")
|
|
331
|
+
if isinstance(declared, str) or (
|
|
332
|
+
isinstance(declared, list) and all(isinstance(x, str) for x in declared)
|
|
333
|
+
):
|
|
334
|
+
out["type"] = declared
|
|
335
|
+
if "const" in schema:
|
|
336
|
+
out["const"] = schema["const"]
|
|
337
|
+
enum = schema.get("enum")
|
|
338
|
+
if isinstance(enum, list) and enum:
|
|
339
|
+
out["enum"] = enum
|
|
340
|
+
return out
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def _hermes_json_branch(tools: List[Dict[str, Any]]) -> str:
|
|
344
|
+
"""Constrained raw-JSON calls for tools needing nested values.
|
|
345
|
+
|
|
346
|
+
Hermes' `<parameter=K>text</parameter>` representation flattens objects
|
|
347
|
+
and arrays into strings. Qwen also knows the canonical JSON envelope, so
|
|
348
|
+
structural tools get that escape hatch. It used to be a free regex, which
|
|
349
|
+
silently bypassed every function-name, key-name, and required-field
|
|
350
|
+
guarantee. llguidance supports inline JSON Schema; use a deliberately
|
|
351
|
+
shallow per-tool union so the escape stays representable without becoming
|
|
352
|
+
unconstrained.
|
|
353
|
+
"""
|
|
354
|
+
variants: List[Dict[str, Any]] = []
|
|
355
|
+
for tool in tools:
|
|
356
|
+
fn = tool.get("function") if isinstance(tool, dict) else None
|
|
357
|
+
name = fn.get("name") if isinstance(fn, dict) else None
|
|
358
|
+
params = fn.get("parameters") if isinstance(fn, dict) else None
|
|
359
|
+
props = params.get("properties") if isinstance(params, dict) else None
|
|
360
|
+
if not (isinstance(name, str) and name and isinstance(props, dict)):
|
|
361
|
+
continue
|
|
362
|
+
if not any(_schema_is_structural(value) for value in props.values()):
|
|
363
|
+
continue
|
|
364
|
+
keys = [key for key in props if isinstance(key, str) and key]
|
|
365
|
+
arguments: Dict[str, Any] = {
|
|
366
|
+
"type": "object",
|
|
367
|
+
"properties": {
|
|
368
|
+
key: _shallow_json_property(props[key]) for key in keys
|
|
369
|
+
},
|
|
370
|
+
"additionalProperties": False,
|
|
371
|
+
}
|
|
372
|
+
required = _required_param_keys_from_tool(tool, keys)
|
|
373
|
+
if required:
|
|
374
|
+
arguments["required"] = required
|
|
375
|
+
variants.append(
|
|
376
|
+
{
|
|
377
|
+
"type": "object",
|
|
378
|
+
"properties": {
|
|
379
|
+
"name": {"const": name},
|
|
380
|
+
"arguments": arguments,
|
|
381
|
+
},
|
|
382
|
+
"required": ["name", "arguments"],
|
|
383
|
+
"additionalProperties": False,
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
if not variants:
|
|
387
|
+
return ""
|
|
388
|
+
schema: Dict[str, Any] = variants[0] if len(variants) == 1 else {"anyOf": variants}
|
|
389
|
+
encoded = json.dumps(schema, separators=(",", ":"))
|
|
390
|
+
return (
|
|
391
|
+
"json_call: JSON_WS json_body JSON_WS\n"
|
|
392
|
+
"JSON_WS: /\\s*/\n"
|
|
393
|
+
f"json_body: %json {encoded}\n"
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def _param_keys_from_tool(tool: Dict[str, Any]) -> Optional[List[str]]:
|
|
398
|
+
"""Top-level parameter names for a tool, or None when the schema
|
|
399
|
+
declares none we can constrain — caller then allows free keys so a
|
|
400
|
+
loose/undeclared-schema tool is never broken.
|
|
401
|
+
"""
|
|
402
|
+
fn = tool.get("function") if isinstance(tool, dict) else None
|
|
403
|
+
params = fn.get("parameters") if isinstance(fn, dict) else None
|
|
404
|
+
props = params.get("properties") if isinstance(params, dict) else None
|
|
405
|
+
if isinstance(props, dict) and props:
|
|
406
|
+
keys = [k for k in props.keys() if isinstance(k, str) and k]
|
|
407
|
+
return keys or None
|
|
408
|
+
return None
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
_MAX_ANY_ORDER_REQUIRED_PARAMS = 4
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
def _hermes_required_param_rules(
|
|
415
|
+
idx: int,
|
|
416
|
+
keys: List[str],
|
|
417
|
+
required: List[str],
|
|
418
|
+
json_values: Optional[Dict[str, str]] = None,
|
|
419
|
+
) -> List[str]:
|
|
420
|
+
"""Grammar rules that make every required markup parameter unavoidable.
|
|
421
|
+
|
|
422
|
+
For up to four required keys, a small state machine tracks which keys have
|
|
423
|
+
appeared and accepts them in any order. State growth is 2**N, so wider
|
|
424
|
+
schemas use their declared `required` order instead; decode-time steering
|
|
425
|
+
then guides the model through that canonical order without risking a
|
|
426
|
+
roster-sized ParserTooComplex failure.
|
|
427
|
+
|
|
428
|
+
Optional keys, and required keys already seen, may occur between required
|
|
429
|
+
transitions. The final state accepts any declared key, preserving the old
|
|
430
|
+
grammar's tolerance for duplicate parameters.
|
|
431
|
+
|
|
432
|
+
`json_values` maps an object/array key to the rule for its value — JSON
|
|
433
|
+
inside the tag, the way the Qwen chat template itself renders one. Every
|
|
434
|
+
other key keeps the free `pval` text, so a scalar-only tool's grammar is
|
|
435
|
+
unchanged.
|
|
436
|
+
"""
|
|
437
|
+
json_values = json_values or {}
|
|
438
|
+
rules: List[str] = []
|
|
439
|
+
|
|
440
|
+
def value(key: str) -> str:
|
|
441
|
+
return json_values.get(key, "pval")
|
|
442
|
+
|
|
443
|
+
def item(name: str, subset: List[str]) -> str:
|
|
444
|
+
"""One `<parameter=KEY>…</parameter>` for any key in `subset`."""
|
|
445
|
+
free = [key for key in subset if key not in json_values]
|
|
446
|
+
alts: List[str] = []
|
|
447
|
+
if free:
|
|
448
|
+
rules.append(f"{name}: /({tool_name_alternation(free)})/")
|
|
449
|
+
alts.append(f'POPEN {name} ">" pval')
|
|
450
|
+
alts.extend(
|
|
451
|
+
f"POPEN {json.dumps(key + '>')} {json_values[key]}"
|
|
452
|
+
for key in subset
|
|
453
|
+
if key in json_values
|
|
454
|
+
)
|
|
455
|
+
return alts[0] if len(alts) == 1 else f"({' | '.join(alts)})"
|
|
456
|
+
|
|
457
|
+
any_key = item(f"k_{idx}", keys)
|
|
458
|
+
if not required:
|
|
459
|
+
rules.insert(0, f"params_{idx}: ( {any_key} )*")
|
|
460
|
+
return rules
|
|
461
|
+
|
|
462
|
+
if len(required) > _MAX_ANY_ORDER_REQUIRED_PARAMS:
|
|
463
|
+
optional = [key for key in keys if key not in set(required)]
|
|
464
|
+
pieces: List[str] = []
|
|
465
|
+
seen: List[str] = []
|
|
466
|
+
for pos, key in enumerate(required):
|
|
467
|
+
neutral = optional + seen
|
|
468
|
+
if neutral:
|
|
469
|
+
pieces.append(f"( {item(f'gap_{idx}_{pos}', neutral)} )*")
|
|
470
|
+
pieces.append(f"POPEN {json.dumps(key + '>')} {value(key)}")
|
|
471
|
+
seen.append(key)
|
|
472
|
+
pieces.append(f"( {any_key} )*")
|
|
473
|
+
rules.insert(0, f"params_{idx}: {' '.join(pieces)}")
|
|
474
|
+
return rules
|
|
475
|
+
|
|
476
|
+
required_index = {key: pos for pos, key in enumerate(required)}
|
|
477
|
+
full_mask = (1 << len(required)) - 1
|
|
478
|
+
rules.insert(0, f"params_{idx}: params_{idx}_s_0")
|
|
479
|
+
for mask in range(full_mask + 1):
|
|
480
|
+
state = f"params_{idx}_s_{mask}"
|
|
481
|
+
if mask == full_mask:
|
|
482
|
+
rules.append(f"{state}: ( {any_key} )*")
|
|
483
|
+
continue
|
|
484
|
+
|
|
485
|
+
neutral = [
|
|
486
|
+
key
|
|
487
|
+
for key in keys
|
|
488
|
+
if key not in required_index or mask & (1 << required_index[key])
|
|
489
|
+
]
|
|
490
|
+
prefix = ""
|
|
491
|
+
if neutral:
|
|
492
|
+
prefix = f"( {item(f'seen_{idx}_{mask}', neutral)} )* "
|
|
493
|
+
|
|
494
|
+
transitions = []
|
|
495
|
+
for pos, key in enumerate(required):
|
|
496
|
+
if mask & (1 << pos):
|
|
497
|
+
continue
|
|
498
|
+
next_state = f"params_{idx}_s_{mask | (1 << pos)}"
|
|
499
|
+
transitions.append(
|
|
500
|
+
f"POPEN {json.dumps(key + '>')} {value(key)} {next_state}"
|
|
501
|
+
)
|
|
502
|
+
rules.append(f"{state}: {prefix}({' | '.join(transitions)})")
|
|
503
|
+
return rules
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
def _markup_json_value_schema(schema: Any) -> Optional[Dict[str, Any]]:
|
|
507
|
+
"""Shallow schema for a parameter whose markup value must be JSON, or None.
|
|
508
|
+
|
|
509
|
+
Only a property that is an object or array and nothing else qualifies.
|
|
510
|
+
One that also accepts a string, or declares no type, stays free text:
|
|
511
|
+
forcing JSON there would make the model quote a plain path, and the
|
|
512
|
+
qwen3_coder parser keeps a string-typed value verbatim, quotes included.
|
|
513
|
+
"""
|
|
514
|
+
if not isinstance(schema, dict):
|
|
515
|
+
return None
|
|
516
|
+
declared = schema.get("type")
|
|
517
|
+
types = [declared] if isinstance(declared, str) else declared
|
|
518
|
+
if declared is None:
|
|
519
|
+
# A union of object shapes (DocBlocks' `convert_document.source`:
|
|
520
|
+
# markdown | file | artifact) can never be a plain string either.
|
|
521
|
+
branches = schema.get("anyOf") or schema.get("oneOf")
|
|
522
|
+
if isinstance(branches, list) and branches:
|
|
523
|
+
branch_types = [
|
|
524
|
+
b.get("type") for b in branches if isinstance(b, dict) and "type" in b
|
|
525
|
+
]
|
|
526
|
+
if len(branch_types) == len(branches) and all(
|
|
527
|
+
isinstance(t, str) for t in branch_types
|
|
528
|
+
):
|
|
529
|
+
types = sorted(set(branch_types))
|
|
530
|
+
if not isinstance(types, list) or not types:
|
|
531
|
+
return None
|
|
532
|
+
if not all(isinstance(t, str) and t in ("object", "array", "null") for t in types):
|
|
533
|
+
return None
|
|
534
|
+
if not any(t in ("object", "array") for t in types):
|
|
535
|
+
return None
|
|
536
|
+
if declared is None:
|
|
537
|
+
return {"type": types[0] if len(types) == 1 else types}
|
|
538
|
+
return _shallow_json_property(schema)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
def _hermes_name_and_params(tools: List[Dict[str, Any]]) -> Optional[str]:
|
|
542
|
+
"""Tier 2 — constrain the function name AND each `<parameter=KEY>` key to
|
|
543
|
+
that tool's declared parameter names.
|
|
544
|
+
|
|
545
|
+
Branches per tool so the valid key set follows the chosen function. A
|
|
546
|
+
tool with no declarable schema falls back to free keys (name still
|
|
547
|
+
constrained), so loose-schema tools are never broken. Scalar values are a
|
|
548
|
+
lazy lexeme bounded by the text token `</parameter>`.
|
|
549
|
+
|
|
550
|
+
An object/array parameter takes JSON inside its tag —
|
|
551
|
+
`<parameter=params>\\n{"topic": "Pizza"}\\n</parameter>` — which is how
|
|
552
|
+
the Qwen chat template renders one (`args_value | tojson`) and what the
|
|
553
|
+
qwen3_coder parser and gezel's schema coercion both decode. That value is
|
|
554
|
+
held to a shallow per-type schema, one shared rule per distinct schema so
|
|
555
|
+
a wide roster compiles a handful of JSON sub-grammars, not one per key.
|
|
556
|
+
|
|
557
|
+
These tools used to be JSON-envelope only, on the theory that markup
|
|
558
|
+
flattens a nested value to a string. It does not on this path, and the
|
|
559
|
+
envelope is off-distribution for Qwen 3.x: a qwen3.8-27b Meester wrote the
|
|
560
|
+
envelope as told, closed the XML it expected (`</parameter></function>`),
|
|
561
|
+
and looped `</function>` to max_tokens (2026-09-23). The envelope stays
|
|
562
|
+
accepted as a fallback; the prompt no longer asks for it.
|
|
563
|
+
"""
|
|
564
|
+
branches: List[str] = []
|
|
565
|
+
rules: List[str] = []
|
|
566
|
+
json_value_rules: Dict[str, str] = {}
|
|
567
|
+
seen: set = set()
|
|
568
|
+
idx = 0
|
|
569
|
+
|
|
570
|
+
def json_value_rule(schema: Dict[str, Any]) -> str:
|
|
571
|
+
encoded = json.dumps(schema, separators=(",", ":"), sort_keys=True)
|
|
572
|
+
rule = json_value_rules.get(encoded)
|
|
573
|
+
if rule is None:
|
|
574
|
+
rule = f"jv_{len(json_value_rules)}"
|
|
575
|
+
json_value_rules[encoded] = rule
|
|
576
|
+
rules.append(f'{rule}: JSON_WS {rule}_body JSON_WS "</parameter>"')
|
|
577
|
+
rules.append(f"{rule}_body: %json {encoded}")
|
|
578
|
+
return rule
|
|
579
|
+
|
|
580
|
+
for tool in tools:
|
|
581
|
+
fn = tool.get("function") if isinstance(tool, dict) else None
|
|
582
|
+
name = fn.get("name") if isinstance(fn, dict) else None
|
|
583
|
+
if not (isinstance(name, str) and name) or name in seen:
|
|
584
|
+
continue
|
|
585
|
+
seen.add(name)
|
|
586
|
+
params = fn.get("parameters") if isinstance(fn, dict) else None
|
|
587
|
+
props = params.get("properties") if isinstance(params, dict) else None
|
|
588
|
+
branches.append(f"fn_{idx}")
|
|
589
|
+
head = json.dumps(name + ">") # lark string literal, safely escaped
|
|
590
|
+
rules.append(f"fn_{idx}: {head} params_{idx} CLOSE")
|
|
591
|
+
keys = _param_keys_from_tool(tool)
|
|
592
|
+
if keys:
|
|
593
|
+
required = _required_param_keys_from_tool(tool, keys)
|
|
594
|
+
json_values: Dict[str, str] = {}
|
|
595
|
+
for key in keys:
|
|
596
|
+
value_schema = _markup_json_value_schema((props or {}).get(key))
|
|
597
|
+
if value_schema is not None:
|
|
598
|
+
json_values[key] = json_value_rule(value_schema)
|
|
599
|
+
rules.extend(_hermes_required_param_rules(idx, keys, required, json_values))
|
|
600
|
+
else:
|
|
601
|
+
rules.append(f'params_{idx}: ( POPEN FREEKEY ">" pval )*')
|
|
602
|
+
idx += 1
|
|
603
|
+
json_branch = _hermes_json_branch(tools)
|
|
604
|
+
if json_value_rules and not json_branch:
|
|
605
|
+
rules.append("JSON_WS: /\\s*/")
|
|
606
|
+
if not branches and not json_branch:
|
|
607
|
+
return None
|
|
608
|
+
if branches and json_branch:
|
|
609
|
+
alt = " | ".join(branches)
|
|
610
|
+
head = (
|
|
611
|
+
"tool_call: <tool_call> (hermes_call | json_call) </tool_call>\n"
|
|
612
|
+
+ f"hermes_call: FNOPEN ({alt})\n"
|
|
613
|
+
+ json_branch
|
|
614
|
+
)
|
|
615
|
+
elif branches:
|
|
616
|
+
alt = " | ".join(branches)
|
|
617
|
+
head = f"tool_call: <tool_call> FNOPEN ({alt}) </tool_call>\n"
|
|
618
|
+
else:
|
|
619
|
+
head = "tool_call: <tool_call> json_call </tool_call>\n" + json_branch
|
|
620
|
+
return (
|
|
621
|
+
_HERMES_HEAD
|
|
622
|
+
+ head
|
|
623
|
+
+ "FNOPEN: /\\s*<function=/\n"
|
|
624
|
+
+ "POPEN: /\\s*<parameter=/\n"
|
|
625
|
+
+ "PVALT: /(.|\\n)*/\n"
|
|
626
|
+
+ "CLOSE: /\\s*<\\/function>\\s*/\n"
|
|
627
|
+
+ "FREEKEY: /[a-zA-Z_][a-zA-Z0-9_-]*/\n"
|
|
628
|
+
+ 'pval[lazy]: PVALT "</parameter>"\n'
|
|
629
|
+
+ "\n".join(rules)
|
|
630
|
+
+ "\n"
|
|
631
|
+
)
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
def _tool_names_from_request(tools: Optional[List[Dict[str, Any]]]) -> List[str]:
|
|
635
|
+
names: List[str] = []
|
|
636
|
+
for t in tools or []:
|
|
637
|
+
fn = t.get("function") if isinstance(t, dict) else None
|
|
638
|
+
name = fn.get("name") if isinstance(fn, dict) else None
|
|
639
|
+
if isinstance(name, str) and name:
|
|
640
|
+
names.append(name)
|
|
641
|
+
return names
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
def _callable_tools(
|
|
645
|
+
tool_list: List[Dict[str, Any]], hint: Dict[str, Any]
|
|
646
|
+
) -> List[Dict[str, Any]]:
|
|
647
|
+
"""Narrow to `hint.allowed_names` when the caller restricts what may be
|
|
648
|
+
CALLED this turn. The prompt still renders every tool in `tools`, so a
|
|
649
|
+
session's prompt cache survives the restriction flipping on and off;
|
|
650
|
+
only the grammar, which decides what a call may name, narrows."""
|
|
651
|
+
allowed = (hint or {}).get("allowed_names")
|
|
652
|
+
if not isinstance(allowed, list):
|
|
653
|
+
return tool_list
|
|
654
|
+
keep = {n for n in allowed if isinstance(n, str)}
|
|
655
|
+
return [t for t in tool_list if set(_tool_names_from_request([t])) & keep]
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
def build_grammar_string(
|
|
659
|
+
tools: Optional[List[Dict[str, Any]]], hint: Dict[str, Any]
|
|
660
|
+
) -> Optional[str]:
|
|
661
|
+
"""Build the serialized llguidance grammar string for a request, or
|
|
662
|
+
None if unsupported / not applicable. Pure (no tokenizer) so it's
|
|
663
|
+
unit-testable: validate it with `LLMatcher.validate_grammar`.
|
|
664
|
+
|
|
665
|
+
`hint.mode` selects the tier: `name-and-params` (default — tier 2,
|
|
666
|
+
constrains the function name, each parameter key, and required-key
|
|
667
|
+
presence) or `name-only` (tier 1, function name only).
|
|
668
|
+
"""
|
|
669
|
+
fmt = str((hint or {}).get("format") or "").strip()
|
|
670
|
+
if fmt not in SUPPORTED_FORMATS:
|
|
671
|
+
return None
|
|
672
|
+
tool_list = _callable_tools([t for t in (tools or []) if isinstance(t, dict)], hint)
|
|
673
|
+
if not tool_list:
|
|
674
|
+
return None
|
|
675
|
+
mode = str((hint or {}).get("mode") or "name-and-params").strip()
|
|
676
|
+
if fmt == "hermes":
|
|
677
|
+
if mode == "name-only":
|
|
678
|
+
alts = tool_name_alternation(_tool_names_from_request(tool_list))
|
|
679
|
+
if not alts:
|
|
680
|
+
return None
|
|
681
|
+
return _hermes_name_only(alts, json_branch=_hermes_json_branch(tool_list))
|
|
682
|
+
return _hermes_name_and_params(tool_list)
|
|
683
|
+
if fmt == "gemma":
|
|
684
|
+
# Gemma is name-only (tier 1) regardless of requested mode: pinning the
|
|
685
|
+
# name already makes the hallucinated-name failure unrepresentable,
|
|
686
|
+
# which is the load-bearing constraint. Tier-2 key-pinning for Gemma's
|
|
687
|
+
# bare-key `{key:<|"|>val<|"|>}` shape is a fast-follow.
|
|
688
|
+
alts = tool_name_alternation(_tool_names_from_request(tool_list))
|
|
689
|
+
return _gemma_name_only(alts) if alts else None
|
|
690
|
+
if fmt == "glm":
|
|
691
|
+
# GLM is name-only (tier 1) regardless of requested mode: pinning the
|
|
692
|
+
# function name makes the hallucinated-name failure unrepresentable,
|
|
693
|
+
# which is the load-bearing constraint. The `<arg_key>` body is free
|
|
694
|
+
# bytes, so tier-2 key-pinning would need the same `<parameter=`-style
|
|
695
|
+
# handling Hermes has — a fast-follow.
|
|
696
|
+
alts = tool_name_alternation(_tool_names_from_request(tool_list))
|
|
697
|
+
return _glm_name_only(alts) if alts else None
|
|
698
|
+
return None
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
def build_tool_grammar_processor(
|
|
702
|
+
tokenizer: Any,
|
|
703
|
+
tools: Optional[List[Dict[str, Any]]],
|
|
704
|
+
hint: Dict[str, Any],
|
|
705
|
+
) -> Optional[Any]:
|
|
706
|
+
"""Build a schema-constraining logits processor for the request's
|
|
707
|
+
tool-call format, or None if unsupported / not applicable.
|
|
708
|
+
|
|
709
|
+
`hint` is the gezel `tool_grammar` request field, e.g.
|
|
710
|
+
`{"format": "hermes", "mode": "name-and-params"}`. Tool schemas are
|
|
711
|
+
read from the OpenAI `tools` array. Any failure returns None — the turn then
|
|
712
|
+
runs unconstrained + TS salvage, so this never breaks a turn.
|
|
713
|
+
"""
|
|
714
|
+
fmt = str((hint or {}).get("format") or "").strip()
|
|
715
|
+
if fmt and fmt not in SUPPORTED_FORMATS:
|
|
716
|
+
print(
|
|
717
|
+
f"[tool-grammar] no grammar template for format={fmt!r}; skipping",
|
|
718
|
+
flush=True,
|
|
719
|
+
)
|
|
720
|
+
return None
|
|
721
|
+
|
|
722
|
+
try:
|
|
723
|
+
from llguidance import LLMatcher
|
|
724
|
+
from mlx_vlm.structured import LLGuidanceLogitsProcessor
|
|
725
|
+
except Exception as exc: # noqa: BLE001 - optional dep missing
|
|
726
|
+
print(
|
|
727
|
+
f"[tool-grammar] llguidance unavailable; skipping grammar: {exc}",
|
|
728
|
+
flush=True,
|
|
729
|
+
)
|
|
730
|
+
return None
|
|
731
|
+
|
|
732
|
+
try:
|
|
733
|
+
grammar = build_grammar_string(tools, hint)
|
|
734
|
+
except Exception as exc: # noqa: BLE001 - build must not break the turn
|
|
735
|
+
print(
|
|
736
|
+
f"[tool-grammar] failed to build grammar for format={fmt!r}: {exc}",
|
|
737
|
+
flush=True,
|
|
738
|
+
)
|
|
739
|
+
return None
|
|
740
|
+
if grammar is None:
|
|
741
|
+
return None
|
|
742
|
+
|
|
743
|
+
try:
|
|
744
|
+
# Validate WITH the tokenizer so unresolved special-token terminals
|
|
745
|
+
# (a model variant that doesn't ship `<tool_call>` etc.) fail here
|
|
746
|
+
# and fall back to unconstrained decode rather than erroring mid-turn.
|
|
747
|
+
llg_tok = _get_llg_tokenizer(tokenizer)
|
|
748
|
+
err = LLMatcher.validate_grammar(grammar, llg_tok)
|
|
749
|
+
if err:
|
|
750
|
+
print(
|
|
751
|
+
f"[tool-grammar] grammar invalid for format={fmt!r} on this "
|
|
752
|
+
f"tokenizer: {err}",
|
|
753
|
+
flush=True,
|
|
754
|
+
)
|
|
755
|
+
return None
|
|
756
|
+
proc = LLGuidanceLogitsProcessor(grammar, llg_tok)
|
|
757
|
+
except Exception as exc: # noqa: BLE001 - build failure must not break the turn
|
|
758
|
+
print(
|
|
759
|
+
f"[tool-grammar] failed to build processor for format={fmt!r}: {exc}",
|
|
760
|
+
flush=True,
|
|
761
|
+
)
|
|
762
|
+
return None
|
|
763
|
+
|
|
764
|
+
mode = str((hint or {}).get("mode") or "name-and-params").strip()
|
|
765
|
+
# `json-escape=on` means at least one wired tool declares an
|
|
766
|
+
# object/array parameter, so the grammar also admits a raw JSON body
|
|
767
|
+
# inside `<tool_call>`. Without it the model would be pinned into the
|
|
768
|
+
# flat `<parameter=KEY>` shape, which cannot express such an argument.
|
|
769
|
+
json_escape = fmt == "hermes" and _has_structural_params(
|
|
770
|
+
[t for t in (tools or []) if isinstance(t, dict)]
|
|
771
|
+
)
|
|
772
|
+
required_fields = 0
|
|
773
|
+
required_tools = 0
|
|
774
|
+
for tool in [t for t in (tools or []) if isinstance(t, dict)]:
|
|
775
|
+
keys = _param_keys_from_tool(tool) or []
|
|
776
|
+
count = len(_required_param_keys_from_tool(tool, keys))
|
|
777
|
+
required_fields += count
|
|
778
|
+
required_tools += int(count > 0)
|
|
779
|
+
allowed = (hint or {}).get("allowed_names")
|
|
780
|
+
callable_note = (
|
|
781
|
+
f"callable={len(_callable_tools([t for t in (tools or []) if isinstance(t, dict)], hint))} "
|
|
782
|
+
if isinstance(allowed, list)
|
|
783
|
+
else ""
|
|
784
|
+
)
|
|
785
|
+
print(
|
|
786
|
+
f"[tool-grammar] active format={fmt} mode={mode} "
|
|
787
|
+
f"tools={len(_tool_names_from_request(tools))} "
|
|
788
|
+
f"{callable_note}"
|
|
789
|
+
f"declared-required-tools={required_tools} "
|
|
790
|
+
f"declared-required-fields={required_fields} "
|
|
791
|
+
f"json-escape={'on' if json_escape else 'off'}",
|
|
792
|
+
flush=True,
|
|
793
|
+
)
|
|
794
|
+
return SafeToolGrammarProcessor(proc)
|