# mshumer/gpt-llm-trainer architecture

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

- Interactive diagram: https://gitdiagram.com/mshumer/gpt-llm-trainer
- Repository: https://github.com/mshumer/gpt-llm-trainer

## Overview

This repository is a set of notebook-based workflows for turning a task description into a fine-tuned language model. The documented path is task description → generated examples and system message → formatted, split data → fine-tuning → inference. The notebooks offer Claude/LLaMA 2 and GPT-3.5 variants; the README also documents saving LLaMA models to Google Drive and using GPT-3.5 models through OpenAI. No notebook source excerpts were available, so links below reflect README-documented behavior only.

Main entry points: [`gpt_llm_trainer_v2,_with_GPT_3_5_Fine_Tuning.ipynb`](https://github.com/mshumer/gpt-llm-trainer/blob/main/gpt_llm_trainer_v2%2C_with_GPT_3_5_Fine_Tuning.ipynb) (GPT-3.5 notebook), [`claude_llm_trainer.ipynb`](https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb) (Example generation), [`One_Prompt___Fine_Tuned_LLaMA_2.ipynb`](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb) (LLaMA 2 notebook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Dataset workflow"]
  node_claude_notebook["Claude LLaMA notebook"]
  node_llama_notebook["LLaMA 2 notebook"]
  node_gpt_notebook["GPT-3.5 notebook"]
  node_generation["Example generation"]
  node_system_message["System message"]
  node_format_split["Format and split"]
end

subgraph group_training["Models and inference"]
  node_fine_tuning["Fine-tuning"]
  node_inference["Inference"]
  node_model_storage[("Model storage")]
end

subgraph group_services["External services"]
  node_openai["OpenAI API"]
  node_google_drive[("Google Drive")]
  node_claude_gpt4["Claude 3 / GPT-4"]
end

node_user(("Task author"))

node_user -->|"sets task"| node_claude_notebook
node_user -->|"sets task"| node_llama_notebook
node_user -->|"sets task"| node_gpt_notebook
node_claude_notebook -->|"generates examples"| node_generation
node_llama_notebook -->|"generates examples"| node_generation
node_gpt_notebook -->|"generates examples"| node_generation
node_generation -->|"uses models"| node_claude_gpt4
node_claude_notebook -->|"generates"| node_system_message
node_llama_notebook -->|"formats and splits"| node_format_split
node_gpt_notebook -->|"formats and splits"| node_format_split
node_format_split -->|"provides datasets"| node_fine_tuning
node_fine_tuning -->|"prepares model"| node_inference
node_gpt_notebook -->|"sets API key"| node_openai
node_inference -->|"uses model API"| node_openai
node_fine_tuning -->|"saves model"| node_model_storage
node_model_storage -->|"stores in"| node_google_drive

click node_claude_notebook "https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb"
click node_llama_notebook "https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb"
click node_gpt_notebook "https://github.com/mshumer/gpt-llm-trainer/blob/main/gpt_llm_trainer_v2%2C_with_GPT_3_5_Fine_Tuning.ipynb"
click node_generation "https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb"
click node_system_message "https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb"
click node_format_split "https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb"
click node_fine_tuning "https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb"
click node_inference "https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb"
click node_model_storage "https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb"

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_claude_notebook,node_llama_notebook,node_gpt_notebook,node_generation,node_system_message,node_format_split toneBlue
class node_fine_tuning,node_inference,node_model_storage toneAmber
class node_openai,node_google_drive,node_claude_gpt4 toneMint
class node_user toneRose
```

## Components

### Dataset workflow

- [Claude LLaMA notebook](https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb): `claude_llm_trainer.ipynb`
- [LLaMA 2 notebook](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb): `One_Prompt___Fine_Tuned_LLaMA_2.ipynb`
- [GPT-3.5 notebook](https://github.com/mshumer/gpt-llm-trainer/blob/main/gpt_llm_trainer_v2%2C_with_GPT_3_5_Fine_Tuning.ipynb): `gpt_llm_trainer_v2,_with_GPT_3_5_Fine_Tuning.ipynb`
- [Example generation](https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb): `claude_llm_trainer.ipynb`
- [System message](https://github.com/mshumer/gpt-llm-trainer/blob/main/claude_llm_trainer.ipynb): `claude_llm_trainer.ipynb`
- [Format and split](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb): `One_Prompt___Fine_Tuned_LLaMA_2.ipynb`

### Models and inference

- [Fine-tuning](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb): `One_Prompt___Fine_Tuned_LLaMA_2.ipynb`
- [Inference](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb): `One_Prompt___Fine_Tuned_LLaMA_2.ipynb`
- [Model storage](https://github.com/mshumer/gpt-llm-trainer/blob/main/One_Prompt___Fine_Tuned_LLaMA_2.ipynb): `One_Prompt___Fine_Tuned_LLaMA_2.ipynb`

### External services

- **OpenAI API**
- **Google Drive**
- **Claude 3 / GPT-4**

### Other components

- **Task author**

## Connections

- Task author → Claude LLaMA notebook: sets task (evidence: `README.md`)
- Task author → LLaMA 2 notebook: sets task (evidence: `README.md`)
- Task author → GPT-3.5 notebook: sets task (evidence: `README.md`)
- Claude LLaMA notebook → Example generation: generates examples (evidence: `README.md`)
- LLaMA 2 notebook → Example generation: generates examples (evidence: `README.md`)
- GPT-3.5 notebook → Example generation: generates examples (evidence: `README.md`)
- Example generation → Claude 3 / GPT-4: uses models (evidence: `README.md`)
- Claude LLaMA notebook → System message: generates (evidence: `README.md`)
- LLaMA 2 notebook → Format and split: formats and splits (evidence: `README.md`)
- GPT-3.5 notebook → Format and split: formats and splits (evidence: `README.md`)
- Format and split → Fine-tuning: provides datasets (evidence: `README.md`)
- Fine-tuning → Inference: prepares model (evidence: `README.md`)
- GPT-3.5 notebook → OpenAI API: sets API key (evidence: `README.md`)
- Inference → OpenAI API: uses model API (evidence: `README.md`)
- Fine-tuning → Model storage: saves model (evidence: `README.md`)
- Model storage → Google Drive: stores in (evidence: `README.md`)
