# chinmay13579/generative_ai architecture

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

- Interactive diagram: https://gitdiagram.com/chinmay13579/generative_ai
- Repository: https://github.com/chinmay13579/generative_ai

## Overview

##### Project type and purpose
- This is a lightweight full-stack “content generation” application.
- It provides a web UI (Flask) for end-users to submit blog prompts, then invokes a cloud-hosted generative AI model (Falcon-40B on AWS SageMaker) to produce content.

##### File structure
- Top-level files:
– app.py: Flask application that serves the web UI, handles form submissions, and calls SageMaker.
– requirements.txt: Python dependencies (Flask, boto3, etc.).
– test.py: likely basic unit or integration tests for the Flask endpoints or model invocation logic.
- No separate “frontend” folder—frontend is embedded in Flask (HTML templates in app.py or related directory).

##### README for additional insights
- Confirms flow: User → web UI → Flask → AWS SageMaker → Falcon-40B → response → UI.
- Mentions AWS account, SageMaker permissions, and notebooks to demonstrate or set up the model endpoint.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend/UI Tier
    subgraph "Frontend/UI Tier"
        Browser["User Browser"]:::frontend
    end

    %% Backend/AI Tier
    subgraph "Backend/AI Tier"
        Flask["Flask App<br>(app.py)"]:::backend
        Req["requirements.txt<br>(Dependencies)"]:::docs
        AWSsdk["AWS SDK / boto3"]:::backend
        SageMaker["AWS SageMaker<br>Falcon-40B Endpoint"]:::aws
        S3["S3: Model Artifacts"]:::storage
    end

    %% DevOps / Deployment
    subgraph "DevOps / Deployment"
        Notebook1["Untitled (2).ipynb"]:::devops
        Notebook2["falcon40B-instruct-notebook-full.ipynb"]:::devops
    end

    %% Testing & Documentation
    subgraph "Testing & Docs"
        Test["test.py<br>Unit/Integration Tests"]:::testing
        README["README.md<br>Overview & Architecture"]:::docs
    end

    %% Connections
    Browser -->|"HTTP POST/GET"| Flask
    Flask --> AWSsdk
    AWSsdk -->|"InvokeEndpoint API"| SageMaker
    SageMaker -->|"Generated Text"| Flask
    Flask -->|"HTML/JSON Response"| Browser
    Notebook1 -->|"Provision & Test Model"| S3
    Notebook2 -->|"Provision & Test Model"| S3
    Test -->|"Validates Endpoints & Model Calls"| Flask

    %% Click Events
    click Flask "https://github.com/chinmay13579/generative_ai/blob/main/app.py"
    click Req "https://github.com/chinmay13579/generative_ai/blob/main/requirements.txt"
    click Notebook1 "https://github.com/chinmay13579/generative_ai/blob/main/Untitled (2).ipynb"
    click Notebook2 "https://github.com/chinmay13579/generative_ai/blob/main/falcon40B-instruct-notebook-full.ipynb"
    click Test "https://github.com/chinmay13579/generative_ai/blob/main/test.py"
    click README "https://github.com/chinmay13579/generative_ai/blob/main/README.md"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef aws fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef storage fill:#FFFACD,stroke:#000,stroke-width:1px;
    classDef devops fill:#D8BFD8,stroke:#000,stroke-width:1px;
    classDef testing fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef docs fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
