@bendyline/gezel-inference 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/cache/controller.d.ts +2 -0
  2. package/dist/cache/controller.js +38 -5
  3. package/dist/catalog/chat-models/index.json +1 -1
  4. package/dist/catalog/chat-models/lf/lfm3-1.7b-q4/manifest.json +114 -0
  5. package/dist/catalog/chat-models/lf/lfm3-1.7b-q4/versions/1.0.0/manifest.json +15 -0
  6. package/dist/catalog/chat-models/raw-index.json +1 -1
  7. package/dist/catalog/image-loras/index.json +1 -0
  8. package/dist/catalog/image-loras/kr/krea-2-ink-wash/manifest.json +31 -0
  9. package/dist/catalog/image-loras/kr/krea-2-ink-wash/versions/1.0.0/manifest.json +15 -0
  10. package/dist/catalog/image-loras/kr/krea-2-isometric-3d/manifest.json +32 -0
  11. package/dist/catalog/image-loras/kr/krea-2-isometric-3d/versions/1.0.0/manifest.json +15 -0
  12. package/dist/catalog/image-loras/kr/krea-2-kids-drawing/manifest.json +31 -0
  13. package/dist/catalog/image-loras/kr/krea-2-kids-drawing/versions/1.0.0/manifest.json +15 -0
  14. package/dist/catalog/image-loras/kr/krea-2-pixel-art/manifest.json +31 -0
  15. package/dist/catalog/image-loras/kr/krea-2-pixel-art/versions/1.0.0/manifest.json +15 -0
  16. package/dist/catalog/image-loras/kr/krea-2-soft-watercolor/manifest.json +31 -0
  17. package/dist/catalog/image-loras/kr/krea-2-soft-watercolor/versions/1.0.0/manifest.json +15 -0
  18. package/dist/catalog/image-loras/kr/krea-2-turbo-4step/manifest.json +31 -0
  19. package/dist/catalog/image-loras/kr/krea-2-turbo-4step/versions/1.0.0/manifest.json +15 -0
  20. package/dist/catalog/image-loras/mo/moss-image-gouache/manifest.json +29 -0
  21. package/dist/catalog/image-loras/mo/moss-image-gouache/versions/1.0.0/manifest.json +15 -0
  22. package/dist/catalog/image-loras/mo/moss-image-sft-4step/manifest.json +30 -0
  23. package/dist/catalog/image-loras/mo/moss-image-sft-4step/versions/1.0.0/manifest.json +15 -0
  24. package/dist/catalog/image-loras/qw/qwen-image-edit-2511-lightning/manifest.json +31 -0
  25. package/dist/catalog/image-loras/qw/qwen-image-edit-2511-lightning/versions/1.0.0/manifest.json +15 -0
  26. package/dist/catalog/image-loras/raw-index.json +1 -0
  27. package/dist/catalog/image-loras/sd/sdxl-3d-render/manifest.json +29 -0
  28. package/dist/catalog/image-loras/sd/sdxl-3d-render/versions/1.0.0/manifest.json +15 -0
  29. package/dist/catalog/image-loras/sd/sdxl-coloring-book/manifest.json +30 -0
  30. package/dist/catalog/image-loras/sd/sdxl-coloring-book/versions/1.0.0/manifest.json +15 -0
  31. package/dist/catalog/image-loras/sd/sdxl-papercut/manifest.json +29 -0
  32. package/dist/catalog/image-loras/sd/sdxl-papercut/versions/1.0.0/manifest.json +15 -0
  33. package/dist/catalog/image-loras/sd/sdxl-pixel-art/manifest.json +29 -0
  34. package/dist/catalog/image-loras/sd/sdxl-pixel-art/versions/1.0.0/manifest.json +15 -0
  35. package/dist/catalog/image-models/fl/flux-2-klein-4b-q4/manifest.json +3 -0
  36. package/dist/catalog/image-models/index.json +1 -1
  37. package/dist/catalog/image-models/qw/qwen-image-edit-2511-q4/manifest.json +44 -0
  38. package/dist/catalog/image-models/qw/qwen-image-edit-2511-q4/versions/1.0.0/manifest.json +36 -0
  39. package/dist/catalog/image-models/raw-index.json +1 -1
  40. package/dist/catalog/knowledge-catalogs/index.json +1 -1
  41. package/dist/catalog/knowledge-catalogs/raw-index.json +1 -1
  42. package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.10.2/manifest.json +181 -0
  43. package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.10.2/manifest.json +181 -0
  44. package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.10.2/manifest.json +217 -0
  45. package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.10.2/manifest.json +197 -0
  46. package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.10.2/manifest.json +197 -0
  47. package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.10.2/manifest.json +185 -0
  48. package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.10.2/manifest.json +181 -0
  49. package/dist/catalog/knowledge-catalogs/wi/wikipedia-general/manifest.json +55 -0
  50. package/dist/catalog/knowledge-catalogs/wi/wikipedia-general/versions/2026.10.2/manifest.json +165 -0
  51. package/dist/catalog/knowledge-catalogs/wi/wikipedia-geography/versions/2026.10.2/manifest.json +217 -0
  52. package/dist/catalog/knowledge-catalogs/wi/wikipedia-history/versions/2026.10.2/manifest.json +217 -0
  53. package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.10.2/manifest.json +181 -0
  54. package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.10.2/manifest.json +185 -0
  55. package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.10.2/manifest.json +193 -0
  56. package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.10.2/manifest.json +189 -0
  57. package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.10.2/manifest.json +185 -0
  58. package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.10.2/manifest.json +189 -0
  59. package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.10.2/manifest.json +197 -0
  60. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-arts/versions/2026.10.2/manifest.json +209 -0
  61. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-business/versions/2026.10.2/manifest.json +189 -0
  62. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-entertainment/versions/2026.10.2/manifest.json +201 -0
  63. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-military/versions/2026.10.2/manifest.json +185 -0
  64. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-other/versions/2026.10.2/manifest.json +165 -0
  65. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-politics/versions/2026.10.2/manifest.json +197 -0
  66. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-religion/versions/2026.10.2/manifest.json +201 -0
  67. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-science/versions/2026.10.2/manifest.json +205 -0
  68. package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-sports/versions/2026.10.2/manifest.json +237 -0
  69. package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.10.2/manifest.json +197 -0
  70. package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.10.2/manifest.json +189 -0
  71. package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.10.2/manifest.json +185 -0
  72. package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.10.2/manifest.json +193 -0
  73. package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.10.2/manifest.json +185 -0
  74. package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.10.2/manifest.json +189 -0
  75. package/dist/catalog/provenance.json +2 -1
  76. package/dist/engine-components.js +2 -2
  77. package/dist/engines/electron-native-reuse.d.ts +7 -1
  78. package/dist/engines/electron-native-reuse.js +12 -4
  79. package/dist/engines/native-file-manifest.json +546 -406
  80. package/dist/engines/native-manifest.d.ts +4 -4
  81. package/dist/engines/native-manifest.js +36 -36
  82. package/dist/engines/resolver.js +1 -0
  83. package/dist/http/auth-context.d.ts +12 -0
  84. package/dist/http/routes/image-ensure-routes.d.ts +4 -0
  85. package/dist/http/routes/image-ensure-routes.js +102 -0
  86. package/dist/http/routes/v1-image-styles.d.ts +5 -0
  87. package/dist/http/routes/v1-image-styles.js +91 -0
  88. package/dist/http/routes/v1-images.d.ts +1 -0
  89. package/dist/http/routes/v1-images.js +15 -93
  90. package/dist/inference-service.js +2 -1
  91. package/dist/knowledge/worker-host.js +2 -0
  92. package/dist/machine-engine/inspect-runtime.js +12 -3
  93. package/dist/memory/embed-core.js +3 -0
  94. package/dist/memory/embeddings.js +2 -0
  95. package/dist/models/image-fit.js +2 -2
  96. package/dist/models/weight-facts.d.ts +5 -0
  97. package/dist/models/weight-facts.js +5 -2
  98. package/dist/providers/ds4/build-provider.js +1 -1
  99. package/dist/providers/ds4/residency.js +3 -3
  100. package/dist/providers/image/img2img-support.d.ts +36 -1
  101. package/dist/providers/image/img2img-support.js +30 -1
  102. package/dist/providers/image/local-engine.d.ts +1 -0
  103. package/dist/providers/image/local-engine.js +8 -2
  104. package/dist/providers/image/local-factory.d.ts +10 -1
  105. package/dist/providers/image/local-factory.js +33 -6
  106. package/dist/providers/image/mock.d.ts +8 -1
  107. package/dist/providers/image/mock.js +46 -1
  108. package/dist/providers/image/pull-registry.d.ts +25 -3
  109. package/dist/providers/image/pull-registry.js +96 -34
  110. package/dist/providers/image/sd-cpp.d.ts +63 -4
  111. package/dist/providers/image/sd-cpp.js +361 -38
  112. package/dist/providers/image/types.d.ts +76 -4
  113. package/dist/providers/image/types.js +8 -0
  114. package/dist/providers/llama-cpp/build-provider.js +3 -2
  115. package/dist/providers/llama-cpp/cache-adapter.d.ts +3 -0
  116. package/dist/providers/llama-cpp/cache-adapter.js +18 -4
  117. package/dist/providers/llama-cpp/devices.js +2 -2
  118. package/dist/providers/llama-cpp/engine-flags.d.ts +5 -0
  119. package/dist/providers/llama-cpp/engine-flags.js +5 -2
  120. package/dist/providers/mlx/provider.js +13 -4
  121. package/dist/providers/mlx/python/gezel_mlx_server.py +9 -2
  122. package/dist/providers/mlx/python/spec_decode.py +44 -5
  123. package/dist/providers/native/capacity-broker.d.ts +1 -1
  124. package/dist/providers/native/capacity-broker.js +8 -8
  125. package/dist/providers/native/capacity-budget.js +5 -4
  126. package/dist/providers/native/device-capacity-ledger.d.ts +2 -0
  127. package/dist/providers/native/device-capacity-ledger.js +36 -5
  128. package/dist/providers/native/device-capacity.js +4 -3
  129. package/dist/providers/native/local-engine-runtime.js +4 -4
  130. package/dist/providers/native/process-identity.d.ts +2 -0
  131. package/dist/providers/native/process-identity.js +70 -0
  132. package/dist/relevance/relevance-core.js +2 -0
  133. package/dist/relevance/relevance-model.js +2 -0
  134. package/dist/relevance/settings.js +2 -2
  135. package/dist/runtime-lock.d.ts +43 -5
  136. package/dist/runtime-lock.js +189 -26
  137. package/dist/system/host-memory.d.ts +46 -0
  138. package/dist/system/host-memory.js +89 -0
  139. package/dist/system/memory.js +5 -4
  140. package/dist/transformers-cache.js +2 -0
  141. package/dist/utils/download-common.d.ts +1 -1
  142. package/package.json +8 -8
@@ -203,6 +203,7 @@ export declare class SessionCacheController {
203
203
  * call manually via `reconcileProvider`.
204
204
  */
205
205
  reconcileProvider(providerName: string): Promise<void>;
206
+ private reconcileState;
206
207
  /** Stop the background reconcile timer. Call on shutdown. */
207
208
  stop(): void;
208
209
  /**
@@ -213,5 +214,6 @@ export declare class SessionCacheController {
213
214
  * boundary.
214
215
  */
215
216
  private enforceBudget;
217
+ private evictOverBudget;
216
218
  private reconcileAll;
217
219
  }
@@ -314,6 +314,23 @@ export class SessionCacheController {
314
314
  const state = this.providers.get(providerName);
315
315
  if (!state)
316
316
  return;
317
+ if (state.reconciliation)
318
+ return state.reconciliation;
319
+ const work = this.reconcileState(providerName, state);
320
+ state.reconciliation = work;
321
+ try {
322
+ await work;
323
+ }
324
+ finally {
325
+ if (state.reconciliation === work)
326
+ state.reconciliation = undefined;
327
+ }
328
+ }
329
+ async reconcileState(providerName, state) {
330
+ // A slow snapshot must not be rediscovered and queued for eviction every tick.
331
+ await state.eviction;
332
+ if (this.providers.get(providerName) !== state)
333
+ return;
317
334
  let usage;
318
335
  try {
319
336
  usage = await state.adapter.reportUsage();
@@ -322,6 +339,8 @@ export class SessionCacheController {
322
339
  this.logger.warn?.(`[cache] reportUsage failed for ${providerName}: ${err}`);
323
340
  return;
324
341
  }
342
+ if (this.providers.get(providerName) !== state)
343
+ return;
325
344
  // Replace the entries map — adapter's view wins. We preserve
326
345
  // eviction priority across the rebuild (operator pinning shouldn't
327
346
  // be lost on reconcile).
@@ -358,6 +377,23 @@ export class SessionCacheController {
358
377
  const state = this.providers.get(providerName);
359
378
  if (!state)
360
379
  return;
380
+ if (state.eviction)
381
+ return state.eviction;
382
+ const work = this.evictOverBudget(providerName, state);
383
+ if (!work)
384
+ return;
385
+ state.eviction = work;
386
+ try {
387
+ await work;
388
+ }
389
+ finally {
390
+ if (state.eviction === work)
391
+ state.eviction = undefined;
392
+ }
393
+ if (this.providers.get(providerName) === state)
394
+ await this.enforceBudget(providerName);
395
+ }
396
+ evictOverBudget(providerName, state) {
361
397
  let totalBytes = 0;
362
398
  for (const entry of state.entries.values())
363
399
  totalBytes += entry.bytes;
@@ -386,12 +422,9 @@ export class SessionCacheController {
386
422
  state.entries.delete(id);
387
423
  this.logger.info?.(`[cache] evicted ${toEvict.length} session(s) from ${providerName} ` +
388
424
  `(now ${(totalBytes / (1024 * 1024)).toFixed(1)} MB / ${(state.budgetBytes / (1024 * 1024)).toFixed(0)} MB)`);
389
- try {
390
- await state.adapter.evict(toEvict);
391
- }
392
- catch (err) {
425
+ return state.adapter.evict(toEvict).catch((err) => {
393
426
  this.logger.warn?.(`[cache] adapter.evict failed for ${providerName}: ${err}`);
394
- }
427
+ });
395
428
  }
396
429
  async reconcileAll() {
397
430
  for (const name of this.providers.keys()) {