# open-webui/desktop architecture

> Architecture diagram of the GitHub repository open-webui/desktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-webui/desktop
- Repository: https://github.com/open-webui/desktop
- Video tour (about a minute): https://gitdiagram.com/open-webui/desktop/video

## Overview

Open WebUI Desktop is an Electron desktop client that can launch a local Open WebUI server, optionally manage llama.cpp for offline inference, or connect to remote Open WebUI servers. The main workflow is setup or connection selection, connection activation, then rendering the server in the desktop interface. The README documents Spotlight, voice input, and background updates as additional capabilities. Some IPC and feature wiring is not visible in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`src/renderer/src/lib/components/Main/Connections.svelte`](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections.svelte) (Connection manager), [`src/renderer/src/App.svelte`](https://github.com/open-webui/desktop/blob/main/src/renderer/src/App.svelte) (App entry), [`src/renderer/src/lib/components/Main.svelte`](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main.svelte) (Main interface), [`src/main/utils/llamacpp.ts`](https://github.com/open-webui/desktop/blob/main/src/main/utils/llamacpp.ts) (llama.cpp manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop shell"]
  node_renderer["App entry<br/>[App.svelte]"]
  node_mainview["Main interface<br/>[Main.svelte]"]
  node_mainproc["Electron main process<br/>[index.ts]"]
  node_preload["IPC bridge<br/>[index.ts]"]
end

subgraph group_connections["Setup and connections"]
  node_setup["Connection setup"]
  node_connectionui["Connection manager<br/>[Connections.svelte]"]
  node_connectioncontent["Connection content<br/>[Content.svelte]"]
  node_sidebar["Connection sidebar<br/>[Sidebar.svelte]"]
end

subgraph group_local["Local services"]
  node_localinstall["Local installation"]
  node_webuihost["Open WebUI host<br/>[index.ts]"]
  node_llamacpp["llama.cpp manager<br/>[llamacpp.ts]"]
  node_huggingface["Model downloads<br/>[huggingface.ts]"]
  node_servicelock["Service locking<br/>[service-lock.ts]"]
  node_settings["Settings"]
end

subgraph group_features["Desktop features"]
  node_spotlight["Spotlight chat<br/>[Spotlight.svelte]"]
  node_voice["Voice input<br/>[VoiceInput.svelte]"]
  node_updater["Background updates<br/>[updater.ts]"]
end

subgraph group_state["Renderer state"]
  node_stores["UI state<br/>[stores.ts]"]
end

node_user(("Desktop user"))
node_remote{{"Open WebUI server"}}

node_user -->|"launches"| node_renderer
node_renderer -->|"renders"| node_mainview
node_mainview -->|"renders"| node_connectionui
node_mainview -->|"opens"| node_settings
node_user -->|"adds server"| node_setup
node_setup -->|"requests connection"| node_preload
node_connectionui -->|"requests connect"| node_preload
node_connectionui -->|"renders"| node_sidebar
node_connectionui -->|"renders"| node_connectioncontent
node_connectioncontent -->|"offers setup"| node_localinstall
node_mainproc -->|"starts server"| node_webuihost
node_mainproc -->|"manages runtime"| node_llamacpp
node_llamacpp -->|"acquires lock"| node_servicelock
node_llamacpp -->|"downloads assets"| node_huggingface
node_settings -->|"controls runtime"| node_preload
node_webuihost -->|"serves locally"| node_remote
node_connectionui -->|"connects remotely"| node_remote
node_connectionui -->|"updates state"| node_stores
node_renderer -->|"loads app state"| node_stores
node_user -->|"summons chat"| node_spotlight
node_user -->|"dictates query"| node_voice
node_updater -.->|"integrates updates"| node_mainproc

click node_renderer "https://github.com/open-webui/desktop/blob/main/src/renderer/src/App.svelte"
click node_mainview "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main.svelte"
click node_mainproc "https://github.com/open-webui/desktop/blob/main/src/main/index.ts"
click node_preload "https://github.com/open-webui/desktop/blob/main/src/preload/index.ts"
click node_setup "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Setup/ConnectionManager.svelte"
click node_connectionui "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections.svelte"
click node_connectioncontent "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections/Content.svelte"
click node_sidebar "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections/Sidebar.svelte"
click node_localinstall "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Setup/LocalInstall.svelte"
click node_webuihost "https://github.com/open-webui/desktop/blob/main/src/main/utils/index.ts"
click node_llamacpp "https://github.com/open-webui/desktop/blob/main/src/main/utils/llamacpp.ts"
click node_huggingface "https://github.com/open-webui/desktop/blob/main/src/main/utils/huggingface.ts"
click node_servicelock "https://github.com/open-webui/desktop/blob/main/src/main/utils/service-lock.ts"
click node_settings "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Settings/InferenceRuntime.svelte"
click node_spotlight "https://github.com/open-webui/desktop/blob/main/src/renderer/src/components/Spotlight.svelte"
click node_voice "https://github.com/open-webui/desktop/blob/main/src/renderer/src/components/VoiceInput.svelte"
click node_updater "https://github.com/open-webui/desktop/blob/main/src/main/updater.ts"
click node_stores "https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/stores.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_renderer,node_mainview,node_mainproc,node_preload,node_user,node_remote toneBlue
class node_setup,node_connectionui,node_connectioncontent,node_sidebar toneAmber
class node_localinstall,node_webuihost,node_llamacpp,node_huggingface,node_servicelock,node_settings toneMint
class node_spotlight,node_voice,node_updater toneRose
class node_stores toneIndigo
```

## Components

### Desktop shell

- [App entry](https://github.com/open-webui/desktop/blob/main/src/renderer/src/App.svelte): `src/renderer/src/App.svelte`
- [Main interface](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main.svelte): `src/renderer/src/lib/components/Main.svelte`
- [Electron main process](https://github.com/open-webui/desktop/blob/main/src/main/index.ts): `src/main/index.ts`
- [IPC bridge](https://github.com/open-webui/desktop/blob/main/src/preload/index.ts): `src/preload/index.ts`

### Setup and connections

- [Connection setup](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Setup/ConnectionManager.svelte): `src/renderer/src/lib/components/Setup/ConnectionManager.svelte`
- [Connection manager](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections.svelte): `src/renderer/src/lib/components/Main/Connections.svelte`
- [Connection content](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections/Content.svelte): `src/renderer/src/lib/components/Main/Connections/Content.svelte`
- [Connection sidebar](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Connections/Sidebar.svelte): `src/renderer/src/lib/components/Main/Connections/Sidebar.svelte`

### Local services

- [Local installation](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Setup/LocalInstall.svelte): `src/renderer/src/lib/components/Setup/LocalInstall.svelte`
- [Open WebUI host](https://github.com/open-webui/desktop/blob/main/src/main/utils/index.ts): `src/main/utils/index.ts`
- [llama.cpp manager](https://github.com/open-webui/desktop/blob/main/src/main/utils/llamacpp.ts): `src/main/utils/llamacpp.ts`
- [Model downloads](https://github.com/open-webui/desktop/blob/main/src/main/utils/huggingface.ts): `src/main/utils/huggingface.ts`
- [Service locking](https://github.com/open-webui/desktop/blob/main/src/main/utils/service-lock.ts): `src/main/utils/service-lock.ts`
- [Settings](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/components/Main/Settings/InferenceRuntime.svelte): `src/renderer/src/lib/components/Main/Settings/InferenceRuntime.svelte`

### Desktop features

- [Spotlight chat](https://github.com/open-webui/desktop/blob/main/src/renderer/src/components/Spotlight.svelte): `src/renderer/src/components/Spotlight.svelte`
- [Voice input](https://github.com/open-webui/desktop/blob/main/src/renderer/src/components/VoiceInput.svelte): `src/renderer/src/components/VoiceInput.svelte`
- [Background updates](https://github.com/open-webui/desktop/blob/main/src/main/updater.ts): `src/main/updater.ts`

### Renderer state

- [UI state](https://github.com/open-webui/desktop/blob/main/src/renderer/src/lib/stores.ts): `src/renderer/src/lib/stores.ts`

### Other components

- **Desktop user**
- **Open WebUI server**

## Connections

- Desktop user → App entry: launches (evidence: `README.md`)
- App entry → Main interface: renders (evidence: `src/renderer/src/App.svelte`)
- Main interface → Connection manager: renders (evidence: `src/renderer/src/lib/components/Main.svelte`)
- Main interface → Settings: opens (evidence: `src/renderer/src/lib/components/Main.svelte`)
- Desktop user → Connection setup: adds server (evidence: `README.md`)
- Connection setup → IPC bridge: requests connection (evidence: `src/renderer/src/lib/components/Setup/ConnectionManager.svelte`)
- Connection manager → IPC bridge: requests connect (evidence: `src/renderer/src/lib/components/Main/Connections.svelte`)
- Connection manager → Connection sidebar: renders (evidence: `src/renderer/src/lib/components/Main/Connections.svelte`)
- Connection manager → Connection content: renders (evidence: `src/renderer/src/lib/components/Main/Connections.svelte`)
- Connection content → Local installation: offers setup (evidence: `src/renderer/src/lib/components/Main/Connections/Content.svelte`)
- Electron main process → Open WebUI host: starts server (evidence: `src/main/index.ts`)
- Electron main process → llama.cpp manager: manages runtime (evidence: `src/main/index.ts`)
- llama.cpp manager → Service locking: acquires lock (evidence: `src/main/utils/llamacpp.ts`)
- llama.cpp manager → Model downloads: downloads assets (evidence: `src/main/utils/llamacpp.ts`)
- Settings → IPC bridge: controls runtime (evidence: `src/renderer/src/lib/components/Main/Settings/InferenceRuntime.svelte`)
- Open WebUI host → Open WebUI server: serves locally (evidence: `README.md`)
- Connection manager → Open WebUI server: connects remotely (evidence: `README.md`)
- Connection manager → UI state: updates state (evidence: `src/renderer/src/lib/components/Main/Connections.svelte`)
- App entry → UI state: loads app state (evidence: `src/renderer/src/App.svelte`)
- Desktop user → Spotlight chat: summons chat (evidence: `README.md`)
- Desktop user → Voice input: dictates query (evidence: `README.md`)
- Background updates → Electron main process: integrates updates (evidence: `src/main/index.ts`)
