# nimo94/smiloai architecture

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

## Overview

SmiloAI is an offline-first dental diagnostic workstation. A practitioner uses the UI to submit RGB or X-ray scans, choose a single/batch, sequential, or custom-flow run, and review annotated findings and clinical reports. The README documents specialist models, routing, confidence/NMS filtering, and Auto Pilot training; the sampled `main.py` also shows UI serving, model unload/reload endpoints, and training events. The main implementation is concentrated in one large file, so several domain components share its path; other runtime internals were not sampled.

Main entry points: [`Sourcecodes/main.py`](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py) (API & Engine), [`Sourcecodes/index.html`](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/index.html) (Workstation UI), [`Sourcecodes/AUTOPILOT/AUTOPILOT_MODELS`](https://github.com/nimo94/smiloai/tree/main/Sourcecodes/AUTOPILOT/AUTOPILOT_MODELS) (Routing Models), [`Sourcecodes/model`](https://github.com/nimo94/smiloai/tree/main/Sourcecodes/model) (Local Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Workstation UI"]
  node_ui["Workstation UI<br/>[index.html]"]
end

subgraph group_diagnostics["Diagnostic Runtime"]
  node_engine["API &amp; Engine<br/>[main.py]"]
  node_model_catalog["Model Discovery<br/>[main.py]"]
  node_model_store[("Local Models")]
  node_scan_modes["Scan Modes<br/>[main.py]"]
  node_flow_builder["Flow Builder<br/>[main.py]"]
  node_specialists["Specialist Inference<br/>[main.py]"]
  node_routing["Smart Routing<br/>[main.py]"]
  node_filtering["Confidence &amp; NMS<br/>[main.py]"]
end

subgraph group_autopilot["Auto Pilot Studio"]
  node_autopilot_models[("Routing Models")]
  node_training["Auto Pilot Training<br/>[main.py]"]
  node_training_data[("Training Data")]
  node_training_events["Training Feedback<br/>[main.py]"]
end

subgraph group_clinical["Clinical Output"]
  node_annotations["Visual Annotations<br/>[main.py]"]
  node_reports["Clinical Reports<br/>[main.py]"]
end

node_practitioner(("Practitioner"))
node_llm["Streaming LLM"]

node_practitioner -->|"uses"| node_ui
node_ui -->|"submits scans"| node_engine
node_engine -->|"serves"| node_ui
node_engine -->|"discovers models"| node_model_catalog
node_model_catalog -->|"loads models"| node_model_store
node_engine -->|"offers"| node_scan_modes
node_engine -->|"executes flows"| node_flow_builder
node_scan_modes -->|"runs inference"| node_specialists
node_flow_builder -->|"runs specialists"| node_specialists
node_scan_modes -->|"routes scans"| node_routing
node_routing -->|"uses router"| node_autopilot_models
node_specialists -->|"filters predictions"| node_filtering
node_routing -.->|"filters predictions"| node_filtering
node_filtering -->|"annotates findings"| node_annotations
node_annotations -->|"feeds reports"| node_reports
node_ui -->|"starts training"| node_training
node_training -->|"trains on"| node_training_data
node_training -->|"publishes metrics"| node_training_events
node_training -->|"exports model"| node_autopilot_models
node_ui -.->|"requests assistance"| node_llm

click node_ui "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/index.html"
click node_engine "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_model_catalog "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_model_store "https://github.com/nimo94/smiloai/tree/main/Sourcecodes/model"
click node_autopilot_models "https://github.com/nimo94/smiloai/tree/main/Sourcecodes/AUTOPILOT/AUTOPILOT_MODELS"
click node_scan_modes "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_flow_builder "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_specialists "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_routing "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_filtering "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_training "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_training_data "https://github.com/nimo94/smiloai/tree/main/Sourcecodes/AUTOPILOT/Training_Data"
click node_training_events "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_annotations "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py"
click node_reports "https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.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_ui toneBlue
class node_engine,node_model_catalog,node_model_store,node_scan_modes,node_flow_builder,node_specialists,node_routing,node_filtering toneAmber
class node_autopilot_models,node_training,node_training_data,node_training_events toneMint
class node_annotations,node_reports toneRose
class node_practitioner,node_llm toneIndigo
```

## Components

### Workstation UI

- [Workstation UI](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/index.html): `Sourcecodes/index.html`

### Diagnostic Runtime

- [API & Engine](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Model Discovery](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Local Models](https://github.com/nimo94/smiloai/tree/main/Sourcecodes/model): `Sourcecodes/model`
- [Scan Modes](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Flow Builder](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Specialist Inference](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Smart Routing](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Confidence & NMS](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`

### Auto Pilot Studio

- [Routing Models](https://github.com/nimo94/smiloai/tree/main/Sourcecodes/AUTOPILOT/AUTOPILOT_MODELS): `Sourcecodes/AUTOPILOT/AUTOPILOT_MODELS`
- [Auto Pilot Training](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Training Data](https://github.com/nimo94/smiloai/tree/main/Sourcecodes/AUTOPILOT/Training_Data): `Sourcecodes/AUTOPILOT/Training_Data`
- [Training Feedback](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`

### Clinical Output

- [Visual Annotations](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`
- [Clinical Reports](https://github.com/nimo94/smiloai/blob/main/Sourcecodes/main.py): `Sourcecodes/main.py`

### Other components

- **Practitioner**
- **Streaming LLM**

## Connections

- Practitioner → Workstation UI: uses (evidence: `README.md`)
- Workstation UI → API & Engine: submits scans (evidence: `README.md`)
- API & Engine → Workstation UI: serves (evidence: `Sourcecodes/main.py`)
- API & Engine → Model Discovery: discovers models (evidence: `README.md`)
- Model Discovery → Local Models: loads models (evidence: `README.md`)
- API & Engine → Scan Modes: offers (evidence: `README.md`)
- API & Engine → Flow Builder: executes flows (evidence: `README.md`)
- Scan Modes → Specialist Inference: runs inference (evidence: `README.md`)
- Flow Builder → Specialist Inference: runs specialists (evidence: `README.md`)
- Scan Modes → Smart Routing: routes scans (evidence: `README.md`)
- Smart Routing → Routing Models: uses router (evidence: `README.md`)
- Specialist Inference → Confidence & NMS: filters predictions (evidence: `README.md`)
- Smart Routing → Confidence & NMS: filters predictions (evidence: `Sourcecodes/main.py`)
- Confidence & NMS → Visual Annotations: annotates findings (evidence: `README.md`)
- Visual Annotations → Clinical Reports: feeds reports (evidence: `README.md`)
- Workstation UI → Auto Pilot Training: starts training (evidence: `README.md`)
- Auto Pilot Training → Training Data: trains on (evidence: `README.md`)
- Auto Pilot Training → Training Feedback: publishes metrics (evidence: `Sourcecodes/main.py`)
- Auto Pilot Training → Routing Models: exports model (evidence: `README.md`)
- Workstation UI → Streaming LLM: requests assistance (evidence: `README.md`)
