# ashishpatel26/llm-finetuning architecture

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

- Interactive diagram: https://gitdiagram.com/ashishpatel26/llm-finetuning
- Repository: https://github.com/ashishpatel26/llm-finetuning

## Overview

This repository is a collection of independently runnable notebooks, not a single application pipeline. Users choose a notebook to fine-tune or optimize a model, build a chatbot or retrieval/knowledge-graph workflow, or evaluate a model and generation strategy. The groups reflect those documented product areas; each notebook is represented as its own workflow. The README excerpt and filenames establish these capabilities, but no notebook source was available to verify internal calls, data flow, or integrations.

Main entry points: [`1.Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb`](https://github.com/ashishpatel26/llm-finetuning/blob/main/1.Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb) (LoRA training), [`2.Fine_Tune_Your_Own_Llama_2_Model_in_a_Colab_Notebook.ipynb`](https://github.com/ashishpatel26/llm-finetuning/blob/main/2.Fine_Tune_Your_Own_Llama_2_Model_in_a_Colab_Notebook.ipynb) (Llama 2 tuning), [`3.Guanaco Chatbot Demo with LLaMA-7B Model.ipynb`](https://github.com/ashishpatel26/llm-finetuning/blob/main/3.Guanaco%20Chatbot%20Demo%20with%20LLaMA-7B%20Model.ipynb) (Guanaco chatbot), [`4.PEFT Finetune-Bloom-560m-tagger.ipynb`](https://github.com/ashishpatel26/llm-finetuning/blob/main/4.PEFT%20Finetune-Bloom-560m-tagger.ipynb) (Bloom tagger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_finetune["Model fine-tuning"]
  node_lora["LoRA training"]
  node_llama2["Llama 2 tuning"]
  node_guanaco["Guanaco chatbot"]
  node_bloom["Bloom tagger"]
  node_opt["OPT tuning"]
  node_falcon["Falcon training"]
  node_qlora["QLoRA tuning"]
  node_vicuna["Vicuna tuning"]
  node_neox["GPT-NeoX training"]
  node_mpt["MPT instruction tuning"]
  node_rlhf["RLHF training"]
  node_phi["Phi SFT"]
  node_gpt35["GPT-3.5 tuning"]
  node_mistral["Mistral AutoTrain"]
end

subgraph group_optimize["Model optimization"]
  node_hqq["HQQ quantization"]
  node_gemma["Gemma Unsloth tuning"]
  node_cag["Cache-augmented generation"]
end

subgraph group_knowledge["Retrieval and knowledge"]
  node_rag["LangChain RAG"]
  node_neo4j["Neo4j question answering"]
  node_graphqa["Graph question answering"]
  node_docgraph["Document knowledge graph"]
end

subgraph group_evaluate["Evaluation"]
  node_rag_eval["RAG evaluation"]
  node_hf_eval["Hugging Face evaluation"]
end

node_user(("Notebook user"))

node_user -->|"runs"| node_lora
node_user -->|"runs"| node_llama2
node_user -->|"runs"| node_guanaco
node_user -->|"runs"| node_bloom
node_user -->|"runs"| node_opt
node_user -->|"runs"| node_falcon
node_user -->|"runs"| node_qlora
node_user -->|"runs"| node_vicuna
node_user -->|"runs"| node_neox
node_user -->|"runs"| node_mpt
node_user -->|"runs"| node_rlhf
node_user -->|"runs"| node_phi
node_user -->|"runs"| node_gpt35
node_user -->|"runs"| node_mistral
node_user -->|"runs"| node_hqq
node_user -->|"runs"| node_gemma
node_user -->|"runs"| node_cag
node_user -->|"runs"| node_rag
node_user -->|"runs"| node_neo4j
node_user -->|"runs"| node_graphqa
node_user -->|"runs"| node_docgraph
node_user -->|"runs"| node_rag_eval
node_user -->|"runs"| node_hf_eval

click node_lora "https://github.com/ashishpatel26/llm-finetuning/blob/main/1.Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb"
click node_llama2 "https://github.com/ashishpatel26/llm-finetuning/blob/main/2.Fine_Tune_Your_Own_Llama_2_Model_in_a_Colab_Notebook.ipynb"
click node_guanaco "https://github.com/ashishpatel26/llm-finetuning/blob/main/3.Guanaco%20Chatbot%20Demo%20with%20LLaMA-7B%20Model.ipynb"
click node_bloom "https://github.com/ashishpatel26/llm-finetuning/blob/main/4.PEFT%20Finetune-Bloom-560m-tagger.ipynb"
click node_opt "https://github.com/ashishpatel26/llm-finetuning/blob/main/5.Finetune_Meta_OPT-6-1b_Model_bnb_peft.ipynb"
click node_falcon "https://github.com/ashishpatel26/llm-finetuning/blob/main/6.Finetune%20Falcon-7b%20with%20BNB%20Self%20Supervised%20Training.ipynb"
click node_qlora "https://github.com/ashishpatel26/llm-finetuning/blob/main/7.FineTune_LLAMA2_with_QLORA.ipynb"
click node_vicuna "https://github.com/ashishpatel26/llm-finetuning/blob/main/8.Stable_Vicuna13B_8bit_in_Colab.ipynb"
click node_neox "https://github.com/ashishpatel26/llm-finetuning/blob/main/9.GPT-neo-x-20B-bnb_4bit_training.ipynb"
click node_mpt "https://github.com/ashishpatel26/llm-finetuning/blob/main/10.MPT_Instruct_30B.ipynb"
click node_rlhf "https://github.com/ashishpatel26/llm-finetuning/blob/main/11_RLHF_Training_for_CustomDataset_for_AnyModel.ipynb"
click node_phi "https://github.com/ashishpatel26/llm-finetuning/blob/main/12_Fine_tuning_Microsoft_Phi_1_5b_on_custom_dataset(dialogstudio).ipynb"
click node_gpt35 "https://github.com/ashishpatel26/llm-finetuning/blob/main/13.Fine_tuning_OpenAI_GPT_3_5_turbo.ipynb"
click node_mistral "https://github.com/ashishpatel26/llm-finetuning/blob/main/14.Finetuning_Mistral_7b_Using_AutoTrain.ipynb"
click node_hqq "https://github.com/ashishpatel26/llm-finetuning/blob/main/19.HQQ_1bit_ipynb.ipynb"
click node_gemma "https://github.com/ashishpatel26/llm-finetuning/blob/main/20.Alpaca_%2B_Gemma2_9b_Unsloth_2x_faster_finetuning.ipynb"
click node_cag "https://github.com/ashishpatel26/llm-finetuning/blob/main/23_CAG_Optimizing_LLMs_with_cache_augmented_generation.ipynb"
click node_rag "https://github.com/ashishpatel26/llm-finetuning/blob/main/15.RAG_LangChain.ipynb"
click node_neo4j "https://github.com/ashishpatel26/llm-finetuning/blob/main/16.Neo4j_and_LangChain_for_Enhanced_Question_Answering.ipynb"
click node_graphqa "https://github.com/ashishpatel26/llm-finetuning/blob/main/17.OpenAI_Constructing_Graph_for_Questio_Answer.ipynb"
click node_docgraph "https://github.com/ashishpatel26/llm-finetuning/blob/main/18.Convert_Document_to_Knowledge_Graph_Langchain_Openai.ipynb"
click node_rag_eval "https://github.com/ashishpatel26/llm-finetuning/blob/main/21_RAG_Pipeline_Evaluation_Using_MLFLOW_Best_Industry_Practise.ipynb"
click node_hf_eval "https://github.com/ashishpatel26/llm-finetuning/blob/main/22.Evaluate_a_Hugging_Face_LLM_with_mlflow_evaluate.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_lora,node_llama2,node_guanaco,node_bloom,node_opt,node_falcon,node_qlora,node_vicuna,node_neox,node_mpt,node_rlhf,node_phi,node_gpt35,node_mistral,node_user toneBlue
class node_hqq,node_gemma,node_cag toneAmber
class node_rag,node_neo4j,node_graphqa,node_docgraph toneMint
class node_rag_eval,node_hf_eval toneRose
```

## Components

### Model fine-tuning

- [LoRA training](https://github.com/ashishpatel26/llm-finetuning/blob/main/1.Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb): `1.Efficiently_train_Large_Language_Models_with_LoRA_and_Hugging_Face.ipynb`
- [Llama 2 tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/2.Fine_Tune_Your_Own_Llama_2_Model_in_a_Colab_Notebook.ipynb): `2.Fine_Tune_Your_Own_Llama_2_Model_in_a_Colab_Notebook.ipynb`
- [Guanaco chatbot](https://github.com/ashishpatel26/llm-finetuning/blob/main/3.Guanaco%20Chatbot%20Demo%20with%20LLaMA-7B%20Model.ipynb): `3.Guanaco Chatbot Demo with LLaMA-7B Model.ipynb`
- [Bloom tagger](https://github.com/ashishpatel26/llm-finetuning/blob/main/4.PEFT%20Finetune-Bloom-560m-tagger.ipynb): `4.PEFT Finetune-Bloom-560m-tagger.ipynb`
- [OPT tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/5.Finetune_Meta_OPT-6-1b_Model_bnb_peft.ipynb): `5.Finetune_Meta_OPT-6-1b_Model_bnb_peft.ipynb`
- [Falcon training](https://github.com/ashishpatel26/llm-finetuning/blob/main/6.Finetune%20Falcon-7b%20with%20BNB%20Self%20Supervised%20Training.ipynb): `6.Finetune Falcon-7b with BNB Self Supervised Training.ipynb`
- [QLoRA tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/7.FineTune_LLAMA2_with_QLORA.ipynb): `7.FineTune_LLAMA2_with_QLORA.ipynb`
- [Vicuna tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/8.Stable_Vicuna13B_8bit_in_Colab.ipynb): `8.Stable_Vicuna13B_8bit_in_Colab.ipynb`
- [GPT-NeoX training](https://github.com/ashishpatel26/llm-finetuning/blob/main/9.GPT-neo-x-20B-bnb_4bit_training.ipynb): `9.GPT-neo-x-20B-bnb_4bit_training.ipynb`
- [MPT instruction tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/10.MPT_Instruct_30B.ipynb): `10.MPT_Instruct_30B.ipynb`
- [RLHF training](https://github.com/ashishpatel26/llm-finetuning/blob/main/11_RLHF_Training_for_CustomDataset_for_AnyModel.ipynb): `11_RLHF_Training_for_CustomDataset_for_AnyModel.ipynb`
- [Phi SFT](https://github.com/ashishpatel26/llm-finetuning/blob/main/12_Fine_tuning_Microsoft_Phi_1_5b_on_custom_dataset(dialogstudio).ipynb): `12_Fine_tuning_Microsoft_Phi_1_5b_on_custom_dataset(dialogstudio).ipynb`
- [GPT-3.5 tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/13.Fine_tuning_OpenAI_GPT_3_5_turbo.ipynb): `13.Fine_tuning_OpenAI_GPT_3_5_turbo.ipynb`
- [Mistral AutoTrain](https://github.com/ashishpatel26/llm-finetuning/blob/main/14.Finetuning_Mistral_7b_Using_AutoTrain.ipynb): `14.Finetuning_Mistral_7b_Using_AutoTrain.ipynb`

### Model optimization

- [HQQ quantization](https://github.com/ashishpatel26/llm-finetuning/blob/main/19.HQQ_1bit_ipynb.ipynb): `19.HQQ_1bit_ipynb.ipynb`
- [Gemma Unsloth tuning](https://github.com/ashishpatel26/llm-finetuning/blob/main/20.Alpaca_%2B_Gemma2_9b_Unsloth_2x_faster_finetuning.ipynb): `20.Alpaca_+_Gemma2_9b_Unsloth_2x_faster_finetuning.ipynb`
- [Cache-augmented generation](https://github.com/ashishpatel26/llm-finetuning/blob/main/23_CAG_Optimizing_LLMs_with_cache_augmented_generation.ipynb): `23_CAG_Optimizing_LLMs_with_cache_augmented_generation.ipynb`

### Retrieval and knowledge

- [LangChain RAG](https://github.com/ashishpatel26/llm-finetuning/blob/main/15.RAG_LangChain.ipynb): `15.RAG_LangChain.ipynb`
- [Neo4j question answering](https://github.com/ashishpatel26/llm-finetuning/blob/main/16.Neo4j_and_LangChain_for_Enhanced_Question_Answering.ipynb): `16.Neo4j_and_LangChain_for_Enhanced_Question_Answering.ipynb`
- [Graph question answering](https://github.com/ashishpatel26/llm-finetuning/blob/main/17.OpenAI_Constructing_Graph_for_Questio_Answer.ipynb): `17.OpenAI_Constructing_Graph_for_Questio_Answer.ipynb`
- [Document knowledge graph](https://github.com/ashishpatel26/llm-finetuning/blob/main/18.Convert_Document_to_Knowledge_Graph_Langchain_Openai.ipynb): `18.Convert_Document_to_Knowledge_Graph_Langchain_Openai.ipynb`

### Evaluation

- [RAG evaluation](https://github.com/ashishpatel26/llm-finetuning/blob/main/21_RAG_Pipeline_Evaluation_Using_MLFLOW_Best_Industry_Practise.ipynb): `21_RAG_Pipeline_Evaluation_Using_MLFLOW_Best_Industry_Practise.ipynb`
- [Hugging Face evaluation](https://github.com/ashishpatel26/llm-finetuning/blob/main/22.Evaluate_a_Hugging_Face_LLM_with_mlflow_evaluate.ipynb): `22.Evaluate_a_Hugging_Face_LLM_with_mlflow_evaluate.ipynb`

### Other components

- **Notebook user**

## Connections

- Notebook user → LoRA training: runs
- Notebook user → Llama 2 tuning: runs
- Notebook user → Guanaco chatbot: runs
- Notebook user → Bloom tagger: runs
- Notebook user → OPT tuning: runs
- Notebook user → Falcon training: runs
- Notebook user → QLoRA tuning: runs
- Notebook user → Vicuna tuning: runs
- Notebook user → GPT-NeoX training: runs
- Notebook user → MPT instruction tuning: runs
- Notebook user → RLHF training: runs
- Notebook user → Phi SFT: runs
- Notebook user → GPT-3.5 tuning: runs
- Notebook user → Mistral AutoTrain: runs
- Notebook user → HQQ quantization: runs
- Notebook user → Gemma Unsloth tuning: runs
- Notebook user → Cache-augmented generation: runs
- Notebook user → LangChain RAG: runs
- Notebook user → Neo4j question answering: runs
- Notebook user → Graph question answering: runs
- Notebook user → Document knowledge graph: runs
- Notebook user → RAG evaluation: runs
- Notebook user → Hugging Face evaluation: runs
