@degreesign/chat 1.3.0 → 1.3.1
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 +66 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# @degreesign/chat
|
|
2
2
|
|
|
3
|
-
One-shot on-device AI chat for browsers, workers and Node, using wllama CPU
|
|
4
|
-
engine and LiteRT-LM WebGPU engine.
|
|
5
|
-
|
|
6
|
-
Includes voice transcription to many languages
|
|
7
|
-
and a super accurate image vision function.
|
|
8
|
-
The package manages download of AI models automatically,
|
|
9
|
-
with auto resume for low network connections.
|
|
3
|
+
One-shot on-device AI chat for browsers, workers and Node, using a wllama CPU
|
|
4
|
+
engine and a LiteRT-LM WebGPU engine. It streams text, describes images,
|
|
5
|
+
manages model downloads with automatic resume, and renders no UI.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
Voice notes are transcribed on device by `@degreesign/voice`, a companion
|
|
8
|
+
package, then passed to `@degreesign/chat` as text.
|
|
9
|
+
|
|
10
|
+
`@degreesign/chat` is a plug and play engine for any UI.
|
|
12
11
|
|
|
13
12
|
[](https://www.npmjs.com/package/@degreesign/chat)
|
|
14
13
|
[](#licensing)
|
|
@@ -22,6 +21,7 @@ with auto resume for low network connections.
|
|
|
22
21
|
- [Why](#why)
|
|
23
22
|
- [Install](#install)
|
|
24
23
|
- [Quick start](#quick-start)
|
|
24
|
+
- [Case study: DoListy](#case-study-dolisty)
|
|
25
25
|
- [Enable WebGPU](#enable-webgpu)
|
|
26
26
|
- [Public API](#public-api)
|
|
27
27
|
- [Tools](#tools)
|
|
@@ -39,6 +39,8 @@ with auto resume for low network connections.
|
|
|
39
39
|
|
|
40
40
|
## Why
|
|
41
41
|
|
|
42
|
+
- Proven: [DoListy](https://dolisty.com/#chat), a no-signup PWA, answers
|
|
43
|
+
with the network off.
|
|
42
44
|
- On device: model weights download once, then every reply is generated locally.
|
|
43
45
|
- Headless: the package returns text through callbacks and renders no UI.
|
|
44
46
|
- Stateless: the host passes the whole message list and keeps its own history.
|
|
@@ -147,6 +149,62 @@ audio encoder, so a text turn drops the clip and an audio-only turn reports
|
|
|
147
149
|
The package never writes storage, so the host appends the user message before
|
|
148
150
|
the call and appends the assistant message after the last `onResponse`.
|
|
149
151
|
|
|
152
|
+
## Case study: DoListy
|
|
153
|
+
|
|
154
|
+
[DoListy](https://dolisty.com/#chat) is a DegreeSign project: a private
|
|
155
|
+
to-do list PWA with no sign-up. It ships `@degreesign/chat` for replies
|
|
156
|
+
and image descriptions, and `@degreesign/voice` for voice notes.
|
|
157
|
+
|
|
158
|
+
I wanted an assistant that could read my daily tasks, but I did not want
|
|
159
|
+
to give 100% of my data to big tech. I was also working on a new project
|
|
160
|
+
that had to stay under wraps until its soft launch, so I could not send
|
|
161
|
+
that work to a hosted model. The assistant had to run on the device, and
|
|
162
|
+
it had to be easy for any developer to drop into an app. Most days I have
|
|
163
|
+
that conversation on my phone: a voice note, a transcript, a few tasks,
|
|
164
|
+
all local. DoListy is where that engine got its first real use.
|
|
165
|
+
|
|
166
|
+
![DoListy assistant answering a question on a phone][dolisty-shot]
|
|
167
|
+
|
|
168
|
+
[dolisty-shot]: https://degreesign.github.io/ds_chat/case-study-dolisty.png
|
|
169
|
+
|
|
170
|
+
*A real session on dolisty.com. The green dot is the local model, not a
|
|
171
|
+
server.*
|
|
172
|
+
|
|
173
|
+
### What it does
|
|
174
|
+
|
|
175
|
+
- Describes a photo and tags it without uploading it.
|
|
176
|
+
- Turns a voice note into a task through `@degreesign/voice`.
|
|
177
|
+
- Writes titles, tags and a running summary in 19 languages. The persona
|
|
178
|
+
is the app's; the package adds no identity text.
|
|
179
|
+
- Answers with the network off, from the model already on disk.
|
|
180
|
+
|
|
181
|
+
### What it costs
|
|
182
|
+
|
|
183
|
+
- No per-reply cost, no API key, no rate limit. The only bill is the
|
|
184
|
+
one-time download: about 1.5 GB for Qwen3-VL, 2.0 GB for Gemma 4.
|
|
185
|
+
- An image waits about 70 seconds for its first token on an 8-thread
|
|
186
|
+
desktop CPU. That is the cost of the CPU vision path, chosen so images
|
|
187
|
+
work on phones without WebGPU; text takes the GPU path when the browser
|
|
188
|
+
has one.
|
|
189
|
+
- A 2 GB download resumes from the last committed part. A reload costs at
|
|
190
|
+
most one part, never the whole file.
|
|
191
|
+
- The gallery describes images in the background while you work.
|
|
192
|
+
|
|
193
|
+
### How it is wired
|
|
194
|
+
|
|
195
|
+
- One `createChat` per send, over a prompt assembled from the app's
|
|
196
|
+
encrypted stores.
|
|
197
|
+
- The reply is committed when `onStatus` reports the end; a newer send
|
|
198
|
+
drops the stale one.
|
|
199
|
+
- `gpuAdapter()` picks Gemma on WebGPU and Qwen everywhere else.
|
|
200
|
+
- One model stays resident, so a switch reloads the engine but never the
|
|
201
|
+
file.
|
|
202
|
+
|
|
203
|
+
**See it work:** open [dolisty.com](https://dolisty.com/#chat) on a phone,
|
|
204
|
+
let the model download once, then turn off the network and ask for a
|
|
205
|
+
summary. Speed numbers are in the
|
|
206
|
+
[web-llm comparison](https://degreesign.github.io/ds_chat/vs_web_llm.html).
|
|
207
|
+
|
|
150
208
|
## Enable WebGPU
|
|
151
209
|
|
|
152
210
|
A request without `model` picks `gemma4_e2b_limited` when the browser exposes a
|
package/package.json
CHANGED