# techjarves/uncensored-local-ai-multiplatform architecture

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

- Interactive diagram: https://gitdiagram.com/techjarves/uncensored-local-ai-multiplatform
- Repository: https://github.com/techjarves/uncensored-local-ai-multiplatform

## Overview

Uncensored Local AI is a Flutter app for running open-source language models on-device. The main user journey is to obtain a model through the model library, load it, chat locally, and retain conversations in local history. A separate settings-driven capability exposes an OpenAI-compatible local HTTP API for external clients. The README also documents model import, loading progress, cancellation, and live generation metrics. Flutter implementation files are present in the tree, but their source was not sampled; relationships below rely on README statements, so internal call ownership cannot be verified.

Main entry points: [`lib/screens/home_screen.dart`](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/home_screen.dart) (Home screen), [`lib/screens/model_library_screen.dart`](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/model_library_screen.dart) (Model library), [`lib/services/local_api_server_service.dart`](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/local_api_server_service.dart) (Local API server), [`lib/screens/settings_screen.dart`](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/settings_screen.dart) (Settings screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_settings["Settings screen"]
  node_logs["Logs screen<br/>[logs_screen.dart]"]
  node_log_service["Log service<br/>[log_service.dart]"]
end

subgraph group_models["Model runtime"]
  node_model_library["Model library"]
  node_model_card["Model card<br/>[model_card.dart]"]
  node_model_controller["Model controller"]
  node_model_manager["Model manager<br/>[model_manager.dart]"]
  node_model_catalog["Model catalog"]
  node_llm["LLM service<br/>[llm_service.dart]"]
  node_metrics["Loading metrics"]
end

subgraph group_conversation["Conversation"]
  node_chat_controller["Chat controller"]
  node_chat_ui["Chat UI<br/>[home_screen.dart]"]
  node_chat_history["Chat history<br/>[chat_sidebar.dart]"]
  node_chat_storage["Chat storage"]
  node_local_store[("Local history store")]
end

subgraph group_integration["Local integration"]
  node_api_server["Local API server"]
  node_api_screen["API settings"]
end

node_user(("User"))
node_client(("API client"))

node_user -->|"choose model"| node_model_library
node_model_library -->|"browse catalog"| node_model_catalog
node_model_library -->|"download or import"| node_model_manager
node_user -->|"start chatting"| node_home
node_home -->|"chat locally"| node_llm
node_home -->|"view history"| node_chat_history
node_chat_history -->|"load history"| node_chat_storage
node_chat_storage -->|"persist locally"| node_local_store
node_user -->|"configure server"| node_settings
node_settings -->|"toggle server"| node_api_server
node_client -->|"send API requests"| node_api_server
node_api_server -->|"serve completions"| node_llm
node_model_manager -->|"report progress"| node_metrics
node_user -.->|"inspect logs"| node_logs
node_logs -.->|"read logs"| node_log_service

click node_home "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/home_screen.dart"
click node_settings "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/settings_screen.dart"
click node_model_library "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/model_library_screen.dart"
click node_model_card "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/widgets/model_card.dart"
click node_model_controller "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/controllers/model_controller.dart"
click node_model_manager "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/model_manager.dart"
click node_model_catalog "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/assets/models_catalog.json"
click node_llm "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/llm_service.dart"
click node_chat_controller "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/controllers/chat_controller.dart"
click node_chat_ui "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/home_screen.dart"
click node_chat_history "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/widgets/chat_sidebar.dart"
click node_chat_storage "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/chat_storage_service.dart"
click node_local_store "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/chat_storage_service.dart"
click node_api_server "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/local_api_server_service.dart"
click node_api_screen "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/api_endpoints_screen.dart"
click node_logs "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/logs_screen.dart"
click node_log_service "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/log_service.dart"
click node_metrics "https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/models/download_state.dart"

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_home,node_settings,node_logs,node_log_service,node_user,node_client toneBlue
class node_model_library,node_model_card,node_model_controller,node_model_manager,node_model_catalog,node_llm,node_metrics toneAmber
class node_chat_controller,node_chat_ui,node_chat_history,node_chat_storage,node_local_store toneMint
class node_api_server,node_api_screen toneRose
```

## Components

### App experience

- [Home screen](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Settings screen](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`
- [Logs screen](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/logs_screen.dart): `lib/screens/logs_screen.dart`
- [Log service](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/log_service.dart): `lib/services/log_service.dart`

### Model runtime

- [Model library](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/model_library_screen.dart): `lib/screens/model_library_screen.dart`
- [Model card](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/widgets/model_card.dart): `lib/widgets/model_card.dart`
- [Model controller](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/controllers/model_controller.dart): `lib/controllers/model_controller.dart`
- [Model manager](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/model_manager.dart): `lib/services/model_manager.dart`
- [Model catalog](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/assets/models_catalog.json): `assets/models_catalog.json`
- [LLM service](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/llm_service.dart): `lib/services/llm_service.dart`
- [Loading metrics](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/models/download_state.dart): `lib/models/download_state.dart`

### Conversation

- [Chat controller](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/controllers/chat_controller.dart): `lib/controllers/chat_controller.dart`
- [Chat UI](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Chat history](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/widgets/chat_sidebar.dart): `lib/widgets/chat_sidebar.dart`
- [Chat storage](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/chat_storage_service.dart): `lib/services/chat_storage_service.dart`
- [Local history store](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/chat_storage_service.dart): `lib/services/chat_storage_service.dart`

### Local integration

- [Local API server](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/services/local_api_server_service.dart): `lib/services/local_api_server_service.dart`
- [API settings](https://github.com/techjarves/uncensored-local-ai-multiplatform/blob/main/lib/screens/api_endpoints_screen.dart): `lib/screens/api_endpoints_screen.dart`

### Other components

- **User**
- **API client**

## Connections

- User → Model library: choose model (evidence: `README.md`)
- Model library → Model catalog: browse catalog (evidence: `README.md`)
- Model library → Model manager: download or import (evidence: `README.md`)
- User → Home screen: start chatting (evidence: `README.md`)
- Home screen → LLM service: chat locally (evidence: `README.md`)
- Home screen → Chat history: view history (evidence: `README.md`)
- Chat history → Chat storage: load history (evidence: `README.md`)
- Chat storage → Local history store: persist locally (evidence: `README.md`)
- User → Settings screen: configure server (evidence: `README.md`)
- Settings screen → Local API server: toggle server (evidence: `README.md`)
- API client → Local API server: send API requests (evidence: `README.md`)
- Local API server → LLM service: serve completions (evidence: `README.md`)
- Model manager → Loading metrics: report progress (evidence: `README.md`)
- User → Logs screen: inspect logs
- Logs screen → Log service: read logs
