# cocktailpeanut/llamacpp.pinokio architecture

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

- Interactive diagram: https://gitdiagram.com/cocktailpeanut/llamacpp.pinokio
- Repository: https://github.com/cocktailpeanut/llamacpp.pinokio

## Overview

##### Main Components

a. Installation Layer
- Two sub-components:
- Model Installer (connecting to install/models)
- Binary Installer (connecting to install/bin)

b. Model Management Layer
- Different model categories:
- LLaMa Models
- Falcon Models
- Vicuna Models
- Orca Models

c. Integration Layer
- Pinokio Integration component (connected to pinokio.js)
- Script Execution Engine (connected to index.js)

##### Component Relationships

- User Interface → Installation Manager
- Installation Manager → Model Registry
- Model Registry → LLaMa.cpp Runtime
- Pinokio Integration → Script Execution Engine
- Script Execution Engine → Model Registry

##### Important Details

a. File System Integration:
- How the install directory structure maps to the system
- Where model files are stored and accessed

b. Configuration Flow:
- How install.json and model configuration files interact
- Uninstallation path (uninstall.js)

1. User Interface Layer (top)
2. Core System Layer (middle)
3. Model Storage Layer (bottom)

##### Technical Notes

Annotations for:
- Supported model types and their configurations
- Installation flow sequence
- Script execution pathway
- Model loading and unloading processes

This design should effectively communicate how the system manages LLaMa.cpp models within the Pinokio ecosystem while maintaining clarity about the installation and execution processes.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        UI[User Interface]:::ui
    end

    subgraph "Core System Layer"
        PI[Pinokio Integration]:::core
        SE[Script Execution Engine]:::core
        IM[Installation Manager]:::core
    end

    subgraph "Installation Components"
        MI[Model Installer]:::installer
        BI[Binary Installer]:::installer
        BU[Binary Uninstaller]:::installer
    end

    subgraph "Model Registry"
        MR[Model Registry]:::registry
        subgraph "Model Types"
            LM[LLaMa Models]:::model
            FM[Falcon Models]:::model
            VM[Vicuna Models]:::model
            OM[Orca Models]:::model
        end
    end

    subgraph "Runtime Layer"
        LR[LLaMa.cpp Runtime]:::runtime
    end

    %% Connections
    UI --> PI
    PI --> SE
    SE --> IM
    IM --> MI & BI
    BI --> BU
    MI --> MR
    MR --> LM & FM & VM & OM
    MR --> LR

    %% Click Events
    click PI "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/pinokio.js"
    click SE "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/index.js"
    click BI "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/bin/install.json"
    click BU "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/bin/uninstall.js"
    click MR "https://github.com/cocktailpeanut/llamacpp.pinokio/tree/main/install/models/"
    click LM "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/models/llama-2-13b.ggmlv3.q4_0.json"
    click FM "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/models/falcon-7b-instruct-q4_0.json"
    click VM "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/models/stable-vicuna-13b-q4_0.json"
    click OM "https://github.com/cocktailpeanut/llamacpp.pinokio/blob/main/install/models/orca-mini-3b-q4_0.json"

    %% Styles
    classDef ui fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#bbf,stroke:#333,stroke-width:2px
    classDef installer fill:#bfb,stroke:#333,stroke-width:2px
    classDef registry fill:#fbb,stroke:#333,stroke-width:2px
    classDef model fill:#ffb,stroke:#333,stroke-width:2px
    classDef runtime fill:#bff,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1[User Interface]:::ui
        L2[Core Components]:::core
        L3[Installers]:::installer
        L4[Registry]:::registry
        L5[Models]:::model
        L6[Runtime]:::runtime
    end
```
