# mmusil25/raynos-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mmusil25/raynos-ai
- Repository: https://github.com/mmusil25/raynos-ai

## Overview

##### Project type and purpose
- This is a standalone, on-device AI pipeline with a local web UI.
- It ingests audio (mic or file), runs real-time transcription (Whisper), then structured intent/entity extraction (Gemma 3-N optimized via Unsloth), and displays JSON output—all locally.

##### File structure
- Top-level “src/” holds the two main Python modules:
- gradio_app_integrated.py → defines the Gradio web interface and orchestrates the pipeline
- gemma_3n_json_extractor.py → encapsulates the ExtractionManager for Gemma 3-N
- “unsloth_compiled_cache/” (both under src/ and root) contains the drop-in optimized model implementations generated by Unsloth
- “example_audio/” offers sample inputs; “docs/architecture.png” shows a reference sketch

##### README for insights
- Confirms the three-stage pipeline:
Audio Source → Whisper transcription → Gemma 3-N JSON extraction
- Highlights dependencies and environment (Python 3.10+, torch, whisper, unsloth, gradio)

- Clear, concise labels for each component
- UI vs. compute vs. storage
- static assets vs. dynamically generated artifacts
- Annotations for key dependencies (Whisper, Gemma, Unsloth, Gradio)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "On-Device Environment (Python 3.10+ / CPU/GPU)" 
        direction TB
        AudioSource["Audio Source\n(Mic / File Upload)"]:::ui
        subgraph "Web UI"
            direction TB
            GradioApp["Gradio App\n(gradio_app_integrated.py)"]:::ui
            CSS["CSS\n(css/style.css)"]:::ui
            HTML["HTML\n(index.html)"]:::ui
        end
        Transcription["Transcription Engine\n(Whisper)"]:::compute
        Extraction["Extraction Engine\n(Gemma 3-N + ExtractionManager)"]:::extract
        ModelCache["Model Cache\n(unsloth_compiled_cache/)"]:::storage
        JSONOutput["JSON Output\n(Data)"]:::output
    end

    subgraph "Auxiliary Resources"
        SampleAudioInputs["Sample Audio Inputs\n(example_audio/)"]:::storage
        Docs["Architecture Diagram\n(docs/architecture.png)"]:::storage
        README["README & Dependencies\n(README.md)"]:::storage
        Notice["Unsloth Notice\n(third_party/UNSLOTH_NOTICE)"]:::storage
    end

    User((User)):::external
    User --> GradioApp
    GradioApp --> AudioSource
    AudioSource --> Transcription
    Transcription --> Extraction
    Extraction --> JSONOutput
    JSONOutput --> GradioApp
    Extraction --> ModelCache

    click GradioApp "https://github.com/mmusil25/raynos-ai/blob/main/src/gradio_app_integrated.py"
    click CSS "https://github.com/mmusil25/raynos-ai/blob/main/css/style.css"
    click HTML "https://github.com/mmusil25/raynos-ai/blob/main/index.html"
    click Extraction "https://github.com/mmusil25/raynos-ai/blob/main/src/gemma_3n_json_extractor.py"
    click ModelCache "https://github.com/mmusil25/raynos-ai/tree/main/src/unsloth_compiled_cache/"
    click SampleAudioInputs "https://github.com/mmusil25/raynos-ai/tree/main/example_audio/"
    click Docs "https://github.com/mmusil25/raynos-ai/blob/main/docs/architecture.png"
    click README "https://github.com/mmusil25/raynos-ai/blob/main/README.md"
    click Notice "https://github.com/mmusil25/raynos-ai/tree/main/third_party/UNSLOTH_NOTICE"

    classDef ui fill:#CCE5FF,stroke:#000;
    classDef compute fill:#D4EDDA,stroke:#000;
    classDef extract fill:#FFF3CD,stroke:#000;
    classDef storage fill:#E2E3E5,stroke:#000;
    classDef output fill:#FFF3CD,stroke:#000;
    classDef external fill:#f8f9fa,stroke:#6c757d;
```
