@degreesign/chat 0.1.1 → 0.1.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/README.md +22 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ loads one model, streams one reply and reports status.
|
|
|
8
8
|
[](#licensing)
|
|
9
9
|
[](#faq)
|
|
10
10
|
[](#faq)
|
|
11
|
-
[](https://degreesign.github.io/ds_chat/)
|
|
11
|
+
[](https://degreesign.github.io/ds_chat/architecture.html)
|
|
12
12
|
|
|
13
13
|
## Table of contents
|
|
14
14
|
|
|
@@ -230,6 +230,26 @@ The CPU engine derives a raw thread count from the device, then caps it at
|
|
|
230
230
|
`limits.maxThreads`, default 2. The cap is applied after the raw maximum, so the
|
|
231
231
|
engine never exceeds the device or the caller budget.
|
|
232
232
|
|
|
233
|
+
Threads only take effect when the host page is cross-origin isolated. Serve it
|
|
234
|
+
with both headers:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Cross-Origin-Opener-Policy: same-origin
|
|
238
|
+
Cross-Origin-Embedder-Policy: require-corp
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Then assert `crossOriginIsolated === true` in the page. Without isolation the
|
|
242
|
+
engine falls back to one thread and image encoding becomes much slower, since
|
|
243
|
+
the projector runs on the CPU.
|
|
244
|
+
|
|
245
|
+
Under `require-corp` every cross-origin subresource must be CORS enabled or
|
|
246
|
+
carry `Cross-Origin-Resource-Policy`. Hugging Face downloads already qualify;
|
|
247
|
+
third party images, fonts and embeds need `crossorigin="anonymous"` or must be
|
|
248
|
+
self hosted. Chromium also accepts
|
|
249
|
+
`Cross-Origin-Embedder-Policy: credentialless` when those assets cannot be
|
|
250
|
+
changed. A page inside an iframe is isolated only when every ancestor sets the
|
|
251
|
+
same headers.
|
|
252
|
+
|
|
233
253
|
Only one model stays on device. Loading a new model unloads the previous runtime
|
|
234
254
|
and deletes other model caches. A quota failure purges every model cache before
|
|
235
255
|
retrying, so a half written download never blocks the next attempt.
|
|
@@ -318,7 +338,7 @@ The public enums are `ChatModelId`, `LlmRole`, `ChatStatus`, `LlmStatus`,
|
|
|
318
338
|
## Architecture
|
|
319
339
|
|
|
320
340
|
An interactive map of the package lives at
|
|
321
|
-
[degreesign.github.io/ds_chat](https://degreesign.github.io/ds_chat/). It covers
|
|
341
|
+
[degreesign.github.io/ds_chat/architecture.html](https://degreesign.github.io/ds_chat/architecture.html). It covers
|
|
322
342
|
the two entries, every source module with line numbers, the helper edges and the
|
|
323
343
|
send flow.
|
|
324
344
|
|
package/package.json
CHANGED