# lenovolquser15-ai/local-ai-ide architecture

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

- Interactive diagram: https://gitdiagram.com/lenovolquser15-ai/local-ai-ide
- Repository: https://github.com/lenovolquser15-ai/local-ai-ide

## Overview

LocalHarness is a local-LLM agent application with a browser UI, HTTP/SSE server, persistent sessions, and tool execution. The main workflow is a user submitting a request through the UI; the server exposes the application API, the agent coordinates model calls and tools, and session storage retains the conversation. The README also describes model management, file/RAG workflows, voice, training, plugins, scheduling, dashboards, and clustering. Some subsystem links are omitted where the sampled source does not establish their runtime caller.

Main entry points: [`harness/server.py`](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/server.py) (HTTP and SSE Server), [`harness/tools.py`](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/tools.py) (Tool Execution), [`harness/llm.py`](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/llm.py) (LLM Client), [`harness/lms.py`](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/lms.py) (LM Studio Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interface and API"]
  node_webui["Web UI<br/>[app.js]"]
  node_server["HTTP and SSE Server<br/>[server.py]"]
end

subgraph group_agent["Agent Runtime"]
  node_agentloop["Agent Loop<br/>[agent.py]"]
  node_toolruntime["Tool Execution<br/>[tools.py]"]
  node_sessions[("Session History<br/>[session.py]")]
end

subgraph group_models["Local Models"]
  node_llmclient["LLM Client<br/>[llm.py]"]
  node_provider["LM Studio and Ollama"]
  node_lmstudio["LM Studio Management<br/>[lms.py]"]
  node_configuration[("Configuration<br/>[config.py]")]
  node_dns["DNS Workaround<br/>[dnsfix.py]"]
end

subgraph group_workspace["Workspace Capabilities"]
  node_fileeditor["File Editor<br/>[files.py]"]
  node_knowledgebase[("RAG Knowledge Base<br/>[rag.py]")]
  node_search["Web Search<br/>[search.py]"]
  node_voice["Voice Call<br/>[voice.py]"]
end

subgraph group_extensions["Studio Extensions"]
  node_cluster["Wi-Fi Cluster<br/>[cluster.py]"]
  node_dashboard["System Dashboard<br/>[dashboard.py]"]
  node_thermal["GPU Thermal Control<br/>[thermal.py]"]
  node_trainer["LoRA Training Studio<br/>[unsloth_trainer.py]"]
  node_plugins["Plugin System<br/>[plugins.py]"]
  node_mcp["MCP Servers<br/>[mcp_client.py]"]
  node_scheduler["Prompt and Shell Scheduler<br/>[scheduler.py]"]
end

node_user(("User"))

node_user -->|"submits requests"| node_webui
node_webui -->|"uses API"| node_server
node_server -->|"handles model requests"| node_llmclient
node_server -->|"serves session history"| node_sessions
node_agentloop -->|"calls model"| node_llmclient
node_agentloop -->|"dispatches tools"| node_toolruntime
node_agentloop -->|"persists turns"| node_sessions
node_llmclient -->|"sends completions"| node_provider
node_llmclient -->|"checks readiness"| node_lmstudio
node_lmstudio -->|"reads settings"| node_configuration
node_server -->|"queries model status"| node_lmstudio
node_server -->|"reads thermal status"| node_thermal
node_server -->|"reports RAG status"| node_knowledgebase
node_server -->|"routes file requests"| node_fileeditor
node_toolruntime -->|"runs web search"| node_search
node_toolruntime -->|"uses RAG tools"| node_knowledgebase
node_toolruntime -->|"uses cluster tools"| node_cluster
node_toolruntime -->|"uses training tools"| node_trainer
node_toolruntime -->|"invokes MCP tools"| node_mcp
node_plugins -->|"loads settings"| node_configuration
node_dashboard -->|"reads GPU status"| node_thermal
node_thermal -->|"unloads models"| node_lmstudio
node_server -->|"applies DNS workaround"| node_dns
node_user -.->|"starts voice calls"| node_voice
node_user -.->|"starts fine-tuning"| node_trainer
node_user -.->|"configures schedules"| node_scheduler
node_user -.->|"manages plugins"| node_plugins
node_user -.->|"connects workers"| node_cluster

click node_webui "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/webui/app.js"
click node_server "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/server.py"
click node_agentloop "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/agent.py"
click node_toolruntime "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/tools.py"
click node_sessions "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/session.py"
click node_llmclient "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/llm.py"
click node_lmstudio "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/lms.py"
click node_configuration "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/config.py"
click node_fileeditor "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/files.py"
click node_knowledgebase "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/rag.py"
click node_search "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/search.py"
click node_voice "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/voice.py"
click node_cluster "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/cluster.py"
click node_dashboard "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/dashboard.py"
click node_thermal "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/thermal.py"
click node_trainer "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/unsloth_trainer.py"
click node_plugins "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/plugins.py"
click node_mcp "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/mcp_client.py"
click node_scheduler "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/scheduler.py"
click node_dns "https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/dnsfix.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_webui,node_server,node_user toneBlue
class node_agentloop,node_toolruntime,node_sessions toneAmber
class node_llmclient,node_provider,node_lmstudio,node_configuration,node_dns toneMint
class node_fileeditor,node_knowledgebase,node_search,node_voice toneRose
class node_cluster,node_dashboard,node_thermal,node_trainer,node_plugins,node_mcp,node_scheduler toneIndigo
```

## Components

### Interface and API

- [Web UI](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/webui/app.js): `webui/app.js`
- [HTTP and SSE Server](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/server.py): `harness/server.py`

### Agent Runtime

- [Agent Loop](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/agent.py): `harness/agent.py`
- [Tool Execution](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/tools.py): `harness/tools.py`
- [Session History](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/session.py): `harness/session.py`

### Local Models

- [LLM Client](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/llm.py): `harness/llm.py`
- **LM Studio and Ollama**
- [LM Studio Management](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/lms.py): `harness/lms.py`
- [Configuration](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/config.py): `harness/config.py`
- [DNS Workaround](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/dnsfix.py): `harness/dnsfix.py`

### Workspace Capabilities

- [File Editor](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/files.py): `harness/files.py`
- [RAG Knowledge Base](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/rag.py): `harness/rag.py`
- [Web Search](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/search.py): `harness/search.py`
- [Voice Call](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/voice.py): `harness/voice.py`

### Studio Extensions

- [Wi-Fi Cluster](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/cluster.py): `harness/cluster.py`
- [System Dashboard](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/dashboard.py): `harness/dashboard.py`
- [GPU Thermal Control](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/thermal.py): `harness/thermal.py`
- [LoRA Training Studio](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/unsloth_trainer.py): `harness/unsloth_trainer.py`
- [Plugin System](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/plugins.py): `harness/plugins.py`
- [MCP Servers](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/mcp_client.py): `harness/mcp_client.py`
- [Prompt and Shell Scheduler](https://github.com/lenovolquser15-ai/local-ai-ide/blob/main/harness/scheduler.py): `harness/scheduler.py`

### Other components

- **User**

## Connections

- User → Web UI: submits requests (evidence: `README.md`)
- Web UI → HTTP and SSE Server: uses API (evidence: `harness/server.py`)
- HTTP and SSE Server → LLM Client: handles model requests (evidence: `harness/server.py`)
- HTTP and SSE Server → Session History: serves session history (evidence: `harness/server.py`)
- Agent Loop → LLM Client: calls model (evidence: `harness/agent.py`)
- Agent Loop → Tool Execution: dispatches tools (evidence: `harness/agent.py`)
- Agent Loop → Session History: persists turns (evidence: `harness/agent.py`)
- LLM Client → LM Studio and Ollama: sends completions (evidence: `README.md`)
- LLM Client → LM Studio Management: checks readiness (evidence: `harness/llm.py`)
- LM Studio Management → Configuration: reads settings (evidence: `harness/lms.py`)
- HTTP and SSE Server → LM Studio Management: queries model status (evidence: `harness/server.py`)
- HTTP and SSE Server → GPU Thermal Control: reads thermal status (evidence: `harness/server.py`)
- HTTP and SSE Server → RAG Knowledge Base: reports RAG status (evidence: `harness/server.py`)
- HTTP and SSE Server → File Editor: routes file requests (evidence: `harness/server.py`)
- Tool Execution → Web Search: runs web search (evidence: `harness/tools.py`)
- Tool Execution → RAG Knowledge Base: uses RAG tools (evidence: `harness/tools.py`)
- Tool Execution → Wi-Fi Cluster: uses cluster tools (evidence: `harness/tools.py`)
- Tool Execution → LoRA Training Studio: uses training tools (evidence: `harness/tools.py`)
- Tool Execution → MCP Servers: invokes MCP tools (evidence: `harness/tools.py`)
- Plugin System → Configuration: loads settings (evidence: `harness/plugins.py`)
- System Dashboard → GPU Thermal Control: reads GPU status (evidence: `harness/dashboard.py`)
- GPU Thermal Control → LM Studio Management: unloads models (evidence: `harness/thermal.py`)
- HTTP and SSE Server → DNS Workaround: applies DNS workaround (evidence: `harness/server.py`)
- User → Voice Call: starts voice calls (evidence: `README.md`)
- User → LoRA Training Studio: starts fine-tuning (evidence: `README.md`)
- User → Prompt and Shell Scheduler: configures schedules (evidence: `README.md`)
- User → Plugin System: manages plugins (evidence: `README.md`)
- User → Wi-Fi Cluster: connects workers (evidence: `README.md`)
