@bendyline/gezel-inference 1.0.1 → 1.0.3
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/dist/catalog/chat-models/de/deepseek-v4.1-flash-552b-q2/manifest.json +120 -0
- package/dist/catalog/chat-models/de/deepseek-v4.1-flash-552b-q2/versions/1.0.0/manifest.json +21 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/manifest.json +6 -5
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.2/manifest.json +27 -0
- package/dist/catalog/chat-models/gl/glm-5.3-flash-320b-q2/versions/1.0.3/manifest.json +27 -0
- package/dist/catalog/chat-models/index.json +1 -1
- package/dist/catalog/chat-models/ne/nemotron3.5-bolt-74b-iq2/manifest.json +157 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-bolt-74b-iq2/versions/1.0.0/manifest.json +30 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-super-vl-120b-nvfp4/manifest.json +156 -0
- package/dist/catalog/chat-models/ne/nemotron3.5-super-vl-120b-nvfp4/versions/1.0.0/manifest.json +28 -0
- package/dist/catalog/chat-models/raw-index.json +1 -1
- package/dist/catalog/knowledge-catalogs/be/bendyline-how-to-books/keywords.json +56 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-alaska-part-0001/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-nevada-part-0001/keywords.json +13 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-300-399-part-0001/keywords.json +14 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-us-347-349/keywords.json +17 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0001/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-utah-part-0002/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0001/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0002/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0003/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0004/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-washington-part-0005/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/ca/caselaw-wyoming-part-0001/keywords.json +12 -0
- package/dist/catalog/knowledge-catalogs/index.json +1 -1
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-aspnet-core-en/keywords.json +21 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-ai-platform-en/keywords.json +27 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-apps-compute-en/keywords.json +23 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-data-aiot-en/keywords.json +26 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-management-hybrid-en/keywords.json +28 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-azure-network-security-en/keywords.json +29 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-dotnet-en/keywords.json +21 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-entity-framework-en/keywords.json +14 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-microsoft-365-en/keywords.json +20 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-powershell-en/keywords.json +24 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-sql-server-en/keywords.json +27 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-apps-en/keywords.json +18 -0
- package/dist/catalog/knowledge-catalogs/mi/microsoftdocs-windows-server-en/keywords.json +28 -0
- package/dist/catalog/knowledge-catalogs/raw-index.json +1 -1
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/keywords.json +1700 -0
- package/dist/catalog/knowledge-catalogs/re/regional-american-south/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/keywords.json +750 -0
- package/dist/catalog/knowledge-catalogs/re/regional-andes-amazon/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/keywords.json +1281 -0
- package/dist/catalog/knowledge-catalogs/re/regional-australia-nz/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/keywords.json +1125 -0
- package/dist/catalog/knowledge-catalogs/re/regional-brazil/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/keywords.json +3287 -0
- package/dist/catalog/knowledge-catalogs/re/regional-britain-ireland/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/keywords.json +1835 -0
- package/dist/catalog/knowledge-catalogs/re/regional-california-southwest/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/keywords.json +1184 -0
- package/dist/catalog/knowledge-catalogs/re/regional-canada-alaska/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/keywords.json +1503 -0
- package/dist/catalog/knowledge-catalogs/re/regional-central-eastern-europe/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/keywords.json +2836 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-asia/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/keywords.json +813 -0
- package/dist/catalog/knowledge-catalogs/re/regional-east-southern-africa/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/keywords.json +2082 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mediterranean/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/keywords.json +1481 -0
- package/dist/catalog/knowledge-catalogs/re/regional-mexico-central-america/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/keywords.json +1272 -0
- package/dist/catalog/knowledge-catalogs/re/regional-middle-east/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/keywords.json +758 -0
- package/dist/catalog/knowledge-catalogs/re/regional-midwest/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/keywords.json +896 -0
- package/dist/catalog/knowledge-catalogs/re/regional-north-africa/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/keywords.json +1281 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northeast/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/keywords.json +346 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-eurasia/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/keywords.json +2688 -0
- package/dist/catalog/knowledge-catalogs/re/regional-northern-europe/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/keywords.json +973 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-islands/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/keywords.json +937 -0
- package/dist/catalog/knowledge-catalogs/re/regional-pacific-northwest/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/keywords.json +608 -0
- package/dist/catalog/knowledge-catalogs/re/regional-rockies-plains/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/keywords.json +633 -0
- package/dist/catalog/knowledge-catalogs/re/regional-south-asia/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/keywords.json +2697 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southeast-asia/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/keywords.json +606 -0
- package/dist/catalog/knowledge-catalogs/re/regional-southern-cone/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/keywords.json +564 -0
- package/dist/catalog/knowledge-catalogs/re/regional-west-central-africa/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe/keywords.json +3247 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe-east/manifest.json +47 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe-east/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe-west/manifest.json +47 -0
- package/dist/catalog/knowledge-catalogs/re/regional-western-europe-west/versions/2026.10.5/manifest.json +133 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/keywords.json +5437 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.10.1/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.10.1/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.10.1/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/keywords.json +5583 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.10.1/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/keywords.json +6386 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/manifest.json +2 -2
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.10.1/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/keywords.json +5672 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.10.1/manifest.json +137 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-geography/manifest.json +68 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-geography/versions/2026.10.1/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-history/manifest.json +68 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-history/versions/2026.10.1/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.10.1/manifest.json +141 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/keywords.json +5719 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.10.1/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.10.1/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/keywords.json +16009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/keywords.json +5843 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.10.1/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/keywords.json +6264 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.10.1/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-arts/manifest.json +66 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-arts/versions/2026.10.1/manifest.json +209 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-business/manifest.json +61 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-business/versions/2026.10.1/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-entertainment/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-entertainment/versions/2026.10.1/manifest.json +201 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-military/manifest.json +60 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-military/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-other/manifest.json +55 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-other/versions/2026.10.1/manifest.json +165 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-politics/manifest.json +63 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-politics/versions/2026.10.1/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-religion/manifest.json +64 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-religion/versions/2026.10.1/manifest.json +201 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-science/manifest.json +65 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-science/versions/2026.10.1/manifest.json +205 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-sports/manifest.json +73 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-sports/versions/2026.10.1/manifest.json +237 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/keywords.json +5447 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.10.1/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.10.1/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/keywords.json +4009 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/keywords.json +5209 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.10.1/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/keywords.json +6537 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.10.1/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/keywords.json +5989 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/manifest.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.10.1/manifest.json +189 -0
- package/dist/catalog/provenance.json +1 -1
- package/dist/engines/native-file-manifest.json +483 -413
- package/dist/engines/native-manifest.d.ts +4 -4
- package/dist/engines/native-manifest.js +36 -34
- package/dist/engines/resolver.js +3 -1
- package/dist/fs/atomic.d.ts +4 -1
- package/dist/fs/atomic.js +7 -1
- package/dist/http/openai-compat/chat-target.d.ts +1 -1
- package/dist/http/openai-compat/chat-target.js +1 -1
- package/dist/http/openai-compat/engine-failure.d.ts +25 -0
- package/dist/http/openai-compat/engine-failure.js +76 -0
- package/dist/http/openai-compat/responses-streaming.js +2 -1
- package/dist/http/openai-compat/responses-translate.d.ts +1 -1
- package/dist/http/openai-compat/translate.d.ts +1 -1
- package/dist/http/routes/engines.js +35 -0
- package/dist/http/routes/v1-chat.js +11 -2
- package/dist/http/routes/v1-knowledge.js +4 -0
- package/dist/http/routes/v1-models.js +6 -4
- package/dist/http/routes/v1-responses.d.ts +1 -1
- package/dist/http/routes/v1-responses.js +7 -1
- package/dist/inference-service.d.ts +6 -1
- package/dist/inference-service.js +20 -9
- package/dist/knowledge/catalog-host.d.ts +9 -1
- package/dist/knowledge/catalog-host.js +2 -0
- package/dist/knowledge/manager.d.ts +21 -0
- package/dist/knowledge/manager.js +85 -7
- package/dist/knowledge/search-worker.d.ts +1 -1
- package/dist/knowledge/spatial-query.d.ts +2 -3
- package/dist/knowledge/spatial-query.js +12 -6
- package/dist/knowledge/worker-host.js +2 -0
- package/dist/memory/embed-core.d.ts +16 -0
- package/dist/memory/embed-core.js +31 -0
- package/dist/memory/embed-worker.d.ts +7 -3
- package/dist/memory/embed-worker.js +13 -4
- package/dist/memory/embeddings.d.ts +17 -2
- package/dist/memory/embeddings.js +36 -7
- package/dist/models/ensure.d.ts +2 -0
- package/dist/models/ensure.js +9 -0
- package/dist/perf/responsiveness.d.ts +14 -1
- package/dist/perf/responsiveness.js +81 -10
- package/dist/providers/audio/kokoro-frontend.js +1 -1
- package/dist/providers/ds4/build-provider.js +6 -0
- package/dist/providers/llama-cpp/backend-health.d.ts +30 -0
- package/dist/providers/llama-cpp/backend-health.js +64 -0
- package/dist/providers/llama-cpp/backend-quarantine.d.ts +40 -0
- package/dist/providers/llama-cpp/backend-quarantine.js +100 -0
- package/dist/providers/llama-cpp/build-provider.js +247 -199
- package/dist/providers/llama-cpp/cache-adapter.d.ts +7 -1
- package/dist/providers/llama-cpp/cache-adapter.js +11 -1
- package/dist/providers/llama-cpp/devices.d.ts +22 -2
- package/dist/providers/llama-cpp/devices.js +48 -5
- package/dist/providers/llama-cpp/engine-flags.d.ts +0 -18
- package/dist/providers/llama-cpp/engine-flags.js +12 -18
- package/dist/providers/llama-cpp/gguf-metadata.js +20 -3
- package/dist/providers/llama-cpp/gpu-startup-watch.d.ts +41 -0
- package/dist/providers/llama-cpp/gpu-startup-watch.js +58 -0
- package/dist/providers/llama-cpp/models.d.ts +6 -0
- package/dist/providers/llama-cpp/models.js +23 -2
- package/dist/providers/llama-cpp/offload-planner.d.ts +26 -18
- package/dist/providers/llama-cpp/offload-planner.js +30 -14
- package/dist/providers/llama-cpp/provider.d.ts +22 -3
- package/dist/providers/llama-cpp/provider.js +39 -3
- package/dist/providers/mlx/provider.js +5 -6
- package/dist/providers/mlx/python/qwen4_ple.py +9 -2
- package/dist/providers/mlx/reasoning-stream.d.ts +15 -0
- package/dist/providers/mlx/reasoning-stream.js +35 -0
- package/dist/providers/native/capacity-broker.d.ts +21 -15
- package/dist/providers/native/capacity-broker.js +25 -13
- package/dist/providers/native/capacity-budget.d.ts +35 -3
- package/dist/providers/native/capacity-budget.js +49 -5
- package/dist/providers/native/device-capacity.d.ts +1 -1
- package/dist/providers/native/device-capacity.js +23 -5
- package/dist/providers/native/local-engine-runtime.js +31 -31
- package/dist/providers/native/measured-budget.js +2 -0
- package/dist/providers/native/supervisor.d.ts +25 -0
- package/dist/providers/native/supervisor.js +62 -8
- package/dist/providers/queue.d.ts +9 -2
- package/dist/providers/queue.js +17 -2
- package/dist/providers/session-hooks.d.ts +4 -1
- package/dist/system/amdgpu-adapters.d.ts +18 -0
- package/dist/system/amdgpu-adapters.js +55 -0
- package/dist/system/gpu-carve-out.d.ts +84 -0
- package/dist/system/gpu-carve-out.js +111 -0
- package/dist/system/memory.d.ts +17 -1
- package/dist/system/memory.js +94 -13
- package/dist/transformers-cache.d.ts +2 -0
- package/dist/transformers-cache.js +6 -3
- package/package.json +5 -5
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
* but logs that it could not anchor to a baked-in digest.
|
|
41
41
|
*/
|
|
42
42
|
/** Native release version this build pins. Placeholder until first public release. */
|
|
43
|
-
export declare const NATIVE_ENGINE_RELEASE = "0.1.
|
|
43
|
+
export declare const NATIVE_ENGINE_RELEASE = "0.1.52";
|
|
44
44
|
/** sha256 of the pinned release's `SHA256SUMS` asset. All-zeros = unpinned. */
|
|
45
|
-
export declare const SHA256SUMS_DIGEST = "
|
|
46
|
-
/** Exact SHA256 values for every engine archive published by native-v0.1.
|
|
45
|
+
export declare const SHA256SUMS_DIGEST = "1a2183ad785671be0f78a0f25816f7c802ce668ebe4fa58d640d336ebcbd7023";
|
|
46
|
+
/** Exact SHA256 values for every engine archive published by native-v0.1.52. */
|
|
47
47
|
export declare const NATIVE_ENGINE_ARCHIVE_SHA256: Readonly<Record<string, string>>;
|
|
48
|
-
/** Download size in bytes of every engine archive published by native-v0.1.
|
|
48
|
+
/** Download size in bytes of every engine archive published by native-v0.1.52. */
|
|
49
49
|
export declare const NATIVE_ENGINE_ARCHIVE_BYTES: Readonly<Record<string, number>>;
|
|
50
50
|
/**
|
|
51
51
|
* True only when the pinned release's standalone macOS archives were
|
|
@@ -40,45 +40,47 @@
|
|
|
40
40
|
* but logs that it could not anchor to a baked-in digest.
|
|
41
41
|
*/
|
|
42
42
|
/** Native release version this build pins. Placeholder until first public release. */
|
|
43
|
-
export const NATIVE_ENGINE_RELEASE = '0.1.
|
|
43
|
+
export const NATIVE_ENGINE_RELEASE = '0.1.52';
|
|
44
44
|
/** sha256 of the pinned release's `SHA256SUMS` asset. All-zeros = unpinned. */
|
|
45
|
-
export const SHA256SUMS_DIGEST = '
|
|
45
|
+
export const SHA256SUMS_DIGEST = '1a2183ad785671be0f78a0f25816f7c802ce668ebe4fa58d640d336ebcbd7023';
|
|
46
46
|
// BEGIN PINNED NATIVE ARCHIVE HASHES
|
|
47
|
-
/** Exact SHA256 values for every engine archive published by native-v0.1.
|
|
47
|
+
/** Exact SHA256 values for every engine archive published by native-v0.1.52. */
|
|
48
48
|
export const NATIVE_ENGINE_ARCHIVE_SHA256 = Object.freeze({
|
|
49
|
-
'gezel-native-0.1.
|
|
50
|
-
'gezel-native-0.1.
|
|
51
|
-
'gezel-native-0.1.
|
|
52
|
-
'gezel-native-0.1.
|
|
53
|
-
'gezel-native-0.1.
|
|
54
|
-
'gezel-native-0.1.
|
|
55
|
-
'gezel-native-0.1.
|
|
56
|
-
'gezel-native-0.1.
|
|
57
|
-
'gezel-native-0.1.
|
|
58
|
-
'gezel-native-0.1.
|
|
59
|
-
'gezel-native-0.1.
|
|
60
|
-
'gezel-native-0.1.
|
|
61
|
-
'gezel-native-0.1.
|
|
62
|
-
'gezel-native-0.1.
|
|
63
|
-
'gezel-native-0.1.
|
|
49
|
+
'gezel-native-0.1.52-darwin-arm64-metal.tar.gz': '8c8619530592692ad9fd905823a5bc7772a652d4257905919dac088c5fa86347',
|
|
50
|
+
'gezel-native-0.1.52-darwin-arm64.tar.gz': '3088b7d97968ea206bf58a516da2a9c635d7622672da220d48d790fd5555a797',
|
|
51
|
+
'gezel-native-0.1.52-linux-arm64-cpu.tar.gz': 'ec4b992eb372e735156691950eadb2aa8f7e5ef29437b53a9da6fe8cc2a7912b',
|
|
52
|
+
'gezel-native-0.1.52-linux-arm64-cuda.tar.gz': '4f97fd70f0d132f0bfcaadfd113f63add7d8b63982edf8b1b7a46301702047f5',
|
|
53
|
+
'gezel-native-0.1.52-linux-arm64.tar.gz': '3fa2c58ff75bea7ec0f739821250307bfba78cb026779ec3ad1ef935286af534',
|
|
54
|
+
'gezel-native-0.1.52-linux-x64-cpu.tar.gz': '1fbfd06acfea1ef9e2629c121da2d7da13ee2e76a0cebb8cf07b779938817966',
|
|
55
|
+
'gezel-native-0.1.52-linux-x64-cuda.tar.gz': '5c3c05f285c3922845b72e470ecfcd5e510b874a35ae841cd655a7098b541ffd',
|
|
56
|
+
'gezel-native-0.1.52-linux-x64-vulkan.tar.gz': '33a6dd016bd2cf0aada7f34c364a457acc524373b52a1d3f1f6e83c1240e93a7',
|
|
57
|
+
'gezel-native-0.1.52-linux-x64.tar.gz': 'f17afac30f984da17b6098bf5f9c5e88e9f9e128b8fbea0b5ff67a360a494313',
|
|
58
|
+
'gezel-native-0.1.52-win32-arm64-cpu.zip': '49f011b05eec55cc3f60730fdd46e3d28de331f60b195eb29abaa04fe62835a3',
|
|
59
|
+
'gezel-native-0.1.52-win32-arm64-cuda.zip': '7dbc99fd9516ea5a5cc49ad2c157bb66a240ecc2b5a5e22fae33142a6615caec',
|
|
60
|
+
'gezel-native-0.1.52-win32-arm64.zip': 'dfe61d86eae932e03d92665aa42b81121e21cfa76a85424d993b5726ee5fa504',
|
|
61
|
+
'gezel-native-0.1.52-win32-x64-cpu.zip': 'b1147052367daf694d6001ef0d45a8897a39a1d74cb776a42f22529d5c21f919',
|
|
62
|
+
'gezel-native-0.1.52-win32-x64-cuda.zip': '3c9568591d19ba04ceb12ae2e9f9f2a4ac7ade4597458a8674d444c06407324f',
|
|
63
|
+
'gezel-native-0.1.52-win32-x64-vulkan.zip': '9cb1e7721d1dbebfa830ec8cba1bbbbcb41f0145d60461e4bf50c4e347feecb2',
|
|
64
|
+
'gezel-native-0.1.52-win32-x64.zip': '7c94605b0783695174773ac2327274d91bb9d7ae31e7d932a2b9df78d44424df',
|
|
64
65
|
});
|
|
65
|
-
/** Download size in bytes of every engine archive published by native-v0.1.
|
|
66
|
+
/** Download size in bytes of every engine archive published by native-v0.1.52. */
|
|
66
67
|
export const NATIVE_ENGINE_ARCHIVE_BYTES = Object.freeze({
|
|
67
|
-
'gezel-native-0.1.
|
|
68
|
-
'gezel-native-0.1.
|
|
69
|
-
'gezel-native-0.1.
|
|
70
|
-
'gezel-native-0.1.
|
|
71
|
-
'gezel-native-0.1.
|
|
72
|
-
'gezel-native-0.1.
|
|
73
|
-
'gezel-native-0.1.
|
|
74
|
-
'gezel-native-0.1.
|
|
75
|
-
'gezel-native-0.1.
|
|
76
|
-
'gezel-native-0.1.
|
|
77
|
-
'gezel-native-0.1.
|
|
78
|
-
'gezel-native-0.1.
|
|
79
|
-
'gezel-native-0.1.
|
|
80
|
-
'gezel-native-0.1.
|
|
81
|
-
'gezel-native-0.1.
|
|
68
|
+
'gezel-native-0.1.52-darwin-arm64-metal.tar.gz': 7056567,
|
|
69
|
+
'gezel-native-0.1.52-darwin-arm64.tar.gz': 42206061,
|
|
70
|
+
'gezel-native-0.1.52-linux-arm64-cpu.tar.gz': 8836310,
|
|
71
|
+
'gezel-native-0.1.52-linux-arm64-cuda.tar.gz': 620408821,
|
|
72
|
+
'gezel-native-0.1.52-linux-arm64.tar.gz': 42037958,
|
|
73
|
+
'gezel-native-0.1.52-linux-x64-cpu.tar.gz': 12914985,
|
|
74
|
+
'gezel-native-0.1.52-linux-x64-cuda.tar.gz': 993543364,
|
|
75
|
+
'gezel-native-0.1.52-linux-x64-vulkan.tar.gz': 25672744,
|
|
76
|
+
'gezel-native-0.1.52-linux-x64.tar.gz': 57183428,
|
|
77
|
+
'gezel-native-0.1.52-win32-arm64-cpu.zip': 5618616,
|
|
78
|
+
'gezel-native-0.1.52-win32-arm64-cuda.zip': 219555740,
|
|
79
|
+
'gezel-native-0.1.52-win32-arm64.zip': 42114295,
|
|
80
|
+
'gezel-native-0.1.52-win32-x64-cpu.zip': 8714442,
|
|
81
|
+
'gezel-native-0.1.52-win32-x64-cuda.zip': 749856660,
|
|
82
|
+
'gezel-native-0.1.52-win32-x64-vulkan.zip': 21123132,
|
|
83
|
+
'gezel-native-0.1.52-win32-x64.zip': 55662940,
|
|
82
84
|
});
|
|
83
85
|
// END PINNED NATIVE ARCHIVE HASHES
|
|
84
86
|
/**
|
package/dist/engines/resolver.js
CHANGED
|
@@ -763,7 +763,9 @@ async function resolveGitHubToken() {
|
|
|
763
763
|
return process.env.GITHUB_TOKEN;
|
|
764
764
|
try {
|
|
765
765
|
const { execFileSync } = await import('node:child_process');
|
|
766
|
-
|
|
766
|
+
// Named host: a bare `gh auth token` answers for gh's default host, which
|
|
767
|
+
// can be a GitHub Enterprise server whose token must not go to github.com.
|
|
768
|
+
const out = execFileSync('gh', ['auth', 'token', '--hostname', 'github.com'], {
|
|
767
769
|
encoding: 'utf8',
|
|
768
770
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
769
771
|
...windowsHeadlessSpawnOptions(),
|
package/dist/fs/atomic.d.ts
CHANGED
|
@@ -50,4 +50,7 @@ export declare function writeFileAtomic(absPath: string, content: string | Uint8
|
|
|
50
50
|
* private staging file by their adapter, then copied to a sibling temporary
|
|
51
51
|
* path and renamed into place.
|
|
52
52
|
*/
|
|
53
|
-
export declare function copyFileAtomic(sourcePath: string, absPath: string
|
|
53
|
+
export declare function copyFileAtomic(sourcePath: string, absPath: string, opts?: {
|
|
54
|
+
noReplace?: boolean;
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}): Promise<void>;
|
package/dist/fs/atomic.js
CHANGED
|
@@ -108,10 +108,16 @@ export async function writeFileAtomic(absPath, content, opts) {
|
|
|
108
108
|
* private staging file by their adapter, then copied to a sibling temporary
|
|
109
109
|
* path and renamed into place.
|
|
110
110
|
*/
|
|
111
|
-
export async function copyFileAtomic(sourcePath, absPath) {
|
|
111
|
+
export async function copyFileAtomic(sourcePath, absPath, opts) {
|
|
112
112
|
const tmp = `${absPath}.tmp-${process.pid}-${randomUUID()}`;
|
|
113
113
|
try {
|
|
114
114
|
await copyFile(sourcePath, tmp);
|
|
115
|
+
opts?.signal?.throwIfAborted();
|
|
116
|
+
if (opts?.noReplace) {
|
|
117
|
+
await link(tmp, absPath);
|
|
118
|
+
await rm(tmp, { force: true }).catch(() => undefined);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
115
121
|
await renameWithWindowsRetry(tmp, absPath);
|
|
116
122
|
}
|
|
117
123
|
catch (err) {
|
|
@@ -59,7 +59,7 @@ export declare function resolvePinnedModelTarget(ctx: ServiceContext, model: str
|
|
|
59
59
|
* Pick the gezel that guarantees a persona-backed fallback for public
|
|
60
60
|
* inference requests.
|
|
61
61
|
*
|
|
62
|
-
* The explicit
|
|
62
|
+
* The explicit Integrations choice wins. When it is unset or stale,
|
|
63
63
|
* the install's Meester is the natural front door; the first available
|
|
64
64
|
* gezel is the final recovery path for older or partially migrated
|
|
65
65
|
* homes. A healthy store always has at least a Meester, but returning
|
|
@@ -29,7 +29,7 @@ export async function resolvePinnedModelTarget(ctx, model) {
|
|
|
29
29
|
* Pick the gezel that guarantees a persona-backed fallback for public
|
|
30
30
|
* inference requests.
|
|
31
31
|
*
|
|
32
|
-
* The explicit
|
|
32
|
+
* The explicit Integrations choice wins. When it is unset or stale,
|
|
33
33
|
* the install's Meester is the natural front door; the first available
|
|
34
34
|
* gezel is the final recovery path for older or partially migrated
|
|
35
35
|
* homes. A healthy store always has at least a Meester, but returning
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenAI-compatible routes' vocabulary for an on-device engine failure.
|
|
3
|
+
*
|
|
4
|
+
* Providers already throw typed errors that say exactly what went wrong: the
|
|
5
|
+
* capacity broker refused the model's memory, the engine crashed, the prompt
|
|
6
|
+
* overflowed its context. These routes kept only the message and stamped every
|
|
7
|
+
* one `provider_error`, so a connected app could not tell "this machine cannot
|
|
8
|
+
* fit the model" from "try again in a second" without parsing prose — and the
|
|
9
|
+
* prose is exactly what a sanitizing proxy strips. Each internal code maps to
|
|
10
|
+
* one stable wire code here; anything unrecognized stays `provider_error`.
|
|
11
|
+
*/
|
|
12
|
+
export type EngineFailureCode = 'capacity_denied' | 'engine_busy' | 'engine_launch_failed' | 'engine_crashed' | 'engine_out_of_memory' | 'context_length_exceeded' | 'engine_not_ready' | 'model_not_ready';
|
|
13
|
+
export interface EngineFailure {
|
|
14
|
+
code: EngineFailureCode | 'provider_error';
|
|
15
|
+
type: 'server_error' | 'invalid_request_error';
|
|
16
|
+
status: 400 | 500;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Stand-ins for an engine failure's own message wherever a response body must
|
|
20
|
+
* not carry internal detail (the service's opaque-error middleware). The
|
|
21
|
+
* provider's message can name binaries and model paths.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ENGINE_FAILURE_SUMMARIES: Readonly<Record<EngineFailureCode, string>>;
|
|
24
|
+
export declare function isEngineFailureCode(value: unknown): value is EngineFailureCode;
|
|
25
|
+
export declare function engineFailure(err: unknown): EngineFailure;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenAI-compatible routes' vocabulary for an on-device engine failure.
|
|
3
|
+
*
|
|
4
|
+
* Providers already throw typed errors that say exactly what went wrong: the
|
|
5
|
+
* capacity broker refused the model's memory, the engine crashed, the prompt
|
|
6
|
+
* overflowed its context. These routes kept only the message and stamped every
|
|
7
|
+
* one `provider_error`, so a connected app could not tell "this machine cannot
|
|
8
|
+
* fit the model" from "try again in a second" without parsing prose — and the
|
|
9
|
+
* prose is exactly what a sanitizing proxy strips. Each internal code maps to
|
|
10
|
+
* one stable wire code here; anything unrecognized stays `provider_error`.
|
|
11
|
+
*/
|
|
12
|
+
/** Internal error `code` (as thrown) → wire code (as sent). */
|
|
13
|
+
const WIRE_CODES = new Map([
|
|
14
|
+
['capacity-denied', 'capacity_denied'],
|
|
15
|
+
['engine-busy', 'engine_busy'],
|
|
16
|
+
['engine-launch', 'engine_launch_failed'],
|
|
17
|
+
['native-engine-crash', 'engine_crashed'],
|
|
18
|
+
['context-overflow', 'context_length_exceeded'],
|
|
19
|
+
['engine-not-ready', 'engine_not_ready'],
|
|
20
|
+
['model-not-ready', 'model_not_ready'],
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Stand-ins for an engine failure's own message wherever a response body must
|
|
24
|
+
* not carry internal detail (the service's opaque-error middleware). The
|
|
25
|
+
* provider's message can name binaries and model paths.
|
|
26
|
+
*/
|
|
27
|
+
export const ENGINE_FAILURE_SUMMARIES = {
|
|
28
|
+
capacity_denied: 'This machine does not have enough free memory to run this model right now.',
|
|
29
|
+
engine_busy: 'The on-device engine is busy with another request. Try again shortly.',
|
|
30
|
+
engine_launch_failed: 'The on-device engine could not be started on this machine.',
|
|
31
|
+
engine_crashed: 'The on-device engine stopped unexpectedly. Try again.',
|
|
32
|
+
engine_out_of_memory: 'This computer ran out of memory and the on-device engine was stopped. Close other programs or use a smaller model, then try again.',
|
|
33
|
+
context_length_exceeded: 'The prompt is longer than this model can read at once.',
|
|
34
|
+
engine_not_ready: 'The on-device engine is still getting ready. Try again shortly.',
|
|
35
|
+
model_not_ready: 'This model is not ready yet.',
|
|
36
|
+
};
|
|
37
|
+
export function isEngineFailureCode(value) {
|
|
38
|
+
return typeof value === 'string' && Object.hasOwn(ENGINE_FAILURE_SUMMARIES, value);
|
|
39
|
+
}
|
|
40
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
41
|
+
/**
|
|
42
|
+
* The outermost recognized code wins: a wrapper such as
|
|
43
|
+
* `NativeEngineCrashedError` is the provider's own classification of the
|
|
44
|
+
* cause it carries.
|
|
45
|
+
*/
|
|
46
|
+
function internalCode(err) {
|
|
47
|
+
const seen = new Set();
|
|
48
|
+
let current = err;
|
|
49
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth++) {
|
|
50
|
+
if (!current || typeof current !== 'object' || seen.has(current))
|
|
51
|
+
return undefined;
|
|
52
|
+
seen.add(current);
|
|
53
|
+
const code = current.code;
|
|
54
|
+
const wire = typeof code === 'string' ? WIRE_CODES.get(code) : undefined;
|
|
55
|
+
// A crash the out-of-memory killer caused is a capacity fact, not a fault.
|
|
56
|
+
if (wire === 'engine_crashed' &&
|
|
57
|
+
current.panicKind === 'host-out-of-memory') {
|
|
58
|
+
return 'engine_out_of_memory';
|
|
59
|
+
}
|
|
60
|
+
if (wire)
|
|
61
|
+
return wire;
|
|
62
|
+
current = current.cause;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
export function engineFailure(err) {
|
|
67
|
+
const code = internalCode(err);
|
|
68
|
+
if (!code)
|
|
69
|
+
return { code: 'provider_error', type: 'server_error', status: 500 };
|
|
70
|
+
// OpenAI's own spelling and status for an over-long prompt. A 500 makes
|
|
71
|
+
// every SDK retry a request that cannot fit no matter how often it is sent.
|
|
72
|
+
if (code === 'context_length_exceeded') {
|
|
73
|
+
return { code, type: 'invalid_request_error', status: 400 };
|
|
74
|
+
}
|
|
75
|
+
return { code, type: 'server_error', status: 500 };
|
|
76
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { engineFailure } from './engine-failure.js';
|
|
2
3
|
import { unwrapCustomToolInput } from './responses-translate.js';
|
|
3
4
|
const DEFAULT_LIMITS = {
|
|
4
5
|
maxOutputTextChars: 4_000_000,
|
|
@@ -673,7 +674,7 @@ export async function runResponsesStreaming(session, prompt, echoModel, sink, no
|
|
|
673
674
|
}
|
|
674
675
|
catch (error) {
|
|
675
676
|
options.onProviderError?.(error);
|
|
676
|
-
enqueue(serializer.fail('The model provider failed while generating this response.',
|
|
677
|
+
enqueue(serializer.fail('The model provider failed while generating this response.', engineFailure(error).code));
|
|
677
678
|
}
|
|
678
679
|
finally {
|
|
679
680
|
unsubscribeDelta();
|
|
@@ -134,8 +134,8 @@ export declare const ResponsesRequestSchema: z.ZodObject<{
|
|
|
134
134
|
}, z.core.$loose>]>>>;
|
|
135
135
|
tool_choice: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
136
136
|
none: "none";
|
|
137
|
-
auto: "auto";
|
|
138
137
|
required: "required";
|
|
138
|
+
auto: "auto";
|
|
139
139
|
}>, z.ZodObject<{
|
|
140
140
|
type: z.ZodEnum<{
|
|
141
141
|
function: "function";
|
|
@@ -121,8 +121,8 @@ export declare const ChatCompletionRequestSchema: z.ZodObject<{
|
|
|
121
121
|
}, z.core.$strip>>>;
|
|
122
122
|
tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
123
123
|
none: "none";
|
|
124
|
-
auto: "auto";
|
|
125
124
|
required: "required";
|
|
125
|
+
auto: "auto";
|
|
126
126
|
}>, z.ZodObject<{
|
|
127
127
|
type: z.ZodLiteral<"function">;
|
|
128
128
|
function: z.ZodObject<{
|
|
@@ -6,6 +6,8 @@ import { streamSSE } from 'hono/streaming';
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { effectiveEngineRelease, isEnginePinned, pinnedEngineArchiveBytes, } from '../../engines/native-manifest.js';
|
|
8
8
|
import { KNOWN_ENGINES, isKnownEngine } from '../../engines/registry.js';
|
|
9
|
+
import { llamaBackendHealthView } from '../../providers/llama-cpp/backend-health.js';
|
|
10
|
+
import { isLlamaBackend, liftLlamaQuarantine, llamaQuarantineView, } from '../../providers/llama-cpp/backend-quarantine.js';
|
|
9
11
|
import { EngineBusyError } from '../../providers/native/capacity-broker.js';
|
|
10
12
|
import { invalidateModelsCache } from '../model-inventory-cache.js';
|
|
11
13
|
import { isMachineEngineProvider, machineEngineProxy } from './machine-engine-proxy.js';
|
|
@@ -212,6 +214,39 @@ export function enginesRoutes(ctx) {
|
|
|
212
214
|
}
|
|
213
215
|
return c.json({ policy: effective });
|
|
214
216
|
});
|
|
217
|
+
/**
|
|
218
|
+
* llama-server builds switched off on this machine after crashing while
|
|
219
|
+
* starting, and the undo behind the engine's Settings tab. Engine-owner
|
|
220
|
+
* state like the policies above: the quarantine file lives in the home of
|
|
221
|
+
* the process that launches the engines, so packaged user daemons proxy
|
|
222
|
+
* this to the machine engine.
|
|
223
|
+
*/
|
|
224
|
+
app.get('/llama-cpp/quarantine', (c) => c.json(llamaQuarantineView(ctx.home)));
|
|
225
|
+
/**
|
|
226
|
+
* Whether llama-server is getting this machine's hardware: a CUDA build the
|
|
227
|
+
* driver cannot run, a GPU build that started without its GPU, the
|
|
228
|
+
* out-of-memory killer. Engine-owner state, proxied like the quarantine.
|
|
229
|
+
*/
|
|
230
|
+
app.get('/llama-cpp/backend-health', (c) => c.json(llamaBackendHealthView()));
|
|
231
|
+
app.delete('/llama-cpp/quarantine/:backend', async (c) => {
|
|
232
|
+
const backend = c.req.param('backend');
|
|
233
|
+
if (!isLlamaBackend(backend)) {
|
|
234
|
+
return c.json({ error: 'backend must be "cuda", "vulkan", "metal", or "cpu"' }, 400);
|
|
235
|
+
}
|
|
236
|
+
const override = (await ctx.store.readConfig()).llamaCppBackendOverride;
|
|
237
|
+
const { restored } = liftLlamaQuarantine(ctx.home, backend, {
|
|
238
|
+
pinned: override !== undefined && override !== 'auto',
|
|
239
|
+
});
|
|
240
|
+
if (restored) {
|
|
241
|
+
log.info(`llama-server ${backend} quarantine lifted; next launch uses ${restored.path}`);
|
|
242
|
+
// Engines resolve their binary when the provider is built, so a resident
|
|
243
|
+
// engine keeps running the fallback until it restarts. Same soft reset
|
|
244
|
+
// as the policies above: idle engines go now, busy ones after their turn.
|
|
245
|
+
invalidateModelsCache();
|
|
246
|
+
await ctx.chat.resetClient({ deferBusy: true });
|
|
247
|
+
}
|
|
248
|
+
return c.json(llamaQuarantineView(ctx.home));
|
|
249
|
+
});
|
|
215
250
|
/**
|
|
216
251
|
* Per-model context overrides (Settings → Local models → Context size…).
|
|
217
252
|
* Engine-owner state like the sizing policy above — packaged user daemons
|
|
@@ -10,6 +10,7 @@ import { EXTERNAL_CONVERSATION_ID_HEADER, EXTERNAL_PROJECT_HEADER, EXTERNAL_WORK
|
|
|
10
10
|
import { appendCallerOwnedActionLedger } from '../openai-compat/action-ledger.js';
|
|
11
11
|
import { profileForCallerOwnedInference } from '../openai-compat/caller-owned-profile.js';
|
|
12
12
|
import { resolveChatTarget, resolveFallbackGezelId, resolvePinnedModelTarget, } from '../openai-compat/chat-target.js';
|
|
13
|
+
import { engineFailure } from '../openai-compat/engine-failure.js';
|
|
13
14
|
import { overlayOpenAiRequestTuning } from '../openai-compat/request-tuning.js';
|
|
14
15
|
import { createStreamingDiagnostics, snapshotStreamingDiagnostics, } from '../openai-compat/streaming-telemetry.js';
|
|
15
16
|
import { runNonStreaming, runStreaming } from '../openai-compat/streaming.js';
|
|
@@ -288,7 +289,7 @@ export function v1ChatRoutes(ctx, opts = {}) {
|
|
|
288
289
|
// instruct folds, per-gezel overrides for gezel: targets) applies
|
|
289
290
|
// unconditionally — it's "what the model is" — with the caller's
|
|
290
291
|
// per-request knobs overlaid on top. The behavior `profile` is the
|
|
291
|
-
// supporting layer the
|
|
292
|
+
// supporting layer the Integrations switch gates. Caller-owned
|
|
292
293
|
// inference keeps parsing, grammar, and transcript compatibility but
|
|
293
294
|
// omits interventions which assume Gezel owns the action loop.
|
|
294
295
|
// Best-effort: a resolver failure serves engine defaults rather than
|
|
@@ -536,12 +537,13 @@ export function v1ChatRoutes(ctx, opts = {}) {
|
|
|
536
537
|
clientAborted,
|
|
537
538
|
error: describeErrorChain(err),
|
|
538
539
|
})}`);
|
|
540
|
+
const failure = engineFailure(err);
|
|
539
541
|
await stream
|
|
540
542
|
.writeSSE({
|
|
541
543
|
data: JSON.stringify({
|
|
542
544
|
error: err instanceof UnsupportedResponseFormatError
|
|
543
545
|
? { message, type: 'invalid_request_error', code: err.code }
|
|
544
|
-
: { message, type:
|
|
546
|
+
: { message, type: failure.type, code: failure.code },
|
|
545
547
|
}),
|
|
546
548
|
})
|
|
547
549
|
.catch((sseErr) => {
|
|
@@ -644,6 +646,13 @@ export function v1ChatRoutes(ctx, opts = {}) {
|
|
|
644
646
|
}, 400);
|
|
645
647
|
}
|
|
646
648
|
const message = err instanceof Error ? err.message : String(err);
|
|
649
|
+
// Before the prose checks below: an engine's own message can contain
|
|
650
|
+
// "empty", and a typed failure says more than any substring does.
|
|
651
|
+
const failure = engineFailure(err);
|
|
652
|
+
if (failure.code !== 'provider_error') {
|
|
653
|
+
log.warn(`chat completion failed (${failure.code}): ${message}`);
|
|
654
|
+
return c.json({ error: { message, type: failure.type, code: failure.code } }, failure.status);
|
|
655
|
+
}
|
|
647
656
|
if (message.includes('messages must') ||
|
|
648
657
|
message.includes('empty') ||
|
|
649
658
|
message.includes('cannot be an assistant turn')) {
|
|
@@ -222,6 +222,10 @@ export function v1KnowledgeRoutes(ctx) {
|
|
|
222
222
|
maxResults: 24,
|
|
223
223
|
queryEmbedBudgetMs: 5000,
|
|
224
224
|
catalogs: enabled.map((entry) => entry.ref.catalogId),
|
|
225
|
+
// Let the reranker choose among an article's sections: one passage per
|
|
226
|
+
// article, picked by embedding similarity, sent an infobox in place of
|
|
227
|
+
// the history the person asked about.
|
|
228
|
+
chunksPerDocument: 3,
|
|
225
229
|
});
|
|
226
230
|
c.req.raw.signal.throwIfAborted();
|
|
227
231
|
const candidates = [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { estimateManifestKvBytes, externalGezelModelId, isRecommendedModel, localContextFloorTokens, rateModelsForDevice, resolveDistributionProfile, } from '@bendyline/gezel';
|
|
1
|
+
import { estimateManifestKvBytes, externalGezelModelId, isRecommendedModel, llamaCppBackendExclusion, localContextFloorTokens, rateModelsForDevice, resolveDistributionProfile, } from '@bendyline/gezel';
|
|
2
2
|
import { resolveOnDeviceProvider } from '@bendyline/gezel/native';
|
|
3
3
|
import { Hono } from 'hono';
|
|
4
|
+
import { currentLlamaCppBackend } from '../../providers/llama-cpp/backend-health.js';
|
|
4
5
|
import { CapacityBroker } from '../../providers/native/capacity-broker.js';
|
|
5
6
|
import { detectMemoryProfileCached } from '../../system/memory.js';
|
|
6
7
|
import { appleSystemModel } from '../openai-compat/apple-model.js';
|
|
@@ -59,14 +60,15 @@ function catalogBackend(manifest) {
|
|
|
59
60
|
// Store hosts have no provisioned Python runtime. Only advertise models
|
|
60
61
|
// backed by bundled native engines until a frozen MLX runtime ships.
|
|
61
62
|
const store = resolveDistributionProfile().pythonProvisioning === 'frozen-only';
|
|
63
|
+
const llamaCpp = manifest.llamaCpp && !llamaCppBackendExclusion(manifest.llamaCpp, currentLlamaCppBackend());
|
|
62
64
|
if (store)
|
|
63
|
-
return
|
|
65
|
+
return llamaCpp ? 'llama-cpp' : ds4;
|
|
64
66
|
const preferred = resolveOnDeviceProvider(process.platform, process.arch);
|
|
65
67
|
if (preferred === 'mlx' && manifest.mlx && !manifest.mlx.disabledReason)
|
|
66
68
|
return 'mlx';
|
|
67
|
-
if (preferred === 'llama-cpp' &&
|
|
69
|
+
if (preferred === 'llama-cpp' && llamaCpp)
|
|
68
70
|
return 'llama-cpp';
|
|
69
|
-
if (
|
|
71
|
+
if (llamaCpp)
|
|
70
72
|
return 'llama-cpp';
|
|
71
73
|
if (manifest.mlx && !manifest.mlx.disabledReason && process.platform === 'darwin')
|
|
72
74
|
return 'mlx';
|
|
@@ -9,7 +9,7 @@ import type { InferenceContext } from '../inference-context.js';
|
|
|
9
9
|
* and returns assistant text/tool calls in Responses wire shapes. The route
|
|
10
10
|
* intentionally does not create a Gezel chat session or attach Gezel MCP.
|
|
11
11
|
*
|
|
12
|
-
* In the full service, auth is mounted in `server.ts`: the
|
|
12
|
+
* In the full service, auth is mounted in `server.ts`: the Integrations
|
|
13
13
|
* master switch, bearer authentication, and the `openai` scope all apply. Codex can therefore use
|
|
14
14
|
* an app-scoped token without ever learning the daemon's root credential.
|
|
15
15
|
*/
|
|
@@ -8,6 +8,7 @@ import { ExternalToolsUnsupportedError, ModelNotInstalledError, } from '../../pr
|
|
|
8
8
|
import { appendCallerOwnedActionLedger } from '../openai-compat/action-ledger.js';
|
|
9
9
|
import { profileForCallerOwnedInference } from '../openai-compat/caller-owned-profile.js';
|
|
10
10
|
import { resolveChatTarget, resolvePinnedModelTarget, } from '../openai-compat/chat-target.js';
|
|
11
|
+
import { engineFailure } from '../openai-compat/engine-failure.js';
|
|
11
12
|
import { runResponsesNonStreaming, runResponsesStreaming, } from '../openai-compat/responses-streaming.js';
|
|
12
13
|
import { ResponsesRequestSchema, translateResponsesRequest, } from '../openai-compat/responses-translate.js';
|
|
13
14
|
import { flattenTranscriptIntoPrompt, parseGezelModelRef, resolveModelTarget, } from '../openai-compat/translate.js';
|
|
@@ -221,7 +222,7 @@ export function v1ResponsesRoutes(ctx, opts = {}) {
|
|
|
221
222
|
event: 'error',
|
|
222
223
|
data: JSON.stringify({
|
|
223
224
|
type: 'error',
|
|
224
|
-
code:
|
|
225
|
+
code: engineFailure(err).code,
|
|
225
226
|
message: 'The response stream ended unexpectedly.',
|
|
226
227
|
param: null,
|
|
227
228
|
}),
|
|
@@ -264,6 +265,11 @@ export function v1ResponsesRoutes(ctx, opts = {}) {
|
|
|
264
265
|
return invalidRequest(c, err.message, err.code);
|
|
265
266
|
}
|
|
266
267
|
const message = err instanceof Error ? err.message : String(err);
|
|
268
|
+
const failure = engineFailure(err);
|
|
269
|
+
if (failure.code !== 'provider_error') {
|
|
270
|
+
log.warn(`Responses request failed (${failure.code}): ${message}`);
|
|
271
|
+
return c.json({ error: { message, type: failure.type, code: failure.code } }, failure.status);
|
|
272
|
+
}
|
|
267
273
|
if (message.includes('messages must') ||
|
|
268
274
|
message.includes('empty') ||
|
|
269
275
|
message.includes('cannot be an assistant turn')) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProviderName } from '@bendyline/gezel';
|
|
1
|
+
import { type LogOutput, type ProviderName } from '@bendyline/gezel';
|
|
2
2
|
import type { LLMProvider } from './providers/types.js';
|
|
3
3
|
import './http/auth-context.js';
|
|
4
4
|
/** Same shape the full service reports, so one handler serves either host. */
|
|
@@ -15,6 +15,11 @@ export interface InferenceServiceOptions {
|
|
|
15
15
|
/** Host-provided local providers, useful for testing without downloading weights. */
|
|
16
16
|
providers?: ReadonlyMap<ProviderName, LLMProvider>;
|
|
17
17
|
onUnexpectedHttpError?: (event: InferenceHttpErrorEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Where log records go while this host runs; restored on `stop()`. An app
|
|
20
|
+
* embedding the host passes `'stderr'` so its own stdout stays its own.
|
|
21
|
+
*/
|
|
22
|
+
logOutput?: LogOutput;
|
|
18
23
|
}
|
|
19
24
|
export interface RunningInferenceService {
|
|
20
25
|
readonly profile: 'embedded-inference';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { GEZEL_API_GENERATION, GEZEL_API_GENERATION_FLOOR, GEZEL_VERSION, GezelConfigSchema, createLogger, nowIso, startSuspendMonitor, stopSuspendMonitor, } from '@bendyline/gezel';
|
|
3
|
+
import { GEZEL_API_GENERATION, GEZEL_API_GENERATION_FLOOR, GEZEL_VERSION, GezelConfigSchema, createLogger, getLogOutput, nowIso, setLogOutput, startSuspendMonitor, stopSuspendMonitor, } from '@bendyline/gezel';
|
|
4
4
|
import { BundledSource, CatalogService } from '@bendyline/gezel-catalog';
|
|
5
5
|
import { discoverNativeBinaries } from '@bendyline/gezel/native';
|
|
6
6
|
import { gezelHome } from '@bendyline/gezel/paths';
|
|
@@ -35,16 +35,27 @@ import './http/auth-context.js';
|
|
|
35
35
|
const log = createLogger('inference');
|
|
36
36
|
/** Direct Fetch host: no listener, product store, background downloads or daemon discovery. */
|
|
37
37
|
export async function startService(options = {}) {
|
|
38
|
+
const previousLogOutput = getLogOutput();
|
|
39
|
+
const restoreLogOutput = () => setLogOutput(previousLogOutput);
|
|
40
|
+
if (options.logOutput)
|
|
41
|
+
setLogOutput(options.logOutput);
|
|
38
42
|
const home = options.home ?? gezelHome();
|
|
39
|
-
await ensurePrivateUserHome(home);
|
|
40
|
-
// Model files must land in this home's managed cache: unset, transformers.js
|
|
41
|
-
// falls back to a module-relative cache that is read-only inside a packaged
|
|
42
|
-
// app, and the embed worker (which reads this env) has no other view of home.
|
|
43
|
-
process.env[HF_CACHE_DIR_ENV] ??= transformersCacheDir(home);
|
|
44
|
-
const startedAt = nowIso();
|
|
45
43
|
const runtimeDir = join(home, 'runtime');
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let lock;
|
|
45
|
+
try {
|
|
46
|
+
await ensurePrivateUserHome(home);
|
|
47
|
+
// Model files must land in this home's managed cache: unset, transformers.js
|
|
48
|
+
// falls back to a module-relative cache that is read-only inside a packaged
|
|
49
|
+
// app, and the embed worker (which reads this env) has no other view of home.
|
|
50
|
+
process.env[HF_CACHE_DIR_ENV] ??= transformersCacheDir(home);
|
|
51
|
+
lock = await acquireSingleInstanceLock({ runtimeDir, lockPath: join(runtimeDir, 'lock') });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
restoreLogOutput();
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
const startedAt = nowIso();
|
|
58
|
+
const cleanup = [restoreLogOutput, () => lock.release()];
|
|
48
59
|
const requests = new InFlightRequests();
|
|
49
60
|
let stopping;
|
|
50
61
|
let closed = false;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* (docs/gezk-format.md). The in-process implementation is test/CLI-only;
|
|
8
8
|
* production fails closed if its worker becomes unavailable.
|
|
9
9
|
*/
|
|
10
|
-
import type { CatalogAssetFile, CatalogAssetInfo, CatalogAssetRead, CatalogChunkHit, CatalogDocumentMeta, CatalogTopic, CatalogValidationReport } from '@bendyline/gezel-knowledge';
|
|
10
|
+
import type { CatalogAssetFile, CatalogAssetInfo, CatalogAssetRead, CatalogChunkHit, CatalogDocumentInitial, CatalogDocumentMeta, CatalogTopic, CatalogValidationReport } from '@bendyline/gezel-knowledge';
|
|
11
11
|
import type { KnowledgeRadius } from '@bendyline/gezel';
|
|
12
12
|
import type { SpatialMatch } from '@bendyline/gezel-knowledge';
|
|
13
13
|
export interface MountSpec {
|
|
@@ -78,6 +78,14 @@ export interface KnowledgeCatalogHost {
|
|
|
78
78
|
documents: CatalogDocumentMeta[];
|
|
79
79
|
total: number;
|
|
80
80
|
}>;
|
|
81
|
+
documentInitials(key: string, opts: {
|
|
82
|
+
topicId?: string;
|
|
83
|
+
descendants?: boolean;
|
|
84
|
+
}): Promise<CatalogDocumentInitial[]>;
|
|
85
|
+
documentPosition(key: string, documentId: string, opts: {
|
|
86
|
+
topicId?: string;
|
|
87
|
+
descendants?: boolean;
|
|
88
|
+
}): Promise<number | null>;
|
|
81
89
|
nearbyDocuments(key: string, radius: KnowledgeRadius, opts: {
|
|
82
90
|
offset?: number;
|
|
83
91
|
limit?: number;
|
|
@@ -158,6 +158,8 @@ export async function createInProcessCatalogHost() {
|
|
|
158
158
|
validate: async (rootDir, deep) => validateExtractedCatalog(rootDir, { deep }),
|
|
159
159
|
topics: async (key) => mustGet(handles, key).topics(),
|
|
160
160
|
documentsPage: async (key, opts) => mustGet(handles, key).documentsPage(opts),
|
|
161
|
+
documentInitials: async (key, opts) => mustGet(handles, key).documentInitials(opts),
|
|
162
|
+
documentPosition: async (key, documentId, opts) => mustGet(handles, key).documentPosition(documentId, opts),
|
|
161
163
|
nearbyDocuments: async (key, radius, opts) => mustGet(handles, key).nearbyDocuments(radius, opts),
|
|
162
164
|
getDocument: async (key, documentId) => mustGet(handles, key).getDocument(documentId),
|
|
163
165
|
getChunk: async (key, documentId, chunkUid) => mustGet(handles, key).getChunk(documentId, chunkUid),
|
|
@@ -121,6 +121,12 @@ export declare class KnowledgeManager {
|
|
|
121
121
|
* what the Knowledge screen's browser renders. Offline-safe: gilde is local.
|
|
122
122
|
*/
|
|
123
123
|
available(): Promise<KnowledgeAvailableCatalog[]>;
|
|
124
|
+
/**
|
|
125
|
+
* The search model an install of a catalog with this profile would also
|
|
126
|
+
* download. None when the catalog searches with the daemon's own embedder
|
|
127
|
+
* (an install never fetches that) or the profile's pinned files are cached.
|
|
128
|
+
*/
|
|
129
|
+
private searchModelDownloadBytes;
|
|
124
130
|
/** Resolve a catalogId (URI authority) to its mounted info, or null. */
|
|
125
131
|
mountedCatalog(catalogId: string): MountedInfo | null;
|
|
126
132
|
/**
|
|
@@ -206,6 +212,14 @@ export declare class KnowledgeManager {
|
|
|
206
212
|
limit?: number;
|
|
207
213
|
descendants?: boolean;
|
|
208
214
|
}): ReturnType<KnowledgeCatalogHost['documentsPage']>;
|
|
215
|
+
documentInitials(catalogId: string, opts: {
|
|
216
|
+
topicId?: string;
|
|
217
|
+
descendants?: boolean;
|
|
218
|
+
}): ReturnType<KnowledgeCatalogHost['documentInitials']>;
|
|
219
|
+
documentPosition(catalogId: string, documentId: string, opts: {
|
|
220
|
+
topicId?: string;
|
|
221
|
+
descendants?: boolean;
|
|
222
|
+
}): ReturnType<KnowledgeCatalogHost['documentPosition']>;
|
|
209
223
|
getDocument(catalogId: string, documentId: string): ReturnType<KnowledgeCatalogHost['getDocument']>;
|
|
210
224
|
/** One passage by its citation id, with the document's title and origin. */
|
|
211
225
|
getPassage(catalogId: string, documentId: string, chunkUid: string): Promise<KnowledgePassageRead | null>;
|
|
@@ -246,6 +260,13 @@ export declare class KnowledgeManager {
|
|
|
246
260
|
* their own. Explicit search asks; proactive injection does not.
|
|
247
261
|
*/
|
|
248
262
|
media?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Also return up to this many of a document's other passages that the
|
|
265
|
+
* search found, after its best one. Fusion otherwise keeps one passage
|
|
266
|
+
* per document, chosen by vector similarity alone, so an article's name-
|
|
267
|
+
* dense infobox can stand in for the section a reranker would choose.
|
|
268
|
+
*/
|
|
269
|
+
chunksPerDocument?: number;
|
|
249
270
|
}): Promise<UnifiedSearchResult[]>;
|
|
250
271
|
/** A document the lexical arms named but no chunk carries: cite it with its lead paragraph. */
|
|
251
272
|
private toDocumentResult;
|