# mhxdali/llm-gpu-capacity-planner architecture

> Architecture diagram of the GitHub repository mhxdali/llm-gpu-capacity-planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mhxdali/llm-gpu-capacity-planner
- Repository: https://github.com/mhxdali/llm-gpu-capacity-planner

## Overview

This is a small command-line GPU capacity planner. A user supplies model, context, concurrency, and optionally GPU memory; the CLI obtains GPU usage or uses the supplied capacity, fetches Ollama model metadata, estimates VRAM, and reports whether it fits. The calculator and CLI excerpts show the runtime calls; hardware and model-service behavior is described in the README.

Main entry points: [`check.py`](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/check.py) (Input and verdict CLI), [`calculator.py`](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/calculator.py) (Ollama model specs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_check["Input and verdict CLI<br/>[check.py]"]
  node_gpu["NVIDIA GPU query<br/>[check.py]"]
end

subgraph group_calc["VRAM calculation"]
  node_specs["Ollama model specs<br/>[calculator.py]"]
  node_estimate["VRAM estimator<br/>[calculator.py]"]
end

node_user(("Planner user"))
node_ollama["Ollama service"]
node_nvidia["nvidia-smi"]

node_user -->|"runs with options"| node_check
node_check -->|"queries GPU"| node_gpu
node_gpu -->|"runs command"| node_nvidia
node_check -->|"requests model data"| node_specs
node_specs -->|"fetches metadata"| node_ollama
node_check -->|"requests estimate"| node_estimate
node_check -->|"prints fit verdict"| node_user

click node_check "https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/check.py"
click node_gpu "https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/check.py"
click node_specs "https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/calculator.py"
click node_estimate "https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/calculator.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_check,node_gpu,node_user toneBlue
class node_specs,node_estimate toneAmber
class node_ollama,node_nvidia toneIndigo
```

## Components

### CLI workflow

- [Input and verdict CLI](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/check.py): `check.py`
- [NVIDIA GPU query](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/check.py): `check.py`

### VRAM calculation

- [Ollama model specs](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/calculator.py): `calculator.py`
- [VRAM estimator](https://github.com/mhxdali/llm-gpu-capacity-planner/blob/main/calculator.py): `calculator.py`

### Other components

- **Planner user**
- **Ollama service**
- **nvidia-smi**

## Connections

- Planner user → Input and verdict CLI: runs with options (evidence: `README.md`)
- Input and verdict CLI → NVIDIA GPU query: queries GPU (evidence: `check.py`)
- NVIDIA GPU query → nvidia-smi: runs command (evidence: `check.py`)
- Input and verdict CLI → Ollama model specs: requests model data (evidence: `check.py`)
- Ollama model specs → Ollama service: fetches metadata (evidence: `calculator.py`)
- Input and verdict CLI → VRAM estimator: requests estimate (evidence: `check.py`)
- Input and verdict CLI → Planner user: prints fit verdict (evidence: `check.py`)
