# g-h-0-s-t/ai-pendrive architecture

> Architecture diagram of the GitHub repository g-h-0-s-t/ai-pendrive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/g-h-0-s-t/ai-pendrive
- Repository: https://github.com/g-h-0-s-t/ai-pendrive

## Overview

AI Pendrive is a portable Windows launcher for a local llamafile model server, with tier-specific model profiles and a separate live status dashboard. The main workflow is selecting a launcher, loading its configured model in llamafile, and using the local browser UI; monitoring is a parallel workflow. The README documents metrics, agent tools, and server configuration, but no source excerpts were available, so internal wiring is limited to documented behavior.

Main entry points: [`server`](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server) (Llamafile Server), [`start_4gb_gpu.bat`](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_4gb_gpu.bat) (4 GB Launcher), [`start_6gb_gpu.bat`](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_6gb_gpu.bat) (6 GB Launcher), [`start_8gb_gpu.bat`](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_8gb_gpu.bat) (8 GB Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch Profiles"]
  node_launch4["4 GB Launcher<br/>[start_4gb_gpu.bat]"]
  node_launch6["6 GB Launcher<br/>[start_6gb_gpu.bat]"]
  node_launch8["8 GB Launcher<br/>[start_8gb_gpu.bat]"]
  node_model4[("4 GB Model")]
  node_model6[("6 GB Model")]
  node_model8[("8 GB Model")]
end

subgraph group_serve["Local Inference"]
  node_llamafile["Llamafile Server"]
  node_webui["Browser UI"]
  node_agenttools["Agent Tools"]
end

subgraph group_monitor["Monitoring"]
  node_status["Status Dashboard<br/>[status.bat]"]
end

node_user(("User"))
node_browser(("Browser"))
node_os["Windows Metrics"]
node_gpu["NVIDIA GPU Data"]

node_user -->|"selects"| node_launch4
node_user -->|"selects"| node_launch6
node_user -->|"selects"| node_launch8
node_launch4 -->|"selects path"| node_model4
node_launch6 -->|"selects path"| node_model6
node_launch8 -->|"selects path"| node_model8
node_launch4 -->|"starts"| node_llamafile
node_launch6 -->|"starts"| node_llamafile
node_launch8 -->|"starts"| node_llamafile
node_llamafile -->|"loads selected"| node_model4
node_llamafile -->|"loads selected"| node_model6
node_llamafile -->|"loads selected"| node_model8
node_launch4 -->|"opens when ready"| node_browser
node_launch6 -->|"opens when ready"| node_browser
node_launch8 -->|"opens when ready"| node_browser
node_browser -->|"uses localhost UI"| node_webui
node_webui -->|"requests inference"| node_llamafile
node_llamafile -->|"enables tools"| node_agenttools
node_agenttools -.->|"runs shell and file tools"| node_os
node_user -->|"starts dashboard"| node_status
node_status -->|"polls metrics"| node_llamafile
node_status -->|"reads metrics"| node_os
node_status -->|"reads GPU data"| node_gpu

click node_launch4 "https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_4gb_gpu.bat"
click node_launch6 "https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_6gb_gpu.bat"
click node_launch8 "https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_8gb_gpu.bat"
click node_model4 "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/4GB"
click node_model6 "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/6GB"
click node_model8 "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/8GB"
click node_llamafile "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server"
click node_webui "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server"
click node_agenttools "https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server"
click node_status "https://github.com/g-h-0-s-t/ai-pendrive/blob/master/status.bat"

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_launch4,node_launch6,node_launch8,node_model4,node_model6,node_model8,node_user,node_browser toneBlue
class node_llamafile,node_webui,node_agenttools toneAmber
class node_status toneMint
class node_os,node_gpu toneIndigo
```

## Components

### Launch Profiles

- [4 GB Launcher](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_4gb_gpu.bat): `start_4gb_gpu.bat`
- [6 GB Launcher](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_6gb_gpu.bat): `start_6gb_gpu.bat`
- [8 GB Launcher](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/start_8gb_gpu.bat): `start_8gb_gpu.bat`
- [4 GB Model](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/4GB): `models/4GB`
- [6 GB Model](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/6GB): `models/6GB`
- [8 GB Model](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/models/8GB): `models/8GB`

### Local Inference

- [Llamafile Server](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server): `server`
- [Browser UI](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server): `server`
- [Agent Tools](https://github.com/g-h-0-s-t/ai-pendrive/tree/master/server): `server`

### Monitoring

- [Status Dashboard](https://github.com/g-h-0-s-t/ai-pendrive/blob/master/status.bat): `status.bat`

### Other components

- **User**
- **Browser**
- **Windows Metrics**
- **NVIDIA GPU Data**

## Connections

- User → 4 GB Launcher: selects
- User → 6 GB Launcher: selects
- User → 8 GB Launcher: selects
- 4 GB Launcher → 4 GB Model: selects path
- 6 GB Launcher → 6 GB Model: selects path
- 8 GB Launcher → 8 GB Model: selects path
- 4 GB Launcher → Llamafile Server: starts
- 6 GB Launcher → Llamafile Server: starts
- 8 GB Launcher → Llamafile Server: starts
- Llamafile Server → 4 GB Model: loads selected
- Llamafile Server → 6 GB Model: loads selected
- Llamafile Server → 8 GB Model: loads selected
- 4 GB Launcher → Browser: opens when ready
- 6 GB Launcher → Browser: opens when ready
- 8 GB Launcher → Browser: opens when ready
- Browser → Browser UI: uses localhost UI
- Browser UI → Llamafile Server: requests inference
- Llamafile Server → Agent Tools: enables tools
- Agent Tools → Windows Metrics: runs shell and file tools
- User → Status Dashboard: starts dashboard
- Status Dashboard → Llamafile Server: polls metrics
- Status Dashboard → Windows Metrics: reads metrics
- Status Dashboard → NVIDIA GPU Data: reads GPU data
