# niccoxx/kde-ollama-gui architecture

> Architecture diagram of the GitHub repository niccoxx/kde-ollama-gui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/niccoxx/kde-ollama-gui
- Repository: https://github.com/niccoxx/kde-ollama-gui

## Overview

Pastura is a native Linux Qt client for Ollama. The main workflow is choosing an installed model, composing a message (optionally with attachments), and receiving a streamed response; users can then manage saved conversations. The README also documents model-library and server-management features, plus appearance, language, and system-tray options. The implementation is a single large module, so distinct responsibilities share its path. Edges reflect documented behavior; the excerpts do not show most internal wiring.

Main entry points: [`pastura.py`](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py) (Chat Window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Chat and History"]
  node_window["Chat Window<br/>[pastura.py]"]
  node_composer["Message Composer<br/>[pastura.py]"]
  node_attachments["Attachments<br/>[pastura.py]"]
  node_streaming["Streaming Chat<br/>[pastura.py]"]
  node_conversation_actions["Conversation Actions<br/>[pastura.py]"]
  node_chat_history["Chat History<br/>[pastura.py]"]
  node_chat_storage[("Chat Files<br/>[pastura.py]")]
end

subgraph group_models["Models and Ollama"]
  node_model_picker["Model Picker<br/>[pastura.py]"]
  node_model_manager["Model Manager<br/>[pastura.py]"]
  node_model_library["Model Library<br/>[pastura.py]"]
  node_ollama_api["Ollama Client<br/>[pastura.py]"]
  node_ollama_server{{"Ollama Server"}}
  node_ollama_library{{"Ollama Model Library"}}
end

subgraph group_preferences["Preferences and Display"]
  node_settings["Settings<br/>[pastura.py]"]
  node_appearance["Theme and Accent<br/>[pastura.py]"]
  node_localization["Language<br/>[pastura.py]"]
end

subgraph group_desktop["Desktop Integration"]
  node_server_control["Server Startup<br/>[pastura.py]"]
  node_system_tray["System Tray<br/>[pastura.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_window
node_window -->|"composes in"| node_composer
node_composer -->|"adds files"| node_attachments
node_window -->|"sends chat"| node_streaming
node_streaming -->|"streams through"| node_ollama_api
node_ollama_api -->|"requests"| node_ollama_server
node_window -->|"selects model"| node_model_picker
node_model_picker -->|"loads models"| node_ollama_api
node_window -->|"manages chats"| node_conversation_actions
node_conversation_actions -->|"updates"| node_chat_history
node_chat_history -->|"reads and writes"| node_chat_storage
node_window -->|"opens"| node_model_manager
node_model_manager -->|"manages models"| node_ollama_api
node_model_manager -->|"browses"| node_model_library
node_model_library -->|"searches"| node_ollama_library
node_model_library -->|"downloads models"| node_ollama_api
node_user -->|"configures"| node_settings
node_settings -->|"sets appearance"| node_appearance
node_settings -->|"sets language"| node_localization
node_settings -->|"configures server"| node_ollama_api
node_user -->|"starts server"| node_server_control
node_server_control -->|"starts"| node_ollama_server
node_user -->|"uses"| node_system_tray

click node_window "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_composer "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_attachments "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_streaming "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_conversation_actions "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_chat_history "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_chat_storage "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_model_picker "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_model_manager "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_model_library "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_ollama_api "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_settings "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_appearance "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_localization "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_server_control "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"
click node_system_tray "https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py"

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_window,node_composer,node_attachments,node_streaming,node_conversation_actions,node_chat_history,node_chat_storage,node_user toneBlue
class node_model_picker,node_model_manager,node_model_library,node_ollama_api,node_ollama_server,node_ollama_library toneAmber
class node_settings,node_appearance,node_localization toneMint
class node_server_control,node_system_tray toneRose
```

## Components

### Chat and History

- [Chat Window](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Message Composer](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Attachments](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Streaming Chat](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Conversation Actions](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Chat History](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Chat Files](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`

### Models and Ollama

- [Model Picker](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Model Manager](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Model Library](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Ollama Client](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- **Ollama Server**
- **Ollama Model Library**

### Preferences and Display

- [Settings](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Theme and Accent](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [Language](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`

### Desktop Integration

- [Server Startup](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`
- [System Tray](https://github.com/niccoxx/kde-ollama-gui/blob/main/pastura.py): `pastura.py`

### Other components

- **User**

## Connections

- User → Chat Window: uses (evidence: `README.md`)
- Chat Window → Message Composer: composes in (evidence: `README.md`)
- Message Composer → Attachments: adds files (evidence: `README.md`)
- Chat Window → Streaming Chat: sends chat (evidence: `README.md`)
- Streaming Chat → Ollama Client: streams through (evidence: `README.md`)
- Ollama Client → Ollama Server: requests (evidence: `README.md`)
- Chat Window → Model Picker: selects model (evidence: `README.md`)
- Model Picker → Ollama Client: loads models (evidence: `README.md`)
- Chat Window → Conversation Actions: manages chats (evidence: `README.md`)
- Conversation Actions → Chat History: updates (evidence: `README.md`)
- Chat History → Chat Files: reads and writes (evidence: `README.md`)
- Chat Window → Model Manager: opens (evidence: `README.md`)
- Model Manager → Ollama Client: manages models (evidence: `README.md`)
- Model Manager → Model Library: browses (evidence: `README.md`)
- Model Library → Ollama Model Library: searches (evidence: `README.md`)
- Model Library → Ollama Client: downloads models (evidence: `README.md`)
- User → Settings: configures (evidence: `README.md`)
- Settings → Theme and Accent: sets appearance (evidence: `README.md`)
- Settings → Language: sets language (evidence: `README.md`)
- Settings → Ollama Client: configures server (evidence: `README.md`)
- User → Server Startup: starts server (evidence: `README.md`)
- Server Startup → Ollama Server: starts (evidence: `README.md`)
- User → System Tray: uses (evidence: `README.md`)
