PoC: Egui web UI via WASM with desktop code reuse#28
Merged
Conversation
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
…ity, and portable shebang Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add PoC for Egui as internal web UI using existing Desktop code
PoC: Egui web UI via WASM with desktop code reuse
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Demonstrates egui can be compiled to WASM and run in-browser, enabling significant code reuse between desktop and web UIs. Currently LocalGPT maintains separate HTML/JS web UI and egui desktop UI.
Implementation
New web module (
crates/server/src/web/)wasm32-unknown-unknowneframe::WebRunnerfor browser integrationWASM entry point in
crates/server/src/lib.rs:HTTP integration
/eguiserves HTML wrapper with canvas/egui/*serves WASM artifacts (2-3MB)build-egui-web.shautomates compilation and wasm-bindgenFindings
Code reuse: 80%+ UI code shareable between desktop/web (panels, widgets, state management, styling)
Tradeoffs vs HTML/JS:
Recommendation: Viable for localhost-focused tool where download size matters less. Ship at
/eguias experimental alternative to default HTML UI.Next steps for production
See
docs/egui-web-poc.mdfor architecture analysis.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.pyke.io/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-f7582ec34f72ae00/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-f7582ec34f72ae00/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/onig_sys-ef1816382bd16b0d-D /tmp/ccwhOaO1.s -c k/lo�� /out ef1816382bd16b0d--gdwarf-4 f/aws-lc-sys-0.3--64 _party/s2n-bignucc _party/s2n-bignu-O0 pointer s-8e9a49508f9c5c-fdata-sections ef18�� /out/a445302c6d3dcb51-sjis_prop.o ef1816382bd16b0d-gdwarf-4 tnet/tools/cc oniguruma/src 1 _H=1 4f9a91766097c4c5-x86_64.o(dns block)/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-c13b58d436be2c54/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-c13b58d436be2c54/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/onig_sys-02f073d12b989b8eoniguruma/src /tmp/ccmNaxkW.s /index.crates.io/home/REDACTED/work/localgpt/localgpt/target/debug/build/onig_sys--DHAVE_UNISTD_H=1 -194�� /out /out -1949cf8c6b5b557--64 f/aws-lc-sys-0.3as -1949cf8c6b5b557-W f/aws-lc-sys-0.3-I -1949cf8c6b5b557/home/REDACTED/work/localgpt/localgpt/target/debug/build/onig_sys-02f073d12b989b8e-gdwarf-4 /out/a445302c6d3dcb51-unicode.o /out/a445302c6d3dcb51-regtrav.o 02f073d12b989b8e--gdwarf-4 -1949cf8c6b5b557--64 f/aws-lc-sys-0.3as m/s2n-bignum-imp-W f/aws-lc-sys-0.3-I /build/aws-lc-sy/home/REDACTED/work/localgpt/localgpt/target/debug/build/onig_sys-02f073d12b989b8e-gdwarf-4(dns block)/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-f7582ec34f72ae00/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-f7582ec34f72ae00/build-script-main -I /home/REDACTED/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.37.1/aws-lc/third_party/s2n-bignum/s2n-bignum-imported/include -I /home/REDACTED/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.37.1/aws-lc/third_party/jitterentropy/jitterentropy-library 89/out/libaws_lc_0_37_1_crypto.a 89/out/7510312e0f5aa0be-p_ed25519_asn1.o 89/out/7510312e0f5aa0be-p_hmac_asn1.o 89/out/7510312e0f5aa0be-p_kem_asn1.o 89/out/7510312e0f5aa0be-p_methods.o 89/out/7510312e0f5aa0be-p_pqdsa_asn1.o 89/out/7510312e0f5aa0be-p_rsa_asn1.o 89/out/7510312e0f5aa0be-p_x25519.o 89/out/7510312e0f5aa0be-p_x25519_asn1.o 89/out/7510312e0f5aa0be-scrypt.o 89/out/7510312e0f5aa0be-sign.o 89/out/30a9a10d3f98970e-ex_data.o 89/out/f8e4fd781484bd36-bcm.o 89/out/001247bc65c2f5e5-cpucap.o 89/out/65fbbb68d007b209-hpke.o(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.