murmur-rag 1.2.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.
Files changed (43) hide show
  1. package/README.md +27 -16
  2. package/dist/cdn/{anthropic-ynz7717b.js → anthropic-tw416spz.js} +2 -2
  3. package/dist/cdn/chunk-xyp6nm65.js +1 -0
  4. package/dist/cdn/{embed-xtkxyrpe.js → embed-3am76qfd.js} +6 -6
  5. package/dist/cdn/embed-50pfy67v.js +83 -0
  6. package/dist/cdn/{embed-n5nzhrf2.js → embed-cx1r66ch.js} +6 -6
  7. package/dist/cdn/{embed-7pk91zq8.js → embed-g0p6yc29.js} +2 -2
  8. package/dist/cdn/{embed-krrjjyf5.js → embed-q81wdr1z.js} +4 -4
  9. package/dist/cdn/embed-rjpq8psf.js +10 -0
  10. package/dist/cdn/{embed-0m8xctqy.js → embed-yz75savs.js} +3 -3
  11. package/dist/cdn/{google-k5kwa54v.js → google-556tp13p.js} +8 -8
  12. package/dist/cdn/index-8r44b2wt.js +1 -0
  13. package/dist/cdn/index-a5j4aat5.js +1 -0
  14. package/dist/cdn/index-ft8r539a.js +1 -0
  15. package/dist/cdn/index-pjxy71n5.js +1 -0
  16. package/dist/cdn/{index-gyd02jvt.js → index-qpy1k923.js} +2 -2
  17. package/dist/cdn/{mistral-p2qcnn42.js → mistral-25w1nsx5.js} +2 -2
  18. package/dist/cdn/{murmur-d6t6cjc7.js → murmur-1a55et82.js} +3 -3
  19. package/dist/cdn/murmur.js +7 -7
  20. package/dist/cdn/{openai-d3q1d6cz.js → openai-bjrbem49.js} +12 -12
  21. package/dist/cdn/{openai-compatible-psnkrpxy.js → openai-compatible-sg25g0vj.js} +6 -6
  22. package/dist/cdn/retriever-06ybegpd.js +1 -0
  23. package/dist/cdn/{transformers.web-xn16v7pz.js → transformers.web-49m0ht4a.js} +7 -7
  24. package/dist/lib/chunks/{index-y3v46yjp.js → index-4ftk20yq.js} +143 -39
  25. package/dist/lib/embed.js +8 -2
  26. package/dist/lib/llm/index.js +23 -0
  27. package/dist/lib/local/index.js +38 -2
  28. package/dist/lib/widget/index.js +2 -2
  29. package/dist/types/llm/index.d.ts +8 -0
  30. package/dist/types/local/index.d.ts +12 -0
  31. package/dist/types/widget/element.d.ts +4 -0
  32. package/dist/types/widget/i18n.d.ts +1 -0
  33. package/dist/types/widget/session.d.ts +43 -7
  34. package/dist/types/widget/styles.d.ts +1 -1
  35. package/package.json +4 -2
  36. package/dist/cdn/chunk-hpx6rpea.js +0 -1
  37. package/dist/cdn/embed-dbkjhg16.js +0 -83
  38. package/dist/cdn/embed-rp9gb1qq.js +0 -10
  39. package/dist/cdn/index-db4ne93m.js +0 -1
  40. package/dist/cdn/index-qc8kgsdt.js +0 -1
  41. package/dist/cdn/index-t0qn2m4r.js +0 -1
  42. package/dist/cdn/index-y0faj89r.js +0 -1
  43. package/dist/cdn/retriever-6qvn2maq.js +0 -1
package/README.md CHANGED
@@ -12,18 +12,20 @@ An AI chat bubble for any website that answers from the site's own pages, cites
12
12
 
13
13
  Paste the line before `</body>`. Without options, the bubble answers from the page the visitor is on, with a small model running in the visitor's browser (after they agree to a one-time 1.1 GB download); visitors can connect their own AI key instead from the AI settings. The [configurator](https://maxgfr.github.io/murmur/#wire) writes the line for you.
14
14
 
15
- | Attribute | |
16
- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
17
- | `data-index` | URL of the index written by `murmur index` (`/murmur-index.json`). Without it, the current page is read |
18
- | `data-endpoint` | Your OpenAI-compatible proxy (https): visitors chat without a key |
19
- | `data-local` | `false` turns off the in-browser model, the default when there is no proxy: visitors then need their own key |
20
- | `data-provider`, `data-model` | Provider and model preselected for visitors, or the model asked of the proxy |
21
- | `data-instructions` | Your instructions to the assistant |
22
- | `data-title`, `data-greeting`, `data-placeholder`, `data-button` | Texts of the panel |
23
- | `data-lang` | `en` or `fr` (default: the page's `lang`, then the browser's) |
24
- | `data-position` | `bottom-right` (default) or `bottom-left` |
25
- | `data-accent`, `data-theme` | Any CSS colour; `auto`, `light` or `dark` |
26
- | `data-open`, `data-storage-key` | Open on load; prefix of what the widget stores |
15
+ | Attribute | |
16
+ | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
17
+ | `data-index` | URL of the index written by `murmur index` (`/murmur-index.json`). Without it, the current page is read |
18
+ | `data-endpoint` | Your OpenAI-compatible proxy (https): visitors chat without a key |
19
+ | `data-mode`, `data-preload` | Who answers (`proxy`, `local`, `auto`, `key`) and when the in-browser model downloads (`question`, `open`, `idle`, `consent`) |
20
+ | `data-api-key` | Your own key for every visitor: public, only a key with a spending limit |
21
+ | `data-local` | `false` turns off the in-browser model, the default when there is no proxy: visitors then need their own key |
22
+ | `data-provider`, `data-model` | Provider and model preselected for visitors, or the model asked of the proxy |
23
+ | `data-instructions` | Your instructions to the assistant |
24
+ | `data-title`, `data-greeting`, `data-placeholder`, `data-button` | Texts of the panel |
25
+ | `data-lang` | `en` or `fr` (default: the page's `lang`, then the browser's) |
26
+ | `data-position` | `bottom-right` (default) or `bottom-left` |
27
+ | `data-accent`, `data-theme` | Any CSS colour; `auto`, `light` or `dark` |
28
+ | `data-open`, `data-storage-key` | Open on load; prefix of what the widget stores |
27
29
 
28
30
  The widget lives in a Shadow DOM and is restyled through `--murmur-accent`, `--murmur-accent-ink`, `--murmur-font`, `--murmur-radius` and `--murmur-z`. It emits `murmur:state` events (`searching`, `streaming`, `done`, `error`) with the passages found and cited.
29
31
 
@@ -37,11 +39,18 @@ Reads every `.html`, `.md` and `.txt` file (or a live `sitemap.xml`), keeps the
37
39
 
38
40
  ## AI models and keys
39
41
 
40
- A key in a web page is readable by anyone, so murmur never puts one there. The widget uses your proxy if you set one, else the visitor's key if they connected one, else the model in the browser:
42
+ Pick who answers with `data-mode`:
41
43
 
42
- - **Your proxy holds the key.** Deploy [`examples/cloudflare-worker`](examples/cloudflare-worker) (about 40 lines): it keeps the key as a secret, allows only your origin, fixes the model and caps answers. Then `data-endpoint="https://murmur-proxy.you.workers.dev/v1"`.
43
- - **No key at all, by default.** Without a proxy, the widget runs [LFM3 1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B) (Liquid AI, October 2026) in the visitor's browser on WebGPU through Transformers.js. The widget asks before downloading about 1.1 GB, then the weights stay in the browser's cache and questions never leave the device. Slower and less precise than a hosted model; `data-local="false"` turns it off.
44
- - **Or each visitor brings theirs.** The AI settings, built on llm-connect's store, let a visitor use their own key instead of the in-browser model: provider and model from the [llm-models](https://github.com/maxgfr/llm-models) catalog, the key encrypted with AES-GCM under a non-extractable browser key and sent only to that provider, or a local Ollama / LM Studio.
44
+ | `data-mode` | |
45
+ | ---------------- | -------------------------------------------------------------------------------------------- |
46
+ | `proxy` | Your Worker holds the key (implied by `data-endpoint`). Most sites |
47
+ | `local` | Only a model in the visitor's browser, no key settings |
48
+ | `auto` (default) | Your proxy or key if set, else the browser model with visitors free to connect their own key |
49
+ | `key` | A key only: yours (`data-api-key`), else each visitor's own |
50
+ - **Your Worker.** Deploy [`examples/cloudflare-worker`](examples/cloudflare-worker) (about 40 lines): it keeps the key as a secret, allows only your origin, fixes the model and caps answers. Then `data-endpoint="https://murmur-proxy.you.workers.dev/v1"`.
51
+ - **In the browser.** [LFM3 1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B) (Liquid AI, October 2026) runs on WebGPU through Transformers.js; questions never leave the device. `data-preload` sets when its ~1.1 GB downloads: `question` (default, with a discreet progress bar), `open` (bubble opened), `idle` (page idle) or `consent` (after a prompt). The weights stay in the browser's cache with persistent storage requested, and a cached model is prepared in the background on the next visit.
52
+ - **The visitor's key.** The AI settings, built on llm-connect's store: provider and model from the [llm-models](https://github.com/maxgfr/llm-models) catalog, the key encrypted with AES-GCM under a non-extractable browser key and sent only to that provider, or a local Ollama / LM Studio.
53
+ - **Your key in the page.** `data-api-key` with `data-provider` answers everyone with your key. Anyone can read it: only a key with a spending limit.
45
54
 
46
55
  ## npm package
47
56
 
@@ -96,6 +105,8 @@ bun run dev # build, then serve on http://localhost:4317/murmur/
96
105
  bun run test # unit tests
97
106
  bun run test:e2e # Playwright against a fake OpenAI-compatible endpoint, axe WCAG 2.2 AA scans
98
107
  bun run test:package # packs, installs and checks the CLI, Node imports and types
108
+ bun run test:live # the deployed site and its published script (also in CI after each deploy, daily)
109
+ bun run test:package:published # the same package checks on the version published on npm
99
110
  bun run typecheck && bun run lint
100
111
  ```
101
112