Skip to content

Commit de8c66a

Browse files
committed
feat(server): remove egui web UI POC and cleanup dependencies
- Remove 'egui-web' feature and eframe/wasm32 dependencies from server crate. - Delete egui web UI source code, HTML, and build scripts. - Remove egui routes and handlers from HTTP server. - Update documentation and .gitignore to reflect the removal of the POC.
1 parent df6fad2 commit de8c66a

16 files changed

Lines changed: 3 additions & 1086 deletions

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,3 @@ target
2626
.*
2727
!.gitignore
2828
!.github/
29-
30-
# WASM build artifacts (generated by build-egui-web.sh)
31-
crates/server/ui/egui/*.wasm
32-
crates/server/ui/egui/*.js
33-
crates/server/ui/egui/*.d.ts
34-
opencode.json

CLAUDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ LocalGPT is a local-only AI assistant with persistent markdown-based memory and
5757
crates/
5858
├── core/ # localgpt-core — shared library (agent, memory, config, security)
5959
├── cli/ # localgpt — binary with clap CLI, desktop GUI, dangerous tools
60-
├── server/ # localgpt-server — HTTP/WS API, Telegram bot, optional WASM web UI
60+
├── server/ # localgpt-server — HTTP/WS API, Telegram bot, embedded Web UI
6161
├── sandbox/ # localgpt-sandbox — Landlock/Seatbelt process sandboxing
6262
├── mobile/ # localgpt-mobile — UniFFI bindings for iOS/Android
6363
└── gen/ # localgpt-gen — Bevy 3D scene generation binary
@@ -129,7 +129,6 @@ Mobile crate uses `default-features = false, features = ["embeddings-openai"]`
129129

130130
- **http.rs** — Axum REST API with RustEmbed'd Web UI. Routes: `/health`, `/api/status`, `/api/chat`, `/api/memory/search`, `/api/memory/stats`
131131
- **telegram.rs** — Telegram bot with 6-digit pairing auth, streaming edits, agent ID `"telegram"`
132-
- Optional `egui-web` feature for WASM web UI
133132

134133
### Gen (3D Scene Generation with Audio)
135134

Cargo.lock

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GEMINI.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LocalGPT is a local-first, privacy-focused AI assistant built in Rust. It is ins
99
- **Language**: Rust (Edition 2024)
1010
- **Async Runtime**: [Tokio](https://tokio.rs/)
1111
- **Database**: SQLite with FTS5 (keyword search) and `sqlite-vec` (semantic search)
12-
- **UI**: CLI (clap), Desktop/Web (egui/eframe), Telegram (teloxide)
12+
- **UI**: CLI (clap), Desktop (egui/eframe), Telegram (teloxide)
1313
- **Security**: OS-level sandboxing (Landlock on Linux, Seatbelt on macOS)
1414
- **LLM Providers**: Support for Anthropic, OpenAI, Ollama, xAI, and OAuth-based subscriptions.
1515

@@ -67,12 +67,6 @@ cargo fmt --all -- --check
6767
cargo clippy --workspace -- -D warnings
6868
```
6969

70-
### Frontend (Egui Web)
71-
```bash
72-
# Build the WASM-based web UI
73-
./build-egui-web.sh
74-
```
75-
7670
## Coding Conventions
7771

7872
- **Error Handling**: Use `anyhow::Result` for application-level logic and `thiserror` for library-level error types in `crates/core`.

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,6 @@ When the daemon is running:
304304
| `GET /api/saved-sessions/{session_id}` | Get persisted session |
305305
| `GET /api/logs/daemon` | Tail daemon logs |
306306

307-
### Egui Web UI (PoC)
308-
309-
LocalGPT includes a Proof of Concept for running the desktop Egui UI in the browser via WebAssembly. This enables code reuse between desktop and web interfaces.
310-
311-
**Try it**: After building the WASM UI with `./build-egui-web.sh`, visit `http://localhost:31327/egui`
312-
313-
See [`docs/egui-web-poc.md`](docs/egui-web-poc.md) for details on architecture, benefits, tradeoffs, and implementation.
314-
315307
## <img src="https://localgpt.app/logo/localgpt-icon.png" width="100" height="100" alt="LocalGPT" /> Gen Mode (World Generation)
316308

317309
`Gen` is a separate binary (`localgpt-gen`) in the workspace — not a `localgpt gen` subcommand.

build-egui-web.sh

Lines changed: 0 additions & 80 deletions
This file was deleted.

crates/server/Cargo.toml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ description = "LocalGPT HTTP server and Telegram bot"
88
publish = false
99

1010
[lib]
11-
crate-type = ["cdylib", "rlib"]
11+
crate-type = ["rlib"]
1212

1313
[dependencies]
1414
serde = { workspace = true }
1515
serde_json = { workspace = true }
1616

17-
# Egui web UI (optional)
18-
eframe = { version = "0.33", optional = true, default-features = false, features = ["glow"] }
19-
2017
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2118
localgpt-core = { workspace = true }
2219

@@ -42,16 +39,5 @@ teloxide = { version = "0.17", features = ["macros"] }
4239
tokio-stream = "0.1"
4340
async-stream = "0.3"
4441

45-
[target.'cfg(target_arch = "wasm32")'.dependencies]
46-
wasm-bindgen = "0.2"
47-
wasm-bindgen-futures = "0.4"
48-
web-sys = { version = "0.3", features = ["HtmlCanvasElement", "Window", "Document"] }
49-
console_error_panic_hook = "0.1"
50-
getrandom = { version = "0.3", features = ["wasm_js"] }
51-
52-
[package.metadata.wasm-pack.profile.release]
53-
wasm-opt = false
54-
5542
[features]
5643
default = []
57-
egui-web = ["eframe"]

crates/server/src/http.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ impl Server {
139139
// Web UI routes
140140
.route("/", get(serve_ui_index))
141141
.route("/ui/{*path}", get(serve_ui_file))
142-
// Egui web UI routes (PoC)
143-
.route("/egui", get(serve_egui_index))
144-
.route("/egui/{*path}", get(serve_egui_file))
145142
// API routes
146143
.route("/health", get(health_check))
147144
.route("/api/sessions", post(create_session))
@@ -369,18 +366,6 @@ fn serve_ui_asset(path: &str) -> Response {
369366
}
370367
}
371368

372-
// Serve egui web UI index
373-
async fn serve_egui_index() -> Response {
374-
serve_ui_asset("egui.html")
375-
}
376-
377-
// Serve egui web UI files (WASM, JS, etc.)
378-
async fn serve_egui_file(Path(path): Path<String>) -> Response {
379-
// Serve WASM artifacts from ui/egui/ directory
380-
let egui_path = format!("egui/{}", path);
381-
serve_ui_asset(&egui_path)
382-
}
383-
384369
// Status endpoint
385370
#[derive(Serialize)]
386371
struct StatusResponse {

crates/server/src/lib.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,5 @@ pub mod telegram;
55
#[cfg(not(target_arch = "wasm32"))]
66
mod websocket;
77

8-
#[cfg(feature = "egui-web")]
9-
pub mod web;
10-
118
#[cfg(not(target_arch = "wasm32"))]
129
pub use http::Server;
13-
14-
// WASM entry point for egui web UI
15-
#[cfg(all(target_arch = "wasm32", feature = "egui-web"))]
16-
use wasm_bindgen::prelude::*;
17-
18-
#[cfg(all(target_arch = "wasm32", feature = "egui-web"))]
19-
#[wasm_bindgen]
20-
pub async fn start_web_ui(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
21-
// Redirect `log` message to `console.log` and friends:
22-
console_error_panic_hook::set_once();
23-
24-
let web_options = eframe::WebOptions::default();
25-
26-
let document = web_sys::window()
27-
.ok_or("No window")?
28-
.document()
29-
.ok_or("No document")?;
30-
31-
let canvas = document
32-
.get_element_by_id(canvas_id)
33-
.ok_or_else(|| format!("Failed to find canvas with id: {}", canvas_id))?
34-
.dyn_into::<web_sys::HtmlCanvasElement>()
35-
.map_err(|_| format!("{} was not a HtmlCanvasElement", canvas_id))?;
36-
37-
eframe::WebRunner::new()
38-
.start(
39-
canvas,
40-
web_options,
41-
Box::new(|cc| Ok(Box::new(web::WebApp::new(cc)))),
42-
)
43-
.await
44-
}

0 commit comments

Comments
 (0)