# nsoro-allan/llamadesk architecture

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

- Interactive diagram: https://gitdiagram.com/nsoro-allan/llamadesk
- Repository: https://github.com/nsoro-allan/llamadesk

## Overview

llamaDesk is a Tauri desktop chat client for local Ollama models. The main workflow is composing a prompt, optionally attaching files, streaming a model reply, and saving the conversation locally. The frontend also manages model discovery, settings, rendering, and history; voice transcription is provided by the registered native STT plugin. The sampled frontend is one large module, so several responsibilities share its path. Other frontend details are represented from README capabilities rather than inspected source excerpts.

Main entry points: [`src/app.js`](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js) (Chat interface), [`src-tauri/src/lib.rs`](https://github.com/nsoro-allan/llamadesk/blob/main/src-tauri/src/lib.rs) (Tauri application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat experience"]
  node_frontend["Chat interface<br/>[app.js]"]
  node_attachments["Attachment handling<br/>[app.js]"]
  node_streaming["Reply streaming<br/>[app.js]"]
  node_markdown["Reply rendering<br/>[app.js]"]
  node_history["Chat history<br/>[app.js]"]
  node_localstorage[("Browser local storage")]
end

subgraph group_models["Models and settings"]
  node_modelpicker["Model picker<br/>[app.js]"]
  node_vision["Vision capability check<br/>[app.js]"]
  node_settings["Chat settings<br/>[app.js]"]
end

subgraph group_native["Desktop and voice"]
  node_tauri["Tauri application<br/>[lib.rs]"]
  node_stt["Whisper STT plugin"]
end

node_user(("Desktop user"))
node_ollama["Ollama service"]

node_user -->|"composes chat"| node_frontend
node_frontend -->|"adds files"| node_attachments
node_frontend -->|"sends prompt"| node_streaming
node_streaming -->|"streams chat"| node_ollama
node_ollama -->|"returns tokens"| node_streaming
node_streaming -->|"renders reply"| node_markdown
node_frontend -->|"manages chats"| node_history
node_history -->|"persists chats"| node_localstorage
node_modelpicker -->|"lists models"| node_ollama
node_vision -->|"checks model"| node_ollama
node_settings -->|"stores preferences"| node_localstorage
node_settings -->|"configures address"| node_ollama
node_user -->|"uses desktop app"| node_tauri
node_frontend -->|"starts listening"| node_stt
node_stt -->|"delivers transcript"| node_frontend
node_tauri -->|"registers plugin"| node_stt

click node_frontend "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_attachments "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_streaming "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_markdown "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_history "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_modelpicker "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_vision "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_settings "https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js"
click node_tauri "https://github.com/nsoro-allan/llamadesk/blob/main/src-tauri/src/lib.rs"

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_frontend,node_attachments,node_streaming,node_markdown,node_history,node_localstorage,node_user toneBlue
class node_modelpicker,node_vision,node_settings toneAmber
class node_tauri,node_stt toneMint
class node_ollama toneIndigo
```

## Components

### Chat experience

- [Chat interface](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Attachment handling](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Reply streaming](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Reply rendering](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Chat history](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- **Browser local storage**

### Models and settings

- [Model picker](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Vision capability check](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`
- [Chat settings](https://github.com/nsoro-allan/llamadesk/blob/main/src/app.js): `src/app.js`

### Desktop and voice

- [Tauri application](https://github.com/nsoro-allan/llamadesk/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- **Whisper STT plugin**

### Other components

- **Desktop user**
- **Ollama service**

## Connections

- Desktop user → Chat interface: composes chat (evidence: `README.md`)
- Chat interface → Attachment handling: adds files (evidence: `README.md`)
- Chat interface → Reply streaming: sends prompt (evidence: `src/app.js`)
- Reply streaming → Ollama service: streams chat (evidence: `src/app.js`)
- Ollama service → Reply streaming: returns tokens (evidence: `README.md`)
- Reply streaming → Reply rendering: renders reply (evidence: `README.md`)
- Chat interface → Chat history: manages chats (evidence: `README.md`)
- Chat history → Browser local storage: persists chats (evidence: `src/app.js`)
- Model picker → Ollama service: lists models (evidence: `src/app.js`)
- Vision capability check → Ollama service: checks model (evidence: `README.md`)
- Chat settings → Browser local storage: stores preferences (evidence: `README.md`)
- Chat settings → Ollama service: configures address (evidence: `README.md`)
- Desktop user → Tauri application: uses desktop app (evidence: `README.md`)
- Chat interface → Whisper STT plugin: starts listening (evidence: `src/app.js`)
- Whisper STT plugin → Chat interface: delivers transcript (evidence: `src/app.js`)
- Tauri application → Whisper STT plugin: registers plugin (evidence: `src-tauri/src/lib.rs`)
