# uzankhan/numnumdock architecture

> Architecture diagram of the GitHub repository uzankhan/numnumdock, 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/uzankhan/numnumdock
- Repository: https://github.com/uzankhan/numnumdock

## Overview

NumNumDock is a local-first LLM deployment tool. The main workflow runs through the CLI: inspect hardware, choose a model, validate Docker, deploy Ollama in an isolated container network, then host an API-key-protected local proxy. The graph also preserves the CLI’s status and doctor commands and the separate native Ollama runtime. Source excerpts show the core calls; README statements support the deployment and proxy flow. The Caddyfile is described as a placeholder, so it is omitted.

Main entry points: [`cli.py`](https://github.com/uzankhan/numnumdock/blob/main/cli.py) (CLI commands), [`core/docker_manager.py`](https://github.com/uzankhan/numnumdock/blob/main/core/docker_manager.py) (Container deployment), [`core/proxy.py`](https://github.com/uzankhan/numnumdock/blob/main/core/proxy.py) (Proxy application), [`core/native_manager.py`](https://github.com/uzankhan/numnumdock/blob/main/core/native_manager.py) (Native Ollama management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and diagnostics"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_docker_check["Docker validation<br/>[cli.py]"]
  node_status["Status command<br/>[cli.py]"]
  node_doctor["Doctor command<br/>[cli.py]"]
end

subgraph group_deploy["Model deployment"]
  node_hardware["Hardware detection<br/>[hardware.py]"]
  node_recommend["Model recommendation<br/>[hardware.py]"]
  node_docker_deploy["Container deployment<br/>[docker_manager.py]"]
  node_ollama["Ollama container<br/>[docker_manager.py]"]
  node_ollama_api["Ollama API"]
end

subgraph group_access["Protected API"]
  node_api_key["API key generation<br/>[security.py]"]
  node_proxy_app["Proxy application<br/>[proxy.py]"]
end

subgraph group_native["Native runtime"]
  node_native_runtime["Native Ollama management<br/>[native_manager.py]"]
end

node_user(("Developer"))
node_docker["Docker daemon"]
node_proxy_client(("Local API client"))

node_user -->|"invokes"| node_cli
node_cli -->|"inspects"| node_hardware
node_cli -->|"selects model"| node_recommend
node_cli -->|"validates"| node_docker_check
node_cli -->|"deploys"| node_docker_deploy
node_docker_deploy -->|"creates resources"| node_docker
node_docker_deploy -->|"runs container"| node_ollama
node_docker_deploy -->|"pulls model"| node_ollama
node_cli -->|"generates key"| node_api_key
node_cli -->|"builds and hosts"| node_proxy_app
node_proxy_client -->|"sends requests"| node_proxy_app
node_proxy_app -->|"forwards approved requests"| node_ollama_api
node_cli -->|"runs"| node_status
node_cli -->|"runs"| node_doctor
node_user -.->|"may deploy natively"| node_native_runtime
node_native_runtime -->|"generates key"| node_api_key

click node_cli "https://github.com/uzankhan/numnumdock/blob/main/cli.py"
click node_docker_check "https://github.com/uzankhan/numnumdock/blob/main/cli.py"
click node_status "https://github.com/uzankhan/numnumdock/blob/main/cli.py"
click node_doctor "https://github.com/uzankhan/numnumdock/blob/main/cli.py"
click node_hardware "https://github.com/uzankhan/numnumdock/blob/main/core/hardware.py"
click node_recommend "https://github.com/uzankhan/numnumdock/blob/main/core/hardware.py"
click node_docker_deploy "https://github.com/uzankhan/numnumdock/blob/main/core/docker_manager.py"
click node_ollama "https://github.com/uzankhan/numnumdock/blob/main/core/docker_manager.py"
click node_api_key "https://github.com/uzankhan/numnumdock/blob/main/core/security.py"
click node_proxy_app "https://github.com/uzankhan/numnumdock/blob/main/core/proxy.py"
click node_native_runtime "https://github.com/uzankhan/numnumdock/blob/main/core/native_manager.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_cli,node_docker_check,node_status,node_doctor,node_proxy_client toneBlue
class node_hardware,node_recommend,node_docker_deploy,node_ollama,node_ollama_api toneAmber
class node_api_key,node_proxy_app toneMint
class node_native_runtime toneRose
class node_user,node_docker toneIndigo
```

## Components

### CLI and diagnostics

- [CLI commands](https://github.com/uzankhan/numnumdock/blob/main/cli.py): `cli.py`
- [Docker validation](https://github.com/uzankhan/numnumdock/blob/main/cli.py): `cli.py`
- [Status command](https://github.com/uzankhan/numnumdock/blob/main/cli.py): `cli.py`
- [Doctor command](https://github.com/uzankhan/numnumdock/blob/main/cli.py): `cli.py`

### Model deployment

- [Hardware detection](https://github.com/uzankhan/numnumdock/blob/main/core/hardware.py): `core/hardware.py`
- [Model recommendation](https://github.com/uzankhan/numnumdock/blob/main/core/hardware.py): `core/hardware.py`
- [Container deployment](https://github.com/uzankhan/numnumdock/blob/main/core/docker_manager.py): `core/docker_manager.py`
- [Ollama container](https://github.com/uzankhan/numnumdock/blob/main/core/docker_manager.py): `core/docker_manager.py`
- **Ollama API**

### Protected API

- [API key generation](https://github.com/uzankhan/numnumdock/blob/main/core/security.py): `core/security.py`
- [Proxy application](https://github.com/uzankhan/numnumdock/blob/main/core/proxy.py): `core/proxy.py`

### Native runtime

- [Native Ollama management](https://github.com/uzankhan/numnumdock/blob/main/core/native_manager.py): `core/native_manager.py`

### Other components

- **Developer**
- **Docker daemon**
- **Local API client**

## Connections

- Developer → CLI commands: invokes (evidence: `README.md`)
- CLI commands → Hardware detection: inspects (evidence: `cli.py`)
- CLI commands → Model recommendation: selects model (evidence: `cli.py`)
- CLI commands → Docker validation: validates (evidence: `cli.py`)
- CLI commands → Container deployment: deploys (evidence: `cli.py`)
- Container deployment → Docker daemon: creates resources (evidence: `core/docker_manager.py`)
- Container deployment → Ollama container: runs container (evidence: `core/docker_manager.py`)
- Container deployment → Ollama container: pulls model (evidence: `core/docker_manager.py`)
- CLI commands → API key generation: generates key (evidence: `cli.py`)
- CLI commands → Proxy application: builds and hosts (evidence: `cli.py`)
- Local API client → Proxy application: sends requests (evidence: `README.md`)
- Proxy application → Ollama API: forwards approved requests (evidence: `core/proxy.py`)
- CLI commands → Status command: runs (evidence: `cli.py`)
- CLI commands → Doctor command: runs (evidence: `cli.py`)
- Developer → Native Ollama management: may deploy natively
- Native Ollama management → API key generation: generates key (evidence: `core/native_manager.py`)
