@degreesign/chat 0.3.1 → 0.3.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 (2) hide show
  1. package/README.md +16 -11
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -151,7 +151,7 @@ requested model is already loaded, no download or load happens.
151
151
 
152
152
  | State | Effect |
153
153
  | ----- | ------ |
154
- | Downloading or loading | Stops waiting for the load. A download another caller waits for keeps going. |
154
+ | Downloading or loading | Stops waiting for the load. Bytes stay on disk, and a download another caller waits for keeps going. |
155
155
  | Ready | Aborts the reply and unloads the model. |
156
156
  | An older call | Nothing, because a newer call owns the runtime. |
157
157
 
@@ -221,7 +221,9 @@ follow the flag.
221
221
  | `gemma4_e2b` | Gemma 4 E2B | Yes | Yes | No | Yes |
222
222
 
223
223
  The first call downloads the model through its engine and caches it. Later
224
- calls reuse the loaded runtime. Only one model stays in memory.
224
+ calls reuse the loaded runtime. Only one model stays in memory. An interrupted
225
+ download keeps the bytes it stored and resumes on the next attempt, including
226
+ after a reload.
225
227
 
226
228
  Qwen3-VL 2B downloads a vision projector of about 445 MB with the model, so its
227
229
  total download is about 1.5 GB. It runs on the CPU engine.
@@ -299,15 +301,18 @@ same headers.
299
301
 
300
302
  Each engine keeps its own cache. Loading a model unloads the previous runtime
301
303
  and removes the previous model's cache. The CPU engine uses the wllama cache
302
- manager; the GPU engine stores the single `.litertlm` file in Cache Storage
303
- under `litertlm-models`. A quota failure purges the cache of the engine being
304
- loaded.
305
-
306
- The GPU engine stores the whole file before it compiles the model, and one
307
- download serves every caller. A failed compile, a cancelled call or a repeated
308
- `createChat` reads the stored file instead of downloading it again. The cache
309
- write is best effort: if the browser rejects it, the model still streams from
310
- the network and the next call downloads it again.
304
+ manager. The GPU engine stores the single `.litertlm` file in the origin private
305
+ file system under `litert-store`, and reads a Cache Storage entry under
306
+ `litertlm-models` when an older version stored one. A quota failure purges the
307
+ cache of the engine being loaded.
308
+
309
+ The GPU engine stores the file before it compiles the model, and one download
310
+ serves every caller. A failed compile, a cancelled call or a repeated
311
+ `createChat` reads the stored file instead of downloading it again. A download
312
+ cut short keeps its bytes and continues from that offset with a range request,
313
+ checking the file size and entity tag so a changed model starts over. Hosts
314
+ without a writable file system still stream from the network and fall back to
315
+ Cache Storage, without resuming.
311
316
 
312
317
  A CPU vision model downloads its projector with the model and caches both. A
313
318
  GPU vision model keeps its encoder in the single `.litertlm` file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degreesign/chat",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Headless on-device AI chat for browsers and Node with wllama CPU and LiteRT WebGPU engines",
5
5
  "main": "dist/node/chat.node.min.js",
6
6
  "module": "dist/browser/chat.min.mjs",