@elizaos/shared 2.0.3-beta.2 → 2.0.3-beta.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.
Files changed (119) hide show
  1. package/app-hero-art.d.ts.map +1 -1
  2. package/app-hero-art.js +1 -7
  3. package/app-hero-art.js.map +1 -1
  4. package/config/app-config.d.ts +1 -1
  5. package/config/boot-config-store.d.ts +1 -4
  6. package/config/boot-config-store.d.ts.map +1 -1
  7. package/config/boot-config-store.js +1 -45
  8. package/config/boot-config-store.js.map +1 -1
  9. package/contracts/apps.d.ts +9 -2
  10. package/contracts/apps.d.ts.map +1 -1
  11. package/contracts/apps.js +10 -67
  12. package/contracts/apps.js.map +1 -1
  13. package/contracts/conversation-routes.d.ts +0 -4
  14. package/contracts/conversation-routes.d.ts.map +1 -1
  15. package/contracts/conversation-routes.js +0 -1
  16. package/contracts/conversation-routes.js.map +1 -1
  17. package/env-utils.d.ts +10 -1
  18. package/env-utils.d.ts.map +1 -1
  19. package/env-utils.js +7 -9
  20. package/env-utils.js.map +1 -1
  21. package/events.d.ts +2 -0
  22. package/events.d.ts.map +1 -0
  23. package/events.js +2 -0
  24. package/events.js.map +1 -0
  25. package/format-error.d.ts +5 -4
  26. package/format-error.d.ts.map +1 -1
  27. package/format-error.js +5 -6
  28. package/format-error.js.map +1 -1
  29. package/hardware-catalog/index.d.ts +3 -3
  30. package/hardware-catalog/index.d.ts.map +1 -1
  31. package/hardware-catalog/index.js +1 -1
  32. package/index.d.ts +4 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.js +4 -1
  35. package/index.js.map +1 -1
  36. package/local-inference/catalog.d.ts +29 -4
  37. package/local-inference/catalog.d.ts.map +1 -1
  38. package/local-inference/catalog.js +126 -102
  39. package/local-inference/catalog.js.map +1 -1
  40. package/local-inference/device-fit.d.ts +73 -0
  41. package/local-inference/device-fit.d.ts.map +1 -0
  42. package/local-inference/device-fit.js +155 -0
  43. package/local-inference/device-fit.js.map +1 -0
  44. package/local-inference/hf-proxy.d.ts +43 -0
  45. package/local-inference/hf-proxy.d.ts.map +1 -0
  46. package/local-inference/hf-proxy.js +50 -0
  47. package/local-inference/hf-proxy.js.map +1 -0
  48. package/local-inference/hub-auth.d.ts +26 -0
  49. package/local-inference/hub-auth.d.ts.map +1 -0
  50. package/local-inference/hub-auth.js +48 -0
  51. package/local-inference/hub-auth.js.map +1 -0
  52. package/local-inference/index.d.ts +6 -1
  53. package/local-inference/index.d.ts.map +1 -1
  54. package/local-inference/index.js +6 -1
  55. package/local-inference/index.js.map +1 -1
  56. package/local-inference/routing-preferences.d.ts +5 -1
  57. package/local-inference/routing-preferences.d.ts.map +1 -1
  58. package/local-inference/routing-preferences.js +6 -0
  59. package/local-inference/routing-preferences.js.map +1 -1
  60. package/local-inference/runtime-class.d.ts +29 -0
  61. package/local-inference/runtime-class.d.ts.map +1 -0
  62. package/local-inference/runtime-class.js +30 -0
  63. package/local-inference/runtime-class.js.map +1 -0
  64. package/local-inference/types.d.ts +45 -7
  65. package/local-inference/types.d.ts.map +1 -1
  66. package/local-inference/voice-models.d.ts +4 -4
  67. package/local-inference/voice-models.d.ts.map +1 -1
  68. package/local-inference/voice-models.js +42 -19
  69. package/local-inference/voice-models.js.map +1 -1
  70. package/local-inference-gpu/gpu-profile-schema.d.ts +5 -5
  71. package/loopback-trust.d.ts +73 -0
  72. package/loopback-trust.d.ts.map +1 -0
  73. package/loopback-trust.js +241 -0
  74. package/loopback-trust.js.map +1 -0
  75. package/package.json +85 -4
  76. package/settings-debug.d.ts +5 -16
  77. package/settings-debug.d.ts.map +1 -1
  78. package/settings-debug.js +5 -118
  79. package/settings-debug.js.map +1 -1
  80. package/steward-session-client/index.d.ts +5 -27
  81. package/steward-session-client/index.d.ts.map +1 -1
  82. package/steward-session-client/index.js +5 -61
  83. package/steward-session-client/index.js.map +1 -1
  84. package/test-env-config.d.ts +81 -0
  85. package/test-env-config.d.ts.map +1 -0
  86. package/test-env-config.js +125 -0
  87. package/test-env-config.js.map +1 -0
  88. package/transcripts.d.ts +2 -0
  89. package/transcripts.d.ts.map +1 -1
  90. package/transcripts.js.map +1 -1
  91. package/utils/env.d.ts +1 -0
  92. package/utils/env.d.ts.map +1 -1
  93. package/utils/env.js +1 -10
  94. package/utils/env.js.map +1 -1
  95. package/utils/errors.d.ts +2 -1
  96. package/utils/errors.d.ts.map +1 -1
  97. package/utils/errors.js +2 -5
  98. package/utils/errors.js.map +1 -1
  99. package/utils/string-hash.d.ts +11 -0
  100. package/utils/string-hash.d.ts.map +1 -0
  101. package/utils/string-hash.js +17 -0
  102. package/utils/string-hash.js.map +1 -0
  103. package/view-hero-art.d.ts.map +1 -1
  104. package/view-hero-art.js +1 -7
  105. package/view-hero-art.js.map +1 -1
  106. package/voice/owner-inference.d.ts +57 -0
  107. package/voice/owner-inference.d.ts.map +1 -0
  108. package/voice/owner-inference.js +73 -0
  109. package/voice/owner-inference.js.map +1 -0
  110. package/voice/respond-gate.d.ts +88 -0
  111. package/voice/respond-gate.d.ts.map +1 -0
  112. package/voice/respond-gate.js +139 -0
  113. package/voice/respond-gate.js.map +1 -0
  114. package/voice-eot.d.ts +42 -0
  115. package/voice-eot.d.ts.map +1 -0
  116. package/voice-eot.js +158 -0
  117. package/voice-eot.js.map +1 -0
  118. package/voice.d.ts +2 -2
  119. package/voice.js +3 -3
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Device-fit selector for the one forced local model (eliza-1).
3
+ *
4
+ * The product rule (see `packages/ui/docs/local-model-simplification/README.md`):
5
+ * **always run the biggest eliza-1 tier we can, balanced against a 128k context
6
+ * target, with every memory optimization applied** so the floors are as low as
7
+ * physics allows:
8
+ *
9
+ * - **TurboQuant weights** — the catalog `sizeGb` per tier already reflects the
10
+ * TurboQuant-compressed GGUF (e.g. a 2B model is 1.4 GB, not ~4 GB bf16).
11
+ * - **Stock q8_0 KV-cache** — Gemma 4's KV is already minimal by construction
12
+ * (MQA = 1 KV head, windowed sliding-window attention on most layers, and
13
+ * shared-KV layers reusing earlier KV), so a 128k window fits in a fraction
14
+ * of a GB at stock q8_0 without the legacy QJL/Polar kernels. The head_dim=128
15
+ * QJL kernel does not apply to Gemma's dual head dims (512 global / 256 swa)
16
+ * and is not used. KV quant is forced, never a user option.
17
+ *
18
+ * `minRamGb` per tier is therefore "TurboQuant weights + a 128k q8_0 KV cache +
19
+ * runtime/OS overhead". Picking the largest tier whose `minRamGb` fits free RAM
20
+ * is exactly "biggest model that still gets a 128k window".
21
+ *
22
+ * **Dynamic fit-to-RAM context (#8809 M10b).** Picking the largest tier whose
23
+ * static `minRamGb` floor fits is the coarse gate. On top of that we compute the
24
+ * *largest context window that actually fits the device's free RAM* for the
25
+ * chosen tier, from the per-token q8_0 KV rate (`kvBytesPerTokenForTier`) rather
26
+ * than only honouring the catalog ceiling. On a roomy host that is the tier's
27
+ * native window; on a host that clears the weights+overhead floor but not a full
28
+ * 128k cache, the window shrinks to the largest 4k-stepped size that fits. The
29
+ * tier choice never drops below 2B (0.8B is gone); when even a minimum window
30
+ * (`ELIZA_1_MIN_LOCAL_CONTEXT`) cannot fit any tier, we return `null`, which the
31
+ * caller reads as "this modality should route to Cloud" (the AUTO policy).
32
+ */
33
+ import type { Eliza1TierId } from "./catalog.js";
34
+ /** The KV-cache quantization eliza-1 always uses on-device. Gemma 4's KV is
35
+ * already minimal (MQA + windowed-SWA + shared-KV), so stock q8_0 is sufficient;
36
+ * the legacy head_dim=128 QJL kernel is incompatible with Gemma's dual head dims
37
+ * (512 global / 256 swa) and is not used. */
38
+ export declare const ELIZA_1_KV_QUANT: "q8_0";
39
+ /** The consumer context target. We never advertise less than this if it fits. */
40
+ export declare const ELIZA_1_CONTEXT_TARGET = 131072;
41
+ /** Floor below which a cramped local window is worse than routing to Cloud. */
42
+ export declare const ELIZA_1_MIN_LOCAL_CONTEXT = 8192;
43
+ export interface Eliza1Fit {
44
+ /** The chosen tier (always the largest that fits the policy). */
45
+ tierId: Eliza1TierId;
46
+ /** The context window to load — native target when it fits, else downscaled. */
47
+ contextLength: number;
48
+ /** The KV quant to load with (stock q8_0 on-device — Gemma KV is already minimal). */
49
+ kvQuant: typeof ELIZA_1_KV_QUANT;
50
+ /** True when context was reduced below the tier's native window to fit RAM. */
51
+ contextDownscaled: boolean;
52
+ /** Per-token q8_0 KV footprint used to compute the window (bytes). */
53
+ kvBytesPerToken: number;
54
+ /**
55
+ * The largest 4k-stepped window that fits free RAM for this tier at the q8_0
56
+ * KV rate, before clamping to the tier's native ceiling. Equals
57
+ * `contextLength` once clamped on roomy hosts; larger than `contextLength`
58
+ * only when free RAM could hold more than the tier's native window.
59
+ */
60
+ maxFittingContext: number;
61
+ /** Why this tier — surfaced in diagnostics, never as a user control. */
62
+ reason: "native-fit" | "context-downscaled";
63
+ }
64
+ /**
65
+ * Pick the best on-device eliza-1 configuration for a device with `freeRamGb` of
66
+ * usable RAM (Apple-silicon unified RAM, discrete-GPU VRAM, or CPU RAM — the
67
+ * caller normalizes this, e.g. via the device-tier classifier).
68
+ *
69
+ * Returns `null` when nothing acceptable fits locally → the caller routes this
70
+ * modality to Cloud (AUTO). Never returns a tier smaller than 2B (0.8B is gone).
71
+ */
72
+ export declare function selectBestEliza1Fit(freeRamGb: number): Eliza1Fit | null;
73
+ //# sourceMappingURL=device-fit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-fit.d.ts","sourceRoot":"","sources":["../../src/local-inference/device-fit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9C;;;6CAG6C;AAC7C,eAAO,MAAM,gBAAgB,EAAG,MAAe,CAAC;AAEhD,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAE7C,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAuC9C,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,MAAM,EAAE,YAAY,CAAC;IACrB,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,OAAO,EAAE,OAAO,gBAAgB,CAAC;IACjC,+EAA+E;IAC/E,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,MAAM,EAAE,YAAY,GAAG,oBAAoB,CAAC;CAC7C;AAqBD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAuDvE"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Device-fit selector for the one forced local model (eliza-1).
3
+ *
4
+ * The product rule (see `packages/ui/docs/local-model-simplification/README.md`):
5
+ * **always run the biggest eliza-1 tier we can, balanced against a 128k context
6
+ * target, with every memory optimization applied** so the floors are as low as
7
+ * physics allows:
8
+ *
9
+ * - **TurboQuant weights** — the catalog `sizeGb` per tier already reflects the
10
+ * TurboQuant-compressed GGUF (e.g. a 2B model is 1.4 GB, not ~4 GB bf16).
11
+ * - **Stock q8_0 KV-cache** — Gemma 4's KV is already minimal by construction
12
+ * (MQA = 1 KV head, windowed sliding-window attention on most layers, and
13
+ * shared-KV layers reusing earlier KV), so a 128k window fits in a fraction
14
+ * of a GB at stock q8_0 without the legacy QJL/Polar kernels. The head_dim=128
15
+ * QJL kernel does not apply to Gemma's dual head dims (512 global / 256 swa)
16
+ * and is not used. KV quant is forced, never a user option.
17
+ *
18
+ * `minRamGb` per tier is therefore "TurboQuant weights + a 128k q8_0 KV cache +
19
+ * runtime/OS overhead". Picking the largest tier whose `minRamGb` fits free RAM
20
+ * is exactly "biggest model that still gets a 128k window".
21
+ *
22
+ * **Dynamic fit-to-RAM context (#8809 M10b).** Picking the largest tier whose
23
+ * static `minRamGb` floor fits is the coarse gate. On top of that we compute the
24
+ * *largest context window that actually fits the device's free RAM* for the
25
+ * chosen tier, from the per-token q8_0 KV rate (`kvBytesPerTokenForTier`) rather
26
+ * than only honouring the catalog ceiling. On a roomy host that is the tier's
27
+ * native window; on a host that clears the weights+overhead floor but not a full
28
+ * 128k cache, the window shrinks to the largest 4k-stepped size that fits. The
29
+ * tier choice never drops below 2B (0.8B is gone); when even a minimum window
30
+ * (`ELIZA_1_MIN_LOCAL_CONTEXT`) cannot fit any tier, we return `null`, which the
31
+ * caller reads as "this modality should route to Cloud" (the AUTO policy).
32
+ */
33
+ import { MODEL_CATALOG } from "./catalog.js";
34
+ /** The KV-cache quantization eliza-1 always uses on-device. Gemma 4's KV is
35
+ * already minimal (MQA + windowed-SWA + shared-KV), so stock q8_0 is sufficient;
36
+ * the legacy head_dim=128 QJL kernel is incompatible with Gemma's dual head dims
37
+ * (512 global / 256 swa) and is not used. */
38
+ export const ELIZA_1_KV_QUANT = "q8_0";
39
+ /** The consumer context target. We never advertise less than this if it fits. */
40
+ export const ELIZA_1_CONTEXT_TARGET = 131072; // 128k
41
+ /** Floor below which a cramped local window is worse than routing to Cloud. */
42
+ export const ELIZA_1_MIN_LOCAL_CONTEXT = 8192; // 8k
43
+ /** Round a token count down to a 4k step so we advertise clean window sizes. */
44
+ const CONTEXT_STEP = 4096;
45
+ /**
46
+ * Fixed non-KV cost on top of the TurboQuant weights: the inference runtime,
47
+ * activation scratch, and OS headroom. Used by the context-fit math to reserve
48
+ * room before the KV cache claims the rest of free RAM.
49
+ */
50
+ const RUNTIME_OVERHEAD_GB = 1.0;
51
+ const BYTES_PER_GB = 1024 * 1024 * 1024;
52
+ /**
53
+ * Per-token q8_0 KV footprint for a tier, derived from the catalog's own
54
+ * sizing: the tier's `minRamGb` floor is "TurboQuant weights + a native-window
55
+ * q8_0 KV cache + runtime/OS overhead", so the RAM the catalog reserves for the
56
+ * KV cache at the native window is `minRamGb − sizeGb − RUNTIME_OVERHEAD_GB`,
57
+ * and dividing by the native context gives the per-token rate. Deriving it from
58
+ * the catalog (rather than a second hardcoded table) keeps the full-fit floor
59
+ * and the dynamic context-downscale math provably consistent: just below a
60
+ * tier's floor, exactly less-than-native fits.
61
+ *
62
+ * Returns `null` when the tier's floor doesn't actually reserve any KV room
63
+ * (mis-sized catalog row) — the caller then cannot compute a window for it.
64
+ */
65
+ function kvBytesPerTokenForTier(tier) {
66
+ const { minRamGb, sizeGb, contextLength } = tier;
67
+ if (minRamGb == null || sizeGb == null || contextLength == null)
68
+ return null;
69
+ const kvReserveGb = minRamGb - sizeGb - RUNTIME_OVERHEAD_GB;
70
+ if (kvReserveGb <= 0 || contextLength <= 0)
71
+ return null;
72
+ return (kvReserveGb * BYTES_PER_GB) / contextLength;
73
+ }
74
+ function roundDownToStep(tokens, step = CONTEXT_STEP) {
75
+ return Math.max(0, Math.floor(tokens / step) * step);
76
+ }
77
+ /**
78
+ * Largest 4k-stepped window that fits `freeRamGb` for `tier` at the q8_0 KV
79
+ * rate. Returns `context: 0` when the weights+overhead alone do not fit, or
80
+ * when the tier's KV rate cannot be derived (caller treats either as "this
81
+ * tier cannot hold any window").
82
+ */
83
+ function maxFittingContextForTier(tier, freeRamGb) {
84
+ const kvBytesPerToken = kvBytesPerTokenForTier(tier);
85
+ if (kvBytesPerToken == null)
86
+ return null;
87
+ const sizeGb = tier.sizeGb ?? 0;
88
+ const kvAvailableGb = freeRamGb - sizeGb - RUNTIME_OVERHEAD_GB;
89
+ if (kvAvailableGb <= 0)
90
+ return { context: 0, kvBytesPerToken };
91
+ const tokensThatFit = (kvAvailableGb * BYTES_PER_GB) / kvBytesPerToken;
92
+ return { context: roundDownToStep(tokensThatFit), kvBytesPerToken };
93
+ }
94
+ /**
95
+ * Pick the best on-device eliza-1 configuration for a device with `freeRamGb` of
96
+ * usable RAM (Apple-silicon unified RAM, discrete-GPU VRAM, or CPU RAM — the
97
+ * caller normalizes this, e.g. via the device-tier classifier).
98
+ *
99
+ * Returns `null` when nothing acceptable fits locally → the caller routes this
100
+ * modality to Cloud (AUTO). Never returns a tier smaller than 2B (0.8B is gone).
101
+ */
102
+ export function selectBestEliza1Fit(freeRamGb) {
103
+ if (!Number.isFinite(freeRamGb) || freeRamGb <= 0)
104
+ return null;
105
+ // Release tiers, largest RAM-floor first. The floor already bakes in a native
106
+ // (128k) q8_0 window, so the first one whose floor fits is the biggest model
107
+ // that still gets its full window.
108
+ const tiers = [...MODEL_CATALOG]
109
+ .filter((m) => typeof m.minRamGb === "number" && typeof m.sizeGb === "number")
110
+ .sort((a, b) => b.minRamGb - a.minRamGb);
111
+ for (const tier of tiers) {
112
+ if (tier.minRamGb == null || freeRamGb < tier.minRamGb)
113
+ continue;
114
+ const nativeCtx = tier.contextLength ?? ELIZA_1_CONTEXT_TARGET;
115
+ const fit = maxFittingContextForTier(tier, freeRamGb);
116
+ if (!fit)
117
+ continue;
118
+ const { context: maxFittingContext, kvBytesPerToken } = fit;
119
+ // Floor fits → at least the native window fits; clamp the dynamic window to
120
+ // the tier ceiling so we never advertise more than the bundle ships.
121
+ const contextLength = Math.min(Math.max(maxFittingContext, nativeCtx), nativeCtx);
122
+ return {
123
+ tierId: tier.id,
124
+ contextLength,
125
+ kvQuant: ELIZA_1_KV_QUANT,
126
+ contextDownscaled: false,
127
+ kvBytesPerToken,
128
+ maxFittingContext,
129
+ reason: "native-fit",
130
+ };
131
+ }
132
+ // No tier clears its native floor. Keep the smallest tier (2B) and shrink the
133
+ // q8_0 KV window to the largest 4k step that fits. Never drop below 2B.
134
+ const smallest = tiers[tiers.length - 1];
135
+ if (!smallest || smallest.contextLength == null)
136
+ return null;
137
+ const nativeCtx = smallest.contextLength;
138
+ const fit = maxFittingContextForTier(smallest, freeRamGb);
139
+ if (!fit)
140
+ return null;
141
+ const { context: fittedContext, kvBytesPerToken } = fit;
142
+ if (fittedContext < ELIZA_1_MIN_LOCAL_CONTEXT)
143
+ return null; // too cramped → Cloud
144
+ const contextLength = Math.min(fittedContext, nativeCtx);
145
+ return {
146
+ tierId: smallest.id,
147
+ contextLength,
148
+ kvQuant: ELIZA_1_KV_QUANT,
149
+ contextDownscaled: contextLength < nativeCtx,
150
+ kvBytesPerToken,
151
+ maxFittingContext: fittedContext,
152
+ reason: contextLength < nativeCtx ? "context-downscaled" : "native-fit",
153
+ };
154
+ }
155
+ //# sourceMappingURL=device-fit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-fit.js","sourceRoot":"","sources":["../../src/local-inference/device-fit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C;;;6CAG6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAe,CAAC;AAEhD,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,CAAC,OAAO;AAErD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,CAAC,KAAK;AAEpD,gFAAgF;AAChF,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,SAAS,sBAAsB,CAAC,IAAkB;IAChD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,aAAa,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7E,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,mBAAmB,CAAC;IAC5D,IAAI,WAAW,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,CAAC,WAAW,GAAG,YAAY,CAAC,GAAG,aAAa,CAAC;AACtD,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,CAAC,CAAC,sBAAsB;IAElF,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACzD,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,EAAkB;QACnC,aAAa;QACb,OAAO,EAAE,gBAAgB;QACzB,iBAAiB,EAAE,aAAa,GAAG,SAAS;QAC5C,eAAe;QACf,iBAAiB,EAAE,aAAa;QAChC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY;KACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * HuggingFace download routing for local-inference bundle fetches.
3
+ *
4
+ * The product never holds a local HuggingFace token. When the device is linked
5
+ * to Eliza Cloud, ALL HuggingFace `resolve` traffic is routed through the cloud
6
+ * HF proxy (`/api/v1/hf-proxy/<repo>/resolve/<rev>/<path>`), which attaches the
7
+ * cloud-side `HF_TOKEN` so gated repos resolve without exposing a token to the
8
+ * client. When the device is not cloud-linked, downloads go directly to the
9
+ * public (ungated) HuggingFace host — the shipping eliza-1 bundles are public.
10
+ *
11
+ * Precedence:
12
+ * 1. `ELIZA_HF_BASE_URL` override (explicit mirror/base) — always wins.
13
+ * 2. Cloud proxy base + bearer — when an Eliza Cloud API key is present.
14
+ * 3. Direct public HuggingFace host — no auth header.
15
+ *
16
+ * The returned `base` is the host (+ optional path prefix) that a
17
+ * `<repo>/resolve/<rev>/<path>` suffix is appended to by the catalog URL
18
+ * builder, so cloud and direct paths share one URL-construction shape.
19
+ */
20
+ export interface HfDownloadBase {
21
+ /**
22
+ * Base URL the catalog builder appends `<repo>/resolve/<rev>/<path>` to.
23
+ * For the cloud proxy this is `<cloudApi>/hf-proxy`; for direct HF it is the
24
+ * HuggingFace host. Never has a trailing slash.
25
+ */
26
+ base: string;
27
+ /**
28
+ * Bearer header to send with the request, or `undefined` for the
29
+ * unauthenticated public path. Only the cloud proxy carries auth — the
30
+ * cloud-side `HF_TOKEN` is attached by the Worker, never by the client.
31
+ */
32
+ authHeader?: {
33
+ authorization: string;
34
+ };
35
+ /** True when traffic is routed through the Eliza Cloud HF proxy. */
36
+ viaCloud: boolean;
37
+ }
38
+ /**
39
+ * Resolve where HuggingFace `resolve` traffic should go and how it should
40
+ * authenticate. See the module doc for precedence.
41
+ */
42
+ export declare function resolveHfDownloadBase(): HfDownloadBase;
43
+ //# sourceMappingURL=hf-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hf-proxy.d.ts","sourceRoot":"","sources":["../../src/local-inference/hf-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAWD;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAiBtD"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * HuggingFace download routing for local-inference bundle fetches.
3
+ *
4
+ * The product never holds a local HuggingFace token. When the device is linked
5
+ * to Eliza Cloud, ALL HuggingFace `resolve` traffic is routed through the cloud
6
+ * HF proxy (`/api/v1/hf-proxy/<repo>/resolve/<rev>/<path>`), which attaches the
7
+ * cloud-side `HF_TOKEN` so gated repos resolve without exposing a token to the
8
+ * client. When the device is not cloud-linked, downloads go directly to the
9
+ * public (ungated) HuggingFace host — the shipping eliza-1 bundles are public.
10
+ *
11
+ * Precedence:
12
+ * 1. `ELIZA_HF_BASE_URL` override (explicit mirror/base) — always wins.
13
+ * 2. Cloud proxy base + bearer — when an Eliza Cloud API key is present.
14
+ * 3. Direct public HuggingFace host — no auth header.
15
+ *
16
+ * The returned `base` is the host (+ optional path prefix) that a
17
+ * `<repo>/resolve/<rev>/<path>` suffix is appended to by the catalog URL
18
+ * builder, so cloud and direct paths share one URL-construction shape.
19
+ */
20
+ import { resolveCloudApiBaseUrl } from "../elizacloud/base-url.js";
21
+ import { getCloudSecret } from "../elizacloud/cloud-secrets.js";
22
+ const DEFAULT_HF_HOST = "https://huggingface.co";
23
+ function trimTrailingSlash(value) {
24
+ return value.replace(/\/+$/, "");
25
+ }
26
+ /** Read the Eliza Cloud API key from the sealed store (falls back to env). */
27
+ function cloudApiKey() {
28
+ return getCloudSecret("ELIZAOS_CLOUD_API_KEY")?.trim() ?? "";
29
+ }
30
+ /**
31
+ * Resolve where HuggingFace `resolve` traffic should go and how it should
32
+ * authenticate. See the module doc for precedence.
33
+ */
34
+ export function resolveHfDownloadBase() {
35
+ const override = process.env.ELIZA_HF_BASE_URL?.trim();
36
+ if (override) {
37
+ return { base: trimTrailingSlash(override), viaCloud: false };
38
+ }
39
+ const apiKey = cloudApiKey();
40
+ if (apiKey) {
41
+ const cloudApi = resolveCloudApiBaseUrl(process.env.ELIZAOS_CLOUD_BASE_URL);
42
+ return {
43
+ base: `${trimTrailingSlash(cloudApi)}/hf-proxy`,
44
+ authHeader: { authorization: `Bearer ${apiKey}` },
45
+ viaCloud: true,
46
+ };
47
+ }
48
+ return { base: DEFAULT_HF_HOST, viaCloud: false };
49
+ }
50
+ //# sourceMappingURL=hf-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hf-proxy.js","sourceRoot":"","sources":["../../src/local-inference/hf-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAmBjD,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,8EAA8E;AAC9E,SAAS,WAAW;IAClB,OAAO,cAAc,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC;IACvD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChE,CAAC;IAED,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAC5E,OAAO;YACL,IAAI,EAAE,GAAG,iBAAiB,CAAC,QAAQ,CAAC,WAAW;YAC/C,UAAU,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,EAAE,EAAE;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Model-hub authentication helpers.
3
+ *
4
+ * Gated/metered HuggingFace repos require an `Authorization: Bearer <token>`
5
+ * header or they answer `HTTP 401`/`403` (and gated repos are invisible to
6
+ * unauthenticated search, reporting wrong/zero sizes). The token is read from
7
+ * the same env aliases the embedding manager uses
8
+ * (`HF_TOKEN` / `HUGGINGFACE_TOKEN` / `HF_HUB_TOKEN`).
9
+ *
10
+ * The token is **host-gated**: it is only attached to `huggingface.co`
11
+ * requests, never leaked to ModelScope or arbitrary mirrors. Every model
12
+ * download and search path forwards it through {@link resolveHubAuthHeaders}.
13
+ */
14
+ /** Read the HuggingFace token from the documented env aliases. `""` when unset. */
15
+ export declare function resolveHuggingFaceToken(): string;
16
+ /** True when a configured HuggingFace token is present in the environment. */
17
+ export declare function hasHuggingFaceToken(): boolean;
18
+ /** True when `url` points at huggingface.co (or a subdomain of it). */
19
+ export declare function isHuggingFaceHost(url: string): boolean;
20
+ /**
21
+ * Auth headers for a model-hub request. Returns the bearer header only for
22
+ * huggingface.co URLs when a token is configured; `{}` otherwise (public repos
23
+ * and non-HF hosts are unaffected, and tokens never leak to other hosts).
24
+ */
25
+ export declare function resolveHubAuthHeaders(url: string): Record<string, string>;
26
+ //# sourceMappingURL=hub-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-auth.d.ts","sourceRoot":"","sources":["../../src/local-inference/hub-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,mFAAmF;AACnF,wBAAgB,uBAAuB,IAAI,MAAM,CAQhD;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIzE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Model-hub authentication helpers.
3
+ *
4
+ * Gated/metered HuggingFace repos require an `Authorization: Bearer <token>`
5
+ * header or they answer `HTTP 401`/`403` (and gated repos are invisible to
6
+ * unauthenticated search, reporting wrong/zero sizes). The token is read from
7
+ * the same env aliases the embedding manager uses
8
+ * (`HF_TOKEN` / `HUGGINGFACE_TOKEN` / `HF_HUB_TOKEN`).
9
+ *
10
+ * The token is **host-gated**: it is only attached to `huggingface.co`
11
+ * requests, never leaked to ModelScope or arbitrary mirrors. Every model
12
+ * download and search path forwards it through {@link resolveHubAuthHeaders}.
13
+ */
14
+ /** Read the HuggingFace token from the documented env aliases. `""` when unset. */
15
+ export function resolveHuggingFaceToken() {
16
+ if (typeof process === "undefined" || !process.env)
17
+ return "";
18
+ return (process.env.HF_TOKEN?.trim() ||
19
+ process.env.HUGGINGFACE_TOKEN?.trim() ||
20
+ process.env.HF_HUB_TOKEN?.trim() ||
21
+ "");
22
+ }
23
+ /** True when a configured HuggingFace token is present in the environment. */
24
+ export function hasHuggingFaceToken() {
25
+ return resolveHuggingFaceToken().length > 0;
26
+ }
27
+ /** True when `url` points at huggingface.co (or a subdomain of it). */
28
+ export function isHuggingFaceHost(url) {
29
+ try {
30
+ const host = new URL(url).hostname.toLowerCase();
31
+ return host === "huggingface.co" || host.endsWith(".huggingface.co");
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ /**
38
+ * Auth headers for a model-hub request. Returns the bearer header only for
39
+ * huggingface.co URLs when a token is configured; `{}` otherwise (public repos
40
+ * and non-HF hosts are unaffected, and tokens never leak to other hosts).
41
+ */
42
+ export function resolveHubAuthHeaders(url) {
43
+ if (!isHuggingFaceHost(url))
44
+ return {};
45
+ const token = resolveHuggingFaceToken();
46
+ return token ? { authorization: `Bearer ${token}` } : {};
47
+ }
48
+ //# sourceMappingURL=hub-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-auth.js","sourceRoot":"","sources":["../../src/local-inference/hub-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,mFAAmF;AACnF,MAAM,UAAU,uBAAuB;IACrC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IAC9D,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE;QAC5B,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE;QAChC,EAAE,CACH,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB;IACjC,OAAO,uBAAuB,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACjD,OAAO,IAAI,KAAK,gBAAgB,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,uBAAuB,EAAE,CAAC;IACxC,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC"}
@@ -8,12 +8,17 @@
8
8
  * management, llama-server lifecycle, conversation registry, metrics)
9
9
  * and `ui` (client wiring against the agent API).
10
10
  */
11
- export { buildHuggingFaceResolveUrl, buildHuggingFaceResolveUrlForPath, DEFAULT_ELIGIBLE_MODEL_IDS, defaultVoiceQuantForTier, ELIZA_1_HF_REPO, ELIZA_1_MTP_TIER_IDS, ELIZA_1_PLACEHOLDER_IDS, ELIZA_1_RELEASE_TIER_IDS, ELIZA_1_TIER_IDS, ELIZA_1_TIER_PUBLISH_STATUS, ELIZA_1_VISION_TIER_IDS, type Eliza1TierId, eliza1TierPublishStatus, FIRST_RUN_DEFAULT_MODEL_ID, findCatalogModel, isDefaultEligibleId, MODEL_CATALOG, type OmniVoiceQuantLevel, voiceQuantLadderForTier, } from "./catalog.js";
11
+ export { buildHuggingFaceResolveUrl, buildHuggingFaceResolveUrlForPath, DEFAULT_ELIGIBLE_MODEL_IDS, defaultVoiceQuantForTier, ELIZA_1_HF_REPO, ELIZA_1_HOSTED_MTP_TIER_IDS, ELIZA_1_MTP_TIER_IDS, ELIZA_1_ON_DEVICE_TIER_IDS, ELIZA_1_PLACEHOLDER_IDS, ELIZA_1_RELEASE_TIER_IDS, ELIZA_1_TIER_IDS, ELIZA_1_TIER_PUBLISH_STATUS, ELIZA_1_VISION_TIER_IDS, type Eliza1TierId, eliza1TierPublishStatus, FIRST_RUN_DEFAULT_MODEL_ID, findCatalogModel, isDefaultEligibleId, isOnDeviceTier, MODEL_CATALOG, type OmniVoiceQuantLevel, voiceQuantLadderForTier, } from "./catalog.js";
12
+ export { ELIZA_1_CONTEXT_TARGET, ELIZA_1_KV_QUANT, ELIZA_1_MIN_LOCAL_CONTEXT, type Eliza1Fit, selectBestEliza1Fit, } from "./device-fit.js";
12
13
  export { GPU_PROFILE_IDS, GPU_PROFILES, type GpuProfile, type GpuProfileId, type KvCacheType, matchGpuProfile, reservedHeadroomGb, } from "./gpu-profiles.js";
14
+ export { type HfDownloadBase, resolveHfDownloadBase, } from "./hf-proxy.js";
15
+ export { hasHuggingFaceToken, isHuggingFaceHost, resolveHubAuthHeaders, resolveHuggingFaceToken, } from "./hub-auth.js";
13
16
  export { type Ed25519PublicKey, ManifestSignatureError, type SignatureVerifyInput, verifyManifestSignature, verifyManifestSignatureText, } from "./manifest-signature.js";
14
17
  export { applyNetworkPolicy, classifyNetwork, DEFAULT_NETWORK_POLICY_PREFERENCES, evaluateNetworkPolicy, inQuietHours, type NetworkClass, type NetworkPolicyDecision, type NetworkPolicyPreferences, type NetworkPolicyReason, type RawNetworkState, } from "./network-policy.js";
15
18
  export type { ProviderEnableState, ProviderId, ProviderMeta, ProviderStatus, } from "./providers-types.js";
16
19
  export type { RoutingPolicy, RoutingPreferences, } from "./routing-preferences.js";
20
+ export { DEFAULT_ROUTING_POLICY, isRoutingPolicy, ROUTING_POLICIES, } from "./routing-preferences.js";
21
+ export { classifyCatalogModelRuntimeClass, classifyInstalledModelRuntimeClass, type RuntimeClass, withRuntimeClass, } from "./runtime-class.js";
17
22
  export { computeGenerationThroughput, type GenerationCounters, type GenerationThroughput, isGenerationCounters, } from "./throughput.js";
18
23
  export { type ActiveModelState, AGENT_MODEL_SLOTS, type AgentModelSlot, type CatalogModel, type CatalogQuantizationId, type CatalogQuantizationMatrix, type CatalogQuantizationVariant, type CpuFeatureProbe, type DownloadEvent, type DownloadJob, type DownloadState, type HardwareFitLevel, type HardwareProbe, type InstalledModel, type LocalInferenceDownloadStatus, type LocalInferenceReadiness, type LocalInferenceSlotReadiness, type LocalRuntimeAcceleration, type LocalRuntimeBackend, type LocalRuntimeKernel, type LocalRuntimeOptimizations, type MobileHardwareProbe, type ModelAssignments, type ModelBucket, type ModelCategory, type ModelHubSnapshot, type OpenVinoDeviceKind, type OpenVinoHardwareProbe, TEXT_GENERATION_SLOTS, type TextGenerationSlot, type TokenizerFamily, } from "./types.js";
19
24
  export type { VerifyResult, VerifyState } from "./verify.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-inference/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EACvB,KAAK,YAAY,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,KAAK,mBAAmB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO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AAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local-inference/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EACvB,KAAK,YAAY,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,KAAK,mBAAmB,EACxB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,SAAS,EACd,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,cAAc,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,yBAAyB,CAA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AAkB,EACvB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
@@ -8,10 +8,15 @@
8
8
  * management, llama-server lifecycle, conversation registry, metrics)
9
9
  * and `ui` (client wiring against the agent API).
10
10
  */
11
- export { buildHuggingFaceResolveUrl, buildHuggingFaceResolveUrlForPath, DEFAULT_ELIGIBLE_MODEL_IDS, defaultVoiceQuantForTier, ELIZA_1_HF_REPO, ELIZA_1_MTP_TIER_IDS, ELIZA_1_PLACEHOLDER_IDS, ELIZA_1_RELEASE_TIER_IDS, ELIZA_1_TIER_IDS, ELIZA_1_TIER_PUBLISH_STATUS, ELIZA_1_VISION_TIER_IDS, eliza1TierPublishStatus, FIRST_RUN_DEFAULT_MODEL_ID, findCatalogModel, isDefaultEligibleId, MODEL_CATALOG, voiceQuantLadderForTier, } from "./catalog.js";
11
+ export { buildHuggingFaceResolveUrl, buildHuggingFaceResolveUrlForPath, DEFAULT_ELIGIBLE_MODEL_IDS, defaultVoiceQuantForTier, ELIZA_1_HF_REPO, ELIZA_1_HOSTED_MTP_TIER_IDS, ELIZA_1_MTP_TIER_IDS, ELIZA_1_ON_DEVICE_TIER_IDS, ELIZA_1_PLACEHOLDER_IDS, ELIZA_1_RELEASE_TIER_IDS, ELIZA_1_TIER_IDS, ELIZA_1_TIER_PUBLISH_STATUS, ELIZA_1_VISION_TIER_IDS, eliza1TierPublishStatus, FIRST_RUN_DEFAULT_MODEL_ID, findCatalogModel, isDefaultEligibleId, isOnDeviceTier, MODEL_CATALOG, voiceQuantLadderForTier, } from "./catalog.js";
12
+ export { ELIZA_1_CONTEXT_TARGET, ELIZA_1_KV_QUANT, ELIZA_1_MIN_LOCAL_CONTEXT, selectBestEliza1Fit, } from "./device-fit.js";
12
13
  export { GPU_PROFILE_IDS, GPU_PROFILES, matchGpuProfile, reservedHeadroomGb, } from "./gpu-profiles.js";
14
+ export { resolveHfDownloadBase, } from "./hf-proxy.js";
15
+ export { hasHuggingFaceToken, isHuggingFaceHost, resolveHubAuthHeaders, resolveHuggingFaceToken, } from "./hub-auth.js";
13
16
  export { ManifestSignatureError, verifyManifestSignature, verifyManifestSignatureText, } from "./manifest-signature.js";
14
17
  export { applyNetworkPolicy, classifyNetwork, DEFAULT_NETWORK_POLICY_PREFERENCES, evaluateNetworkPolicy, inQuietHours, } from "./network-policy.js";
18
+ export { DEFAULT_ROUTING_POLICY, isRoutingPolicy, ROUTING_POLICIES, } from "./routing-preferences.js";
19
+ export { classifyCatalogModelRuntimeClass, classifyInstalledModelRuntimeClass, withRuntimeClass, } from "./runtime-class.js";
15
20
  export { computeGenerationThroughput, isGenerationCounters, } from "./throughput.js";
16
21
  export { AGENT_MODEL_SLOTS, TEXT_GENERATION_SLOTS, } from "./types.js";
17
22
  export { compareVoiceModelSemver, findVoiceModelVersion, latestVoiceModelVersion, VOICE_MODEL_VERSIONS, versionsFor, } from "./voice-models.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/local-inference/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EAEvB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EAEb,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,YAAY,EAIZ,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,sBAAsB,EAEtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kCAAkC,EAClC,qBAAqB,EACrB,YAAY,GAMb,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EACL,2BAA2B,EAG3B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,iBAAiB,EA2BjB,qBAAqB,GAGtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EAMpB,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/local-inference/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,EACjC,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EAEvB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EAEb,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,yBAAyB,EAEzB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,EAIZ,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,sBAAsB,EAEtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kCAAkC,EAClC,qBAAqB,EACrB,YAAY,GAMb,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAElC,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,2BAA2B,EAG3B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,iBAAiB,EA2BjB,qBAAqB,GAGtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EAMpB,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
@@ -8,11 +8,15 @@
8
8
  * rather than replacing it.
9
9
  */
10
10
  import type { AgentModelSlot } from "./types.js";
11
- export type RoutingPolicy = "manual" | "auto" | "cheapest" | "fastest" | "prefer-local" | "round-robin";
11
+ export type RoutingPolicy = "manual" | "auto" | "local-only" | "cloud-only" | "cheapest" | "fastest" | "prefer-local" | "round-robin";
12
12
  /**
13
13
  * The full set of selectable policies, in display order. Kept as a runtime
14
14
  * value (not just a type) so route-layer validation and the settings UI share
15
15
  * one source of truth for "which policies are accepted".
16
+ *
17
+ * `local-only` / `cloud-only` are the canonical per-slot replacements for the
18
+ * global `ELIZA_LOCAL_ONLY` env hack: `local-only` is a hard guarantee (never
19
+ * falls through to cloud), `cloud-only` never dispatches on-device.
16
20
  */
17
21
  export declare const ROUTING_POLICIES: readonly RoutingPolicy[];
18
22
  export declare function isRoutingPolicy(value: unknown): value is RoutingPolicy;
@@ -1 +1 @@
1
- {"version":3,"file":"routing-preferences.d.ts","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,UAAU,GACV,SAAS,GACT,cAAc,GACd,aAAa,CAAC;AAElB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAO3C,CAAC;AAEX,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAKtE;AAED,eAAO,MAAM,sBAAsB,EAAE,aAA8B,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;CACxD;AAiBD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAY1E;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAa7B;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAa7B"}
1
+ {"version":3,"file":"routing-preferences.d.ts","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,SAAS,GACT,cAAc,GACd,aAAa,CAAC;AAElB;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAS3C,CAAC;AAEX,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAKtE;AAED,eAAO,MAAM,sBAAsB,EAAE,aAA8B,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;CACxD;AAiBD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAY1E;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAa7B;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAa7B"}
@@ -14,10 +14,16 @@ import { localInferenceRoot } from "./paths.js";
14
14
  * The full set of selectable policies, in display order. Kept as a runtime
15
15
  * value (not just a type) so route-layer validation and the settings UI share
16
16
  * one source of truth for "which policies are accepted".
17
+ *
18
+ * `local-only` / `cloud-only` are the canonical per-slot replacements for the
19
+ * global `ELIZA_LOCAL_ONLY` env hack: `local-only` is a hard guarantee (never
20
+ * falls through to cloud), `cloud-only` never dispatches on-device.
17
21
  */
18
22
  export const ROUTING_POLICIES = [
19
23
  "manual",
20
24
  "auto",
25
+ "local-only",
26
+ "cloud-only",
21
27
  "cheapest",
22
28
  "fastest",
23
29
  "prefer-local",
@@ -1 +1 @@
1
- {"version":3,"file":"routing-preferences.js","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAWhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,QAAQ;IACR,MAAM;IACN,UAAU;IACV,SAAS;IACT,cAAc;IACd,aAAa;CACL,CAAC;AAEX,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAkB,cAAc,CAAC;AAsBpE,MAAM,KAAK,GAAuB,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAExE,SAAS,WAAW;IAClB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,cAAc,CAAC,CAAC;AACzD,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QAC9C,IAAI,MAAM,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW;YAAE,OAAO,K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EACpB,MAA4B;IAE5B,MAAM,OAAO,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAuB;QAC/B,iBAAiB,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE;QACnD,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE;KAC9B,CAAC;IACF,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"routing-preferences.js","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAahD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,cAAc;IACd,aAAa;CACL,CAAC;AAEX,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAkB,cAAc,CAAC;AAsBpE,MAAM,KAAK,GAAuB,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAExE,SAAS,WAAW;IAClB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,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AC/C,MAAM,IAAI,GAAuB;QAC/B,iBAAiB,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE;QACnD,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE;KAC9B,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;IAC1C,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,IAAoB,EACpB,MAA4B;IAE5B,MAAM,OAAO,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAuB;QAC/B,iBAAiB,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE;QACnD,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE;KAC9B,CAAC;IACF,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Local-inference runtime-class discriminator.
3
+ *
4
+ * The local stack is Eliza-1 only: every text model is an Eliza-1 bundle served
5
+ * by the fused `libelizainference` (`desktop-fused-ffi-backend-runtime.ts`). The
6
+ * fused context is anchored at a *bundle root* (`ffi.create(bundleRoot)` →
7
+ * `<bundleRoot>/text/*.gguf`) and the full optimization stack rides along:
8
+ * embedded draft head speculative decoding, stock q8_0 KV cache, native
9
+ * tokenization over the resident Gemma 4 (eliza-1) vocab, and fused
10
+ * voice/vision. It cannot load an arbitrary single GGUF — the vocab and the KV
11
+ * cache layout are tokenizer/format-specific to Eliza-1.
12
+ *
13
+ * The discriminator is retained as a single-valued type so external importers
14
+ * keep resolving; there is no longer a second runtime class to branch on.
15
+ */
16
+ import type { CatalogModel, InstalledModel } from "./types.js";
17
+ /**
18
+ * Which desktop text runtime a model is served by. The local stack is Eliza-1
19
+ * only, so this is a single constant (`"fused-eliza1"`); the generic-GGUF
20
+ * runtime class was removed with the multi-model machinery (#8808).
21
+ */
22
+ export type RuntimeClass = "fused-eliza1";
23
+ /** Every catalog entry in the Eliza-1-only stack is served by the fused runtime. */
24
+ export declare function classifyCatalogModelRuntimeClass(_model: Pick<CatalogModel, "id" | "bundleManifestFile" | "runtimeRole">): RuntimeClass;
25
+ /** Every installed model in the Eliza-1-only stack is served by the fused runtime. */
26
+ export declare function classifyInstalledModelRuntimeClass(_model: Pick<InstalledModel, "id" | "bundleRoot" | "runtimeClass">): RuntimeClass;
27
+ /** Backfill `runtimeClass` on an installed-model entry that predates the field. */
28
+ export declare function withRuntimeClass(model: InstalledModel): InstalledModel;
29
+ //# sourceMappingURL=runtime-class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-class.d.ts","sourceRoot":"","sources":["../../src/local-inference/runtime-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,oFAAoF;AACpF,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,oBAAoB,GAAG,aAAa,CAAC,GACtE,YAAY,CAEd;AAED,sFAAsF;AACtF,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,CAAC,GACjE,YAAY,CAEd;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAGtE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Local-inference runtime-class discriminator.
3
+ *
4
+ * The local stack is Eliza-1 only: every text model is an Eliza-1 bundle served
5
+ * by the fused `libelizainference` (`desktop-fused-ffi-backend-runtime.ts`). The
6
+ * fused context is anchored at a *bundle root* (`ffi.create(bundleRoot)` →
7
+ * `<bundleRoot>/text/*.gguf`) and the full optimization stack rides along:
8
+ * embedded draft head speculative decoding, stock q8_0 KV cache, native
9
+ * tokenization over the resident Gemma 4 (eliza-1) vocab, and fused
10
+ * voice/vision. It cannot load an arbitrary single GGUF — the vocab and the KV
11
+ * cache layout are tokenizer/format-specific to Eliza-1.
12
+ *
13
+ * The discriminator is retained as a single-valued type so external importers
14
+ * keep resolving; there is no longer a second runtime class to branch on.
15
+ */
16
+ /** Every catalog entry in the Eliza-1-only stack is served by the fused runtime. */
17
+ export function classifyCatalogModelRuntimeClass(_model) {
18
+ return "fused-eliza1";
19
+ }
20
+ /** Every installed model in the Eliza-1-only stack is served by the fused runtime. */
21
+ export function classifyInstalledModelRuntimeClass(_model) {
22
+ return "fused-eliza1";
23
+ }
24
+ /** Backfill `runtimeClass` on an installed-model entry that predates the field. */
25
+ export function withRuntimeClass(model) {
26
+ if (model.runtimeClass)
27
+ return model;
28
+ return { ...model, runtimeClass: "fused-eliza1" };
29
+ }
30
+ //# sourceMappingURL=runtime-class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-class.js","sourceRoot":"","sources":["../../src/local-inference/runtime-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,oFAAoF;AACpF,MAAM,UAAU,gCAAgC,CAC9C,MAAuE;IAEvE,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,kCAAkC,CAChD,MAAkE;IAElE,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,gBAAgB,CAAC,KAAqB;IACpD,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACrC,OAAO,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AACpD,CAAC"}