# ibrahimsobh/llms architecture

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

- Interactive diagram: https://gitdiagram.com/ibrahimsobh/llms
- Repository: https://github.com/ibrahimsobh/llms

## Overview

- Notebooks / Demo Modules – At the root level you have individual demo notebooks such as “01_Hello_GPT.ipynb”, “02_Hello_BERT.ipynb”, etc. These represent the individual demonstration modules for specific LLMs.
- Agentic Workflows – This directory contains notebooks that illustrate how agents or chains of actions can be implemented (for example, simple language graph demonstrations, title generation, self-ask multi-agents, etc.).
- MultiAgents – This part of the project shows how multiple LLMs or agents can interact, manage contexts, or manage asynchronous operations.
- LMMs – Although similar in purpose to the other demos, these notebooks focus on “Large Multimodal Models”, which could be extended to cover visual as well as textual data in the future.

##### Relationships and Interactions
- That the user (or developer) interacts with each notebook module. Each notebook serves as a self-contained demonstration where the LLM is loaded, provided with inputs (prompts) and then returns outputs.
- That underlying libraries (such as Hugging Face Transformers, gpt4all library, and even LangChain-like workflows mentioned in the README) serve as “core services” or infrastructure enabling these demos.
- That Agentic Workflows and MultiAgents are layered on top of the base LLM demos; they not only call individual models but also chain actions, manage contexts, and coordinate between multiple models.
- If desired, add an “External Dependencies” component that shows integration points for tools like Google Palm, Streamlit, etc., all referenced in the README examples.

##### Architectural Patterns and Design Principles
- That the system is organized in a loosely coupled, plug-and-play style where one can run a selected notebook independently while the overall repository offers a comprehensive learning resource covering tasks such as prompt engineering, retrieval augmented generation, and even prompting chains.

##### Relevant Technologies and Frameworks
- Clearly label technologies like Hugging Face Transformers, gpt4all, and any mentioned frameworks (such as LangChain) which provide context in the README.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interaction Layer
    U["User/Developer"]:::user
    JN["Jupyter Notebook Interface"]:::user
    U -->|"interacts"| JN

    %% Demo Notebooks (Core LLM Demos)
    subgraph "Demo Notebooks"
        HG["Hello GPT Demo"]:::demo
        HB["Hello BERT Demo"]:::demo
        G4["GPT4ALL Demo"]:::demo
        F["Falcon Demo"]:::demo
        CT["CodeT5+ Demo"]:::demo
        CW["ChatwithDocs Demo"]:::demo
    end
    %% Agentic Workflows
    subgraph "Agentic Workflows"
        AL1["Simple LangGraph"]:::workflow
        AL2["Generate Post Titles"]:::workflow
        AL3["Agent and Tools"]:::workflow
        AL4["Self Ask MultiAgent"]:::workflow
    end
    %% MultiAgents
    subgraph "MultiAgents"
        MA1["MultiAgent Demo 1"]:::workflow
        MA2["MultiAgent Tools Mem"]:::workflow
        MA3["MultiAgent LLM Manager"]:::workflow
        MA4["MultiAgent Custom Manager"]:::workflow
        MA5["MultiAgent Async"]:::workflow
    end
    %% LMMs (Large Multimodal Models)
    subgraph "LMMs"
        LM1["LMM Demo 1"]:::workflow
        LM2["LMM Demo 2"]:::workflow
    end

    %% Infrastructure & Libraries
    subgraph "Infrastructure & Libraries"
        PEnv["Python & Jupyter Environment"]:::infra
        TLibs["Transformer Libraries"]:::infra
        Ext["External Services"]:::infra
    end

    %% Shared Assets & Documentation
    subgraph "Documentation & Shared Assets"
        RREADME["Root README"]:::docs
        RootImages["Root Images"]:::docs
        AWImages["Agentic Workflows Images"]:::docs
        MAImages["MultiAgents Images"]:::docs
        LMImages["LMMs Images"]:::docs
    end

    %% Connections from Jupyter interface to demo modules and workflows
    JN -->|"runsDemo"| HG
    JN -->|"triggersWorkflow"| AL1
    JN -->|"orchestratesMultiAgents"| MA1
    JN -->|"invokesLMMs"| LM1

    %% Demo to Workflows flows
    HG -->|"feedsInput"| AL1
    HG -->|"sendsOutput"| MA1
    HG -->|"extends"| LM1

    %% Infrastructure supports the Notebook Interface
    PEnv --> JN
    TLibs --> JN
    Ext --> JN

    %% Documentation guides the usage
    RREADME -->|"guides"| JN
    RootImages --> RREADME
    AWImages --> AL1
    MAImages --> MA1
    LMImages --> LM1

    %% Click Events for Notebooks / Demo Modules
    click HG "https://github.com/ibrahimsobh/llms/blob/main/01_Hello_GPT.ipynb"
    click HB "https://github.com/ibrahimsobh/llms/blob/main/02_Hello_BERT.ipynb"
    click G4 "https://github.com/ibrahimsobh/llms/blob/main/03_GPT4ALL.ipynb"
    click F "https://github.com/ibrahimsobh/llms/blob/main/04_Falcon.ipynb"
    click CT "https://github.com/ibrahimsobh/llms/blob/main/05_CodeT5p.ipynb"
    click CW "https://github.com/ibrahimsobh/llms/blob/main/06 ChatwithDocs.ipynb"

    %% Click Events for Agentic Workflows
    click AL1 "https://github.com/ibrahimsobh/llms/blob/main/Agentic Workflows/LG01_Simple_LangGraph.ipynb"
    click AL2 "https://github.com/ibrahimsobh/llms/blob/main/Agentic Workflows/LG02_Generate_Post_Titles.ipynb"
    click AL3 "https://github.com/ibrahimsobh/llms/blob/main/Agentic Workflows/LG03_Agent_and_Tools.ipynb"
    click AL4 "https://github.com/ibrahimsobh/llms/blob/main/Agentic Workflows/LG04_Self_Ask_MultiAgent.ipynb"

    %% Click Events for MultiAgents
    click MA1 "https://github.com/ibrahimsobh/llms/blob/main/MultiAgents/01 MultiAgent.ipynb"
    click MA2 "https://github.com/ibrahimsobh/llms/blob/main/MultiAgents/02 MultiAgentToolsMem.ipynb"
    click MA3 "https://github.com/ibrahimsobh/llms/blob/main/MultiAgents/03 MultiAgentLLMManager.ipynb"
    click MA4 "https://github.com/ibrahimsobh/llms/blob/main/MultiAgents/04 MultiAgentCustomManager.ipynb"
    click MA5 "https://github.com/ibrahimsobh/llms/blob/main/MultiAgents/05 MultiAgentAsync.ipynb"

    %% Click Events for LMMs
    click LM1 "https://github.com/ibrahimsobh/llms/blob/main/LMMs/LMM_01.ipynb"
    click LM2 "https://github.com/ibrahimsobh/llms/blob/main/LMMs/LMM_02.ipynb"

    %% Click Events for Shared Assets & Documentation
    click RREADME "https://github.com/ibrahimsobh/llms/blob/main/README.md"
    click RootImages "https://github.com/ibrahimsobh/llms/tree/main/images"
    click AWImages "https://github.com/ibrahimsobh/llms/tree/main/Agentic Workflows/images"
    click MAImages "https://github.com/ibrahimsobh/llms/tree/main/MultiAgents/images"
    click LMImages "https://github.com/ibrahimsobh/llms/tree/main/LMMs/images"

    %% Styles
    classDef user fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef demo fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef workflow fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef infra fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef docs fill:#D6EAF8,stroke:#3498DB,stroke-width:2px;
```
