# neha-shrestha/prompt-generation-finetuning-llm architecture

> Architecture diagram of the GitHub repository neha-shrestha/prompt-generation-finetuning-llm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neha-shrestha/prompt-generation-finetuning-llm
- Repository: https://github.com/neha-shrestha/prompt-generation-finetuning-llm

## Overview

##### Project type and purpose
- Prompt Genie is an ML/LLM fine-tuning project (not a traditional full-stack app).
- Its goal is to ingest user-provided “simple” prompts, fine-tune a large language model, and generate detailed image-generation prompts.

##### File structure
Top-level:
- README.md – project description and goals.
- data/ – raw and cleaned datasets (Excel/CSV) for fine-tuning.
- finetuning.ipynb – Jupyter notebook driving the model-fine-tune workflow.
- prompt_generator.ipynb & prompt_generator.py – inference pipelines (interactive notebook and standalone script).

data/unproccessed/ – initial raw datasets requiring cleaning.
data/500_*.xlsx – processed datasets ready for model training.

##### README for additional insights
- Emphasis on bridging user inputs and technical model demands.
- Fine-tuning LLMs on prompt pairs (basic→advanced).

##### Detailed capturing of architectural elements
- Versioned data folders (unprocessed vs processed).
- Where models are stored and how they are loaded.
- Both notebooks and scripts as entry points.
- External services (e.g., model registry or image-generation API) if they exist or are planned.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        RawData["Raw Data<br/>(data/unproccessed)"]:::data
        subgraph "Processed Datasets"
            direction TB
            P1["500_prompts_pair-0.5.xlsx"]:::data
            P2["500_prompts_pair-1.xlsx"]:::data
            P3["500_prompts_pair-2.xlsx"]:::data
            P4["500_technical_prompts_dataset.xlsx"]:::data
        end
    end

    %% Preprocessing
    Preprocess["Preprocessing<br/>(finetuning.ipynb)"]:::compute

    %% Training Pipeline
    Train["Fine-tuning<br/>(finetuning.ipynb)"]:::compute

    %% Model Artifact
    ModelArtifact["Fine-tuned Model<br/>(checkpoint)"]:::data

    %% Inference Engine
    subgraph "Inference Engine"
        direction TB
        NotebookInference["Interactive Inference<br/>(prompt_generator.ipynb)"]:::inference
        ScriptInference["Standalone Inference<br/>(prompt_generator.py)"]:::inference
    end

    %% Documentation
    README["Project Description & Goals<br/>(README.md)"]:::doc

    %% Connections
    RawData -->|"clean_data()"| Preprocess
    Preprocess -->|"processed_data"| P1
    Preprocess -->|"processed_data"| P2
    Preprocess -->|"processed_data"| P3
    Preprocess -->|"processed_data"| P4

    P1 -->|"train()"| Train
    P2 -->|"train()"| Train
    P3 -->|"train()"| Train
    P4 -->|"train()"| Train

    Train -->|"model_ckpt"| ModelArtifact

    ModelArtifact -->|"load_model()"| NotebookInference
    ModelArtifact -->|"load_model()"| ScriptInference

    %% Click Events
    click RawData "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/tree/main/data/unproccessed"
    click P1 "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/data/500_prompts_pair-0.5.xlsx"
    click P2 "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/data/500_prompts_pair-1.xlsx"
    click P3 "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/data/500_prompts_pair-2.xlsx"
    click P4 "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/data/500_technical_prompts_dataset.xlsx"
    click Preprocess "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/finetuning.ipynb"
    click Train "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/finetuning.ipynb"
    click NotebookInference "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/prompt_generator.ipynb"
    click ScriptInference "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/prompt_generator.py"
    click README "https://github.com/neha-shrestha/prompt-generation-finetuning-llm/blob/main/README.md"

    %% Styles
    classDef data fill:#D6EAF8,stroke:#85C1E9;
    classDef compute fill:#D5F5E3,stroke:#52BE80;
    classDef inference fill:#FCF3CF,stroke:#F7DC6F;
    classDef doc fill:#F2F3F4,stroke:#A6ACAF;
```
