Repository navigation
web-chat: run on vectoron instead of candle - #68
Conversation
The demo now loads the GGUF with vectoron and runs the Qwen2 forward pass and sampling there, so ed-agent and onde are no longer dependencies. onde's web_store keeps its file loader crate-private, so src/store.rs is a port of it. It uses the same cache name and Hugging Face URLs, so a model cached by the previous build loads without downloading again. src/chat.rs builds the ChatML prompt and streams the reply. A follow-up reuses the cached positions it shares with the previous prompt instead of rerunning the whole conversation. WebChat keeps its method names and return values, so worker.js and main.js are unchanged. In Chromium on an Apple Silicon Mac, the cached model loads in 0.4 to 0.7 s and replies run at 3.9 to 5.1 tokens/s, against 1.2 to 2.5 before. The wasm module is 2.9 MB instead of 5.7 MB. vectoron is a git dependency on a local checkout of feature/v1 until that branch is pushed. Co-Authored-By: Claude Opus 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>
The git dependency pointed at feature/v1 in a local checkout. That branch is gone: vectoron's history was re-signed and merged to main, and 0.2.0 is published. 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.
This change ports the web-chat example from onde's candle engine to vectoron, updating the engine, model loading, and chat logic. It introduces a new chat.rs for prompt construction and streaming generation, and a new store.rs for browser-side model/tokenizer caching using the same cache as before. The API and method signatures of WebChat are preserved, so the JS UI and worker do not change. The README and build script are updated to reflect the new engine and build process. The change is self-contained to the example and does not affect the workspace or CI. No browser run was performed, but the code builds for wasm with the required features. The new code is clear and matches the described behaviour, with careful handling of cache, memory, and async state.
Automated review by siGit Code Review · commit ef6d41e · see the review dashboard
Moves the web-chat example from onde's candle engine to vectoron, so the demo runs the same engine as
@ondeinference/web.src/store.rsis a port of onde'sweb_storefile loader, which is crate-private. It uses the same cache name and Hugging Face URLs, so a model cached by the previous build loads without downloading again.src/chat.rsbuilds the ChatML prompt and streams the reply. A follow-up turn reuses the cached positions it shares with the previous prompt instead of rerunning the whole conversation.WebChatkeeps its method names and return values, soworker.jsandmain.jsare unchanged.ed-agentandondeare no longer dependencies.The first commit's message says vectoron is a git dependency on a local checkout. The second commit replaces that with
vectoron = "0.2"from crates.io. The old pin pointed at a branch that no longer exists, and afile://path only worked on one machine.Measured on the first commit, in Chromium on an Apple Silicon Mac: a cached model loads in 0.4 to 0.7 s and replies run at 3.9 to 5.1 tokens/s, against 1.2 to 2.5 before. The wasm module is 2.9 MB instead of 5.7 MB.
Checked for this PR:
cargo check --target wasm32-unknown-unknownwith+simd128, and./build.sh. No browser run.The example is excluded from the workspace and has its own lockfile, so CI here does not build it.