# ashishpatel26/ollama-playground architecture

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

## Overview

##### Project type and purpose
- This is an open-source monorepo of AI demonstration tools built with Ollama’s local LLMs.
- Each subdirectory under the root is a standalone Python demo (e.g., “chat-with-pdf”, “video-summarization”, “image-search”, etc.) that ingests a specific data type, runs preprocessing, invokes an Ollama model, and produces an output.

##### File structure
- Top-level: `.gitignore`, `README.md`, then one folder per demo.
- Each demo folder contains:
- A README describing purpose and usage
- A Python script (e.g., `ai_scraper.py`, `video_summary.py`)
- A `requirements.txt` for dependencies
- A data folder (e.g., `pdfs/`, `images/`, `videos/`, `audios/`)
- No central “backend” or “frontend”—this is purely a toolkit of CLI/Python scripts.

##### README for additional insights
- The root README simply lists the demos built with Ollama’s models.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Legend
    subgraph "Legend"
        direction TB
        DataShape[(Data Source)]:::data
        ProcessShape["Preprocessing"]:::process
        InferenceShape["Ollama Inference"]:::inference
        OutputShape["Postprocessing/Output"]:::output
    end

    %% Shared Inference Engine
    Ollama["Ollama Model Engine"]:::inference

    %% Chat-with-PDF Demo
    subgraph "Chat-with-PDF Demo"
        direction TB
        ChatPDF_Data[(PDFs)]:::data
        ChatPDF_Pre["pdf_rag.py"]:::process
        ChatPDF_Out["Output (Console/File)"]:::output
    end
    ChatPDF_Data -->|load & parse| ChatPDF_Pre
    ChatPDF_Pre -->|invoke model| Ollama
    Ollama -->|responses| ChatPDF_Out

    %% Video Summarization Demo
    subgraph "Video Summarization Demo"
        direction TB
        Video_Data[(videos/, frames/)]:::data
        Video_Pre["video_summary.py"]:::process
        Video_Out["Video Summary"]:::output
    end
    Video_Data -->|extract frames| Video_Pre
    Video_Pre -->|invoke model| Ollama
    Ollama -->|text summary| Video_Out

    %% Image Search Demo
    subgraph "Image Search Demo"
        direction TB
        Image_Data[(images/)]:::data
        Upload_Pre["upload_images.py"]:::process
        Search_Pre["image_search.py"]:::process
        Reverse_Pre["reverse_search.py"]:::process
        API_Wrap["app.py"]:::process
        Store_Helper["image_store.py"]:::process
        Image_Out["Search Results"]:::output
    end
    Image_Data -->|upload| Upload_Pre
    Upload_Pre -->|search logic| Search_Pre
    Search_Pre -->|reverse logic| Reverse_Pre
    Reverse_Pre -->|model call| Ollama
    Ollama -->|results| API_Wrap
    API_Wrap -->|store metadata| Store_Helper
    Store_Helper -->|output| Image_Out

    %% Click Events
    click ChatPDF_Data "https://github.com/ashishpatel26/ollama-playground/tree/main/chat-with-pdf/pdfs/"
    click ChatPDF_Pre "https://github.com/ashishpatel26/ollama-playground/blob/main/chat-with-pdf/pdf_rag.py"
    click ChatPDF_Out "https://github.com/ashishpatel26/ollama-playground/blob/main/chat-with-pdf/README.md"
    click Video_Data "https://github.com/ashishpatel26/ollama-playground/tree/main/video-summarization/videos/"
    click Video_Pre "https://github.com/ashishpatel26/ollama-playground/blob/main/video-summarization/video_summary.py"
    click Video_Out "https://github.com/ashishpatel26/ollama-playground/blob/main/video-summarization/README.md"
    click Image_Data "https://github.com/ashishpatel26/ollama-playground/tree/main/image-search/images/"
    click Upload_Pre "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/upload_images.py"
    click Search_Pre "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/image_search.py"
    click Reverse_Pre "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/reverse_search.py"
    click API_Wrap "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/app.py"
    click Store_Helper "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/image_store.py"
    click Image_Out "https://github.com/ashishpatel26/ollama-playground/blob/main/image-search/README.md"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef process fill:#90EE90,stroke:#000,stroke-width:1px
    classDef inference fill:#FFA500,stroke:#000,stroke-width:1px
    classDef output fill:#D3D3D3,stroke:#000,stroke-width:1px
```
