Lumen
Premium native desktop AI application providing a local LLM chat interface via Ollama, fully offline, fully private, zero telemetry.
Signature: Local-first inference · multi-process isolation · buffered token streaming
Key Verified Performance Metrics
01 System Context & Problem
Developers who want to use large language models face a choice between cloud APIs that expose private data externally and complex self-hosted setups with no premium UI. No existing tool combined local-only inference with a crafted, developer-grade desktop experience.
02 Architecture & Implementation
Multi-process Electron architecture with absolute boundary separation: a Node.js Main process managing SQLite via Drizzle ORM and Ollama HTTP integration; a Preload bridge exposing typed namespaced APIs via contextBridge; a Shared Contract Layer of TypeScript types and Zod validation schemas; and a React Renderer process with seven independently partitioned Zustand stores.
Engineering Approach: Built a native Electron application communicating with a locally running Ollama server over HTTP on localhost. All conversations are stored in a local SQLite database. No cloud backend, no telemetry, no remote API calls.
03 Technical Decisions & Trade-offs
Core Architectural Decision
Enforced Main/Renderer process separation via contextBridge to prevent RCE attack surfaces. All IPC channels follow typed namespace contracts: window.api.chat, window.api.models, window.api.database, window.api.settings, with Zod validation at both process boundaries.
Constraints & Incurred Trade-off
All UI-to-database operations require async IPC serialization, adding a slight round-trip cost. Process boundary separation prevents direct Node.js access from the Renderer, so every persistence call crosses the IPC boundary.
04 Scalability, Throughput & Security
State is partitioned across seven independent Zustand stores to prevent wide re-render cycles. SQLite runs in WAL mode with a 5000ms busy timeout, enabling concurrent read access alongside active write transactions.
Targets cold start under 1.5 seconds, theme switch latency under 50ms, streaming input latency under 30ms from socket receipt to screen update, and search retrieval under 50ms for up to 10,000 historical messages.
05 Verified Outcomes
- Designed a secure multi-process Electron architecture by sandboxing the renderer (contextIsolation: true, nodeIntegration: false) and routing all 17 filesystem, database, and network operations through a single Zod-validated IPC bridge, preventing renderer-level access to privileged system APIs.
- Engineered a resilient local LLM streaming pipeline with adaptive exponential backoff, request abort tracking, and a partitioned 7-store Zustand architecture backed by SQLite persistence, ensuring application state remained consistent across interrupted or failed requests.