Repository navigation
Add examples/web-chat: Ed running in the browser - #62
Conversation
A small page that loads Qwen 2.5 0.5B and chats with it entirely on the device. A module worker owns one Ed instance compiled to wasm32-unknown-unknown, and the page talks to it through postMessage. The model downloads once into Cache Storage; a reload loads it without downloading again. Stop terminates the worker and starts a new one, so it also clears the conversation. There is no bundler or npm step: build.sh runs wasm-pack and any static server can host www/. The crate is excluded from the workspace and builds only for wasm32. It needs onde 1.5.0 for web_store, which is not published yet, so CI does not build it and its Cargo.lock is not committed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
There was a problem hiding this comment.
Adds examples/web-chat, a standalone crate (excluded from the workspace) that runs Ed in a browser via a wasm32 Web Worker. The worker owns a WebChat wasm-bindgen wrapper around Ed; the page (main.js) drives it with postMessage. The model (Qwen 2.5 0.5B) is downloaded once into Cache Storage via onde's web_store and reused on reload. build.sh runs wasm-pack with +simd128; no bundler or npm. CI path filters now include examples/**. The PR is explicitly not-ready-to-merge until onde publishes a release with web_store (the Cargo.toml still pins 1.4.0, README says 1.5.0).
Key things to look at: the RUSTFLAGS fallback in build.sh (line 11) silently drops any caller-provided flags; the onde version mismatch between Cargo.toml and README; and the worker's message handler, which drops messages while chat is null (boot in progress) without error feedback.
Automated review by siGit Code Review · commit bfd820c · see the review dashboard
…eplies build.sh now appends +simd128 to an exported RUSTFLAGS instead of dropping it. The worker answers a message that arrives before Ed has started with an error instead of ignoring it. A reply that fails after some tokens streamed keeps its text and gets the error appended. The onde comment in Cargo.toml now says the dependency waits on ondeinference/onde#50 rather than on a version number. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
There was a problem hiding this comment.
The follow-up diff closes the open review threads: build.sh now appends +simd128 even when RUSTFLAGS is exported, the worker returns an error for messages that arrive before chat is ready, and main.js appends error text after any already-streamed tokens. The Cargo.toml comment now matches the pinned 1.4.0 dependency and explains the unreleased onde requirement. No new issues found.
Automated review by siGit Code Review · commit c196d65 · changes since bfd820c · see the review dashboard
Add deploy.sh and the smbCloud config that ship www/ as a static artifact, plus share metadata and an Onde byline on the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.6.6-acp <noreply@sigit.si>
There was a problem hiding this comment.
The previous review points were addressed in c196d65. This set adds the smbCloud deploy config, a deploy.sh that guards the app id, stages the built page plus a generated version.txt, publishes, and polls for liveness, plus SEO meta tags and a footer byline. The deploy flow looks sound; only a small timeout-message mismatch stands out.
Automated review by siGit Code Review · commit a13a5a3 · changes since c196d65 · see the review dashboard
| fi | ||
| sleep 2 | ||
| done | ||
| echo "$URL did not report $version within 30s (last saw: ${live:-nothing})" >&2 |
There was a problem hiding this comment.
nit — The final message says the script gave up after 30s, but the loop is 15 attempts with up to 5s of curl timeout plus a 2s sleep each, so it can actually wait about 105s before failing.
An SVG mark (white e on the brand green) with a PNG apple-touch fallback, linked from the page head and shipped by deploy.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.6.6-acp <noreply@sigit.si>
There was a problem hiding this comment.
This delta since the last review only adds a favicon: favicon.svg and apple-touch-icon.png are new, index.html links both, and deploy.sh copies them into the staging directory so the deployed site stays in sync. The earlier findings from c196d65 (RUSTFLAGS appending, the onde version comment, the worker's early-message error reply, and the error-text annotation in main.js) are addressed and I have nothing further on them. The unanswered deploy.sh timing nit from last round is untouched by this delta and still stands as posted. No new issues in the icon changes.
Automated review by siGit Code Review · commit 260ce0e · changes since a13a5a3 · see the review dashboard
Stacked on #57. Adds a small example that runs Ed entirely in a browser tab: it downloads Qwen 2.5 0.5B (about 380 MB), loads it, and chats with it. Nothing leaves the device.
A module worker owns one
Edcompiled towasm32-unknown-unknown, and the page talks to it throughpostMessage, so a forward pass never blocks the UI. The model is stored once in Cache Storage and a reload loads it without downloading again. There is no bundler or npm step:build.shruns wasm-pack and any static server can hostwww/.The crate is excluded from the workspace and has its own build, so native CI is unaffected.
Not ready to merge
The example needs
web_storeand the browser engine from onde, which is in ondeinference/onde#50 and not yet released (1.4.0 is the latest on crates.io). Until a release has it:Cargo.lockis not committedondedependency inexamples/web-chat/Cargo.tomlstill says 1.4.0Once a release with the engine is published:
ondein the example, and in the workspace if Add wasm-friendly seams to ed-agent #57's requirement should movecargo updateinexamples/web-chatand commit the lockfilecargo clippy --locked --target wasm32-unknown-unknown --manifest-path examples/web-chat/Cargo.toml -- -D warningsto thecheck-wasm32jobWhat I ran
I built against a local checkout of onde (
--config 'patch.crates-io.onde.path=...') and drove the page with Playwright:-D warningsSpeed is 1.2 to 2.5 tokens/s on an Apple Silicon Mac (CPU, one thread, SIMD). One of my download attempts died at 46% with a
Cache.put()network error and the retry finished. Downloads are not resumable, which is down to onde'sweb_store, not this example.