# analog76/llm-internals architecture

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

- Interactive diagram: https://gitdiagram.com/analog76/llm-internals
- Repository: https://github.com/analog76/llm-internals

## Overview

This repository is a collection of LLM learning material and practical inference tooling, rather than a single application. Its learning path spans foundations, distributed training, and inference; its operational branch includes benchmark helpers and a vLLM chat setup. The sampled chat server serves a local browser UI and proxies API requests to vLLM. The README describes broader planned structure, but many paths it mentions are absent from the supplied tree; unsampled tool behavior and cross-topic links are therefore not inferred.

Main entry points: [`tools/vllm/aws-g5/chat-server.py`](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/chat-server.py) (Chat proxy), [`docs/foundations`](https://github.com/analog76/llm-internals/tree/main/docs/foundations) (Math foundations), [`docs/foundations/flash-attention.md`](https://github.com/analog76/llm-internals/blob/main/docs/foundations/flash-attention.md) (Flash attention), [`docs/distributed/01-foundations.md`](https://github.com/analog76/llm-internals/blob/main/docs/distributed/01-foundations.md) (Distributed foundations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning material"]
  node_foundations["Math foundations"]
  node_attention["Flash attention<br/>[flash-attention.md]"]
  node_distributed_intro["Distributed foundations<br/>[01-foundations.md]"]
  node_ring_allreduce["Ring all-reduce"]
  node_tree_allreduce["Tree all-reduce"]
  node_algorithm_comparison["Ring vs tree"]
  node_nccl_structures["NCCL structures"]
  node_sglang_notes["SGLang inference<br/>[sglang.txt]"]
  node_vllm_walkthrough["vLLM startup"]
end

subgraph group_benchmarking["Benchmark tools"]
  node_benchmark_scripts["Benchmark runners"]
  node_benchmark_summary["Result summarizer<br/>[summarize.py]"]
  node_benchmark_guides["Benchmark guides"]
  node_deployment_guide["SGLang deployment"]
end

subgraph group_vllm_ops["vLLM operations"]
  node_vllm_runbook["GPU runbook<br/>[RUNBOOK.md]"]
  node_vllm_setup["vLLM setup<br/>[setup-vllm.sh]"]
  node_vllm_serve["vLLM serving<br/>[serve-vllm.sh]"]
  node_chat_server["Chat proxy<br/>[chat-server.py]"]
  node_chat_ui["Chat UI<br/>[chat.html]"]
end

node_learner(("Engineer"))
node_browser(("Browser user"))
node_vllm_service["vLLM API"]

node_learner -->|"studies"| node_foundations
node_learner -->|"studies"| node_attention
node_learner -->|"studies"| node_distributed_intro
node_learner -->|"studies"| node_ring_allreduce
node_learner -->|"studies"| node_tree_allreduce
node_learner -->|"studies"| node_algorithm_comparison
node_learner -->|"studies"| node_nccl_structures
node_learner -->|"studies"| node_sglang_notes
node_learner -->|"studies"| node_vllm_walkthrough
node_browser -->|"requests UI"| node_chat_server
node_chat_server -->|"serves"| node_chat_ui
node_chat_server -->|"proxies API"| node_vllm_service

click node_foundations "https://github.com/analog76/llm-internals/tree/main/docs/foundations"
click node_attention "https://github.com/analog76/llm-internals/blob/main/docs/foundations/flash-attention.md"
click node_distributed_intro "https://github.com/analog76/llm-internals/blob/main/docs/distributed/01-foundations.md"
click node_ring_allreduce "https://github.com/analog76/llm-internals/blob/main/docs/distributed/02-ring-all-reduce.md"
click node_tree_allreduce "https://github.com/analog76/llm-internals/blob/main/docs/distributed/03-tree-allreduce.md"
click node_algorithm_comparison "https://github.com/analog76/llm-internals/blob/main/docs/distributed/04-ring-versus-tree.md"
click node_nccl_structures "https://github.com/analog76/llm-internals/blob/main/docs/distributed/05-nccl-data-structures.md"
click node_sglang_notes "https://github.com/analog76/llm-internals/blob/main/docs/inference/sglang/sglang.txt"
click node_vllm_walkthrough "https://github.com/analog76/llm-internals/blob/main/docs/inference/vllm/vllm-startup-log-walkthrough.md"
click node_benchmark_scripts "https://github.com/analog76/llm-internals/tree/main/tools/benchmarks"
click node_benchmark_summary "https://github.com/analog76/llm-internals/blob/main/tools/benchmarks/summarize.py"
click node_benchmark_guides "https://github.com/analog76/llm-internals/tree/main/tools/benchmarks"
click node_deployment_guide "https://github.com/analog76/llm-internals/blob/main/tools/benchmarks/sglang-deployment.md"
click node_vllm_runbook "https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/RUNBOOK.md"
click node_vllm_setup "https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/setup-vllm.sh"
click node_vllm_serve "https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/serve-vllm.sh"
click node_chat_server "https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/chat-server.py"
click node_chat_ui "https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/chat.html"

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_foundations,node_attention,node_distributed_intro,node_ring_allreduce,node_tree_allreduce,node_algorithm_comparison,node_nccl_structures,node_sglang_notes,node_vllm_walkthrough,node_browser toneBlue
class node_benchmark_scripts,node_benchmark_summary,node_benchmark_guides,node_deployment_guide toneAmber
class node_vllm_runbook,node_vllm_setup,node_vllm_serve,node_chat_server,node_chat_ui,node_vllm_service toneMint
class node_learner toneIndigo
```

## Components

### Learning material

- [Math foundations](https://github.com/analog76/llm-internals/tree/main/docs/foundations): `docs/foundations`
- [Flash attention](https://github.com/analog76/llm-internals/blob/main/docs/foundations/flash-attention.md): `docs/foundations/flash-attention.md`
- [Distributed foundations](https://github.com/analog76/llm-internals/blob/main/docs/distributed/01-foundations.md): `docs/distributed/01-foundations.md`
- [Ring all-reduce](https://github.com/analog76/llm-internals/blob/main/docs/distributed/02-ring-all-reduce.md): `docs/distributed/02-ring-all-reduce.md`
- [Tree all-reduce](https://github.com/analog76/llm-internals/blob/main/docs/distributed/03-tree-allreduce.md): `docs/distributed/03-tree-allreduce.md`
- [Ring vs tree](https://github.com/analog76/llm-internals/blob/main/docs/distributed/04-ring-versus-tree.md): `docs/distributed/04-ring-versus-tree.md`
- [NCCL structures](https://github.com/analog76/llm-internals/blob/main/docs/distributed/05-nccl-data-structures.md): `docs/distributed/05-nccl-data-structures.md`
- [SGLang inference](https://github.com/analog76/llm-internals/blob/main/docs/inference/sglang/sglang.txt): `docs/inference/sglang/sglang.txt`
- [vLLM startup](https://github.com/analog76/llm-internals/blob/main/docs/inference/vllm/vllm-startup-log-walkthrough.md): `docs/inference/vllm/vllm-startup-log-walkthrough.md`

### Benchmark tools

- [Benchmark runners](https://github.com/analog76/llm-internals/tree/main/tools/benchmarks): `tools/benchmarks`
- [Result summarizer](https://github.com/analog76/llm-internals/blob/main/tools/benchmarks/summarize.py): `tools/benchmarks/summarize.py`
- [Benchmark guides](https://github.com/analog76/llm-internals/tree/main/tools/benchmarks): `tools/benchmarks`
- [SGLang deployment](https://github.com/analog76/llm-internals/blob/main/tools/benchmarks/sglang-deployment.md): `tools/benchmarks/sglang-deployment.md`

### vLLM operations

- [GPU runbook](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/RUNBOOK.md): `tools/vllm/aws-g5/RUNBOOK.md`
- [vLLM setup](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/setup-vllm.sh): `tools/vllm/aws-g5/setup-vllm.sh`
- [vLLM serving](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/serve-vllm.sh): `tools/vllm/aws-g5/serve-vllm.sh`
- [Chat proxy](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/chat-server.py): `tools/vllm/aws-g5/chat-server.py`
- [Chat UI](https://github.com/analog76/llm-internals/blob/main/tools/vllm/aws-g5/chat.html): `tools/vllm/aws-g5/chat.html`

### Other components

- **Engineer**
- **Browser user**
- **vLLM API**

## Connections

- Engineer → Math foundations: studies (evidence: `README.md`)
- Engineer → Flash attention: studies (evidence: `README.md`)
- Engineer → Distributed foundations: studies (evidence: `README.md`)
- Engineer → Ring all-reduce: studies (evidence: `README.md`)
- Engineer → Tree all-reduce: studies (evidence: `README.md`)
- Engineer → Ring vs tree: studies (evidence: `README.md`)
- Engineer → NCCL structures: studies (evidence: `README.md`)
- Engineer → SGLang inference: studies (evidence: `README.md`)
- Engineer → vLLM startup: studies (evidence: `README.md`)
- Browser user → Chat proxy: requests UI (evidence: `tools/vllm/aws-g5/chat-server.py`)
- Chat proxy → Chat UI: serves (evidence: `tools/vllm/aws-g5/chat-server.py`)
- Chat proxy → vLLM API: proxies API (evidence: `tools/vllm/aws-g5/chat-server.py`)
