# intel/edge-developer-kit-reference-scripts architecture

> Architecture diagram of the GitHub repository intel/edge-developer-kit-reference-scripts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intel/edge-developer-kit-reference-scripts
- Repository: https://github.com/intel/edge-developer-kit-reference-scripts

## Overview

##### Project type and purpose
- This is a monorepo of _reference setup scripts_ and _sample use cases_ for various Intel platforms, GPUs, and workloads (AI, real‐time).
- It is not a single full‐stack app but a _toolkit_ that helps developers provision hardware/software (platform & GPU scripts) and deploy example workloads (use-cases).

##### Main components
a. Setup Modules (Shell scripts, README)
- Platform scripts (under /platforms) for Intel Atom, Core, Xeon, etc.
- GPU scripts (under /gpu) for Intel Arc and Flex series GPUs.
b. Use-Case Workloads (under /usecases)
- AI Use Cases
– OpenVINO examples, video-analytics app, Digital Avatar (full-stack), microservices (speech-to-text, TTS, text-to-image, vision-language, RAG toolkit)
– Digital Avatar splits into multiple Dockerized backends + Next.js frontend + Payload CMS
– Smart Parking and Vision Edge AI include cameras → inference → InfluxDB/Grafana dashboards
– LLM finetuning benchmarks, microservices
- Real-Time Use Cases
– TCC Tutorial: MQTT (Mosquitto) → Telegraf → InfluxDB → Grafana

##### Relationships and data flows
- **Host/VM** runs _setup scripts_ (platform + GPU) to install drivers, toolkits, OpenVINO.
- Once the host is provisioned, you select a use case. Most use cases ship a _docker-compose.yml_ to spin up:
- Container network (bridge)
- Inference microservices (each in its own container)
- Data stores (Chroma DB, Payload DB, InfluxDB)
- Messaging / broker (for real-time via MQTT)
- Web UI or API gateways (Next.js, FastAPI, Flask)
- Within Digital Avatar:
- Frontend (Next.js + Payload CMS) ←→ Backend API gateway ←→ {RealESRGan, LivePortrait, RAG-backend, SadTalker, Wav2Lip}
- Persistent volumes for model weights, assets
- Monitoring use cases (Smart Parking, Vision Edge AI, TCC tutorial) include
- Data collection modules → InfluxDB/Prometheus → Grafana dashboards

##### Architectural patterns and design principles
- **Modular scripts** per hardware/platform, each with its own setup.sh
- **Containerized microservices**—easy to swap or scale individual components
- **Docker Compose orchestration**—defines inter-service networking and dependencies
- **Separation of concerns**—platform provisioning, GPU provisioning, application deployment

##### Technologies, frameworks, and libraries
- Shell scripts (Bash) for environment provisioning
- Docker & Docker Compose
- Python (FastAPI, Flask, custom main.py in each service)
- Next.js & Payload CMS for full-stack UI (Digital Avatar, RAG toolkit)
- OpenVINO, Intel drivers—installed by platform/GPU scripts
- Databases: Chroma DB, Payload DB, InfluxDB, Prometheus
- Messaging: MQTT (Mosquitto)

##### Diagramming recommendations
- Blue for Setup components (scripts, driver install).
- Green for Container orchestration (Docker Compose).
- Purple for Data stores and Monitoring tools.
- Provisioning flow: scripts → host
- Network flow: frontend → API → inference containers → DB → frontend
- Monitoring flow: sensors → agent → DB → Grafana

##### Detail
- High-level module separately but allow “zoomed-in” callouts for complex use cases (e.g., Digital Avatar).
- Do not omit:
- Platform/GPU script directories and their mapping to hardware targets
- Use case orchestration (docker-compose, volumes, env files)
- Inter-container and container-to-host dependencies
- Monitoring and data-flow paths

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Setup Modules"
        PS["Platform Scripts"]:::blue
        GS["GPU Scripts"]:::blue
    end

    PS -->|runs setup.sh| Host["Provisioned Host"]:::blue
    GS -->|runs setup.sh| Host

    subgraph "Use Case Deployment" 
        direction TB
        UC["Select Use Case"]:::green

        DV["Digital Avatar"]:::green
        AI_VA["AI Video Analytics"]:::green
        FT["LLM Fine-tuning Benchmark"]:::green
        MSM["AI Microservices Collection"]:::green
        OV["OpenVINO Sample Use Case"]:::green
        OW["OpenWebUI Ollama Use Case"]:::green
        RAG["RAG Toolkit Use Case"]:::green
        SP["Smart Parking Monitoring"]:::green
        VE["Vision Edge AI Monitoring"]:::green
        TCC["Real-Time TCC Tutorial"]:::green

        UC --> DV
        UC --> AI_VA
        UC --> FT
        UC --> MSM
        UC --> OV
        UC --> OW
        UC --> RAG
        UC --> SP
        UC --> VE
        UC --> TCC
    end

    Host -->|deploy via docker-compose| UC

    %% Digital Avatar Sub-diagram
    subgraph "Digital Avatar" 
        direction TB
        Compose_DA["Docker Compose Orchestrator"]:::cloud
        Net_DA["Docker Network"]:::cloud
        Vol_DA["Model Weights Volume"]:::purple

        subgraph "Frontend Layer"
            FA["Next.js + Payload CMS"]:::orange
        end

        subgraph "Backend Inference Services"
            BA1["RealESRGan Service"]:::orange
            BA2["LivePortrait Service"]:::orange
            BA3["RAG-backend Service"]:::orange
            BA4["SadTalker Service"]:::orange
            BA5["Wav2Lip Service"]:::orange
        end

        Compose_DA --> Net_DA
        Compose_DA --> Vol_DA
        Net_DA --> FA
        Net_DA --> BA1
        Net_DA --> BA2
        Net_DA --> BA3
        Net_DA --> BA4
        Net_DA --> BA5
        FA -->|HTTP| BA1
        FA -->|HTTP| BA2
        FA -->|HTTP| BA3
        FA -->|HTTP| BA4
        FA -->|HTTP| BA5
    end

    %% Monitoring Sub-diagram for Smart Parking & Vision Edge AI
    subgraph "Monitoring Use Cases"
        direction TB
        Camera["Camera Stream / Sensors"]:::orange
        Agent["Telegraf / Data Collector"]:::orange
        TSDB["InfluxDB / Prometheus"]:::purple
        Grafana["Grafana Dashboard"]:::purple

        Camera -->|video stream| Agent
        Agent -->|metrics| TSDB
        TSDB -->|queries| Grafana
    end

    %% Real-Time TCC Tutorial flow
    subgraph "TCC Tutorial Flow"
        direction TB
        MQTT["MQTT Broker (Mosquitto)"]:::orange
        TelegrafRT["Telegraf Agent"]:::orange
        TSDBRT["InfluxDB"]:::purple
        GrafanaRT["Grafana Dashboard"]:::purple

        MQTT -->|MQTT| TelegrafRT
        TelegrafRT -->|metrics| TSDBRT
        TSDBRT -->|queries| GrafanaRT
    end

    %% Click Events
    click PS "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/platforms/"
    click GS "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/gpu/"
    click AI_VA "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/ai-video-analytics/"
    click DV "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/digital-avatar/"
    click FA "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/digital-avatar/frontend/"
    click BA1 "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/digital-avatar/backend/"
    click Compose_DA "https://github.com/intel/edge-developer-kit-reference-scripts/blob/main/usecases/ai/digital-avatar/docker-compose.yml"
    click FT "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/finetuning-benchmark/"
    click MSM "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/microservices/"
    click OV "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/openvino/"
    click OW "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/openwebui-ollama/"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/rag-toolkit/"
    click SP "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/smart-parking/"
    click VE "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/vision-edge-ai/"
    click TCC "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/real-time/tcc_tutorial/"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/rag-toolkit/"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/rag-toolkit/"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/blob/main/usecases/ai/rag-toolkit/docker-compose.yml"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/rag-toolkit/backend/"
    click RAG "https://github.com/intel/edge-developer-kit-reference-scripts/tree/main/usecases/ai/rag-toolkit/edge-ui/"

    classDef blue fill:#cce5ff,stroke:#4da3ff;
    classDef green fill:#d4edda,stroke:#28a745;
    classDef orange fill:#fff3cd,stroke:#ffcd39;
    classDef purple fill:#e2e3e5,stroke:#6c757d;
    classDef cloud fill:#e2f0fb,stroke:#0466c8,stroke-dasharray:5 5;
```
