# ishan-debugg/fine-tuning-lora architecture

> Architecture diagram of the GitHub repository ishan-debugg/fine-tuning-lora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ishan-debugg/fine-tuning-lora
- Repository: https://github.com/ishan-debugg/fine-tuning-lora

## Overview

This repository documents a notebook-based QLoRA fine-tuning project for structured JSON tool calling. Its principal workflow curates the xLAM function-calling dataset, fine-tunes Qwen2.5-1.5B with LoRA, and evaluates JSON structure and function-selection accuracy; the README also describes adapter-based inference and identifies DPO as a future direction. Notebook contents were not provided, so relationships below are limited to those explicitly documented in the README.

Main entry points: [`notebooks/phase2sft.ipynb`](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/phase2sft.ipynb) (QLoRA fine-tuning), [`phase1.ipynb`](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/phase1.ipynb) (Dataset curation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data curation"]
  node_curation["Dataset curation<br/>[phase1.ipynb]"]
  node_clean_data[("Curated splits")]
end

subgraph group_training["Fine-tuning"]
  node_sft["QLoRA fine-tuning<br/>[phase2sft.ipynb]"]
  node_finetuning_notebook["Fine-tuning notebook<br/>[Finetuning.ipynb]"]
  node_base_model["Qwen2.5-1.5B"]
  node_adapter["LoRA adapter"]
  node_dpo["DPO preference tuning"]
end

subgraph group_use["Inference and evaluation"]
  node_inference["Tool-call inference"]
  node_evaluation["SFT evaluation<br/>[phase2sft.ipynb]"]
  node_tool_call["JSON tool call"]
end

node_dataset[("xLAM dataset")]
node_user(("User"))

node_dataset -->|"provides examples"| node_curation
node_curation -->|"filters and splits"| node_clean_data
node_clean_data -->|"trains on"| node_sft
node_base_model -->|"fine-tunes"| node_sft
node_sft -->|"produces"| node_adapter
node_user -->|"provides input"| node_inference
node_base_model -->|"loads with adapter"| node_inference
node_adapter -->|"configures"| node_inference
node_inference -->|"generates"| node_tool_call
node_sft -->|"evaluates outputs"| node_evaluation
node_evaluation -->|"motivates next step"| node_dpo

click node_curation "https://github.com/ishan-debugg/fine-tuning-lora/blob/main/phase1.ipynb"
click node_sft "https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/phase2sft.ipynb"
click node_finetuning_notebook "https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/Finetuning.ipynb"
click node_evaluation "https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/phase2sft.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_curation,node_clean_data,node_user toneBlue
class node_sft,node_finetuning_notebook,node_base_model,node_adapter,node_dpo,node_dataset toneAmber
class node_inference,node_evaluation,node_tool_call toneMint
```

## Components

### Data curation

- [Dataset curation](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/phase1.ipynb): `phase1.ipynb`
- **Curated splits**

### Fine-tuning

- [QLoRA fine-tuning](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/phase2sft.ipynb): `notebooks/phase2sft.ipynb`
- [Fine-tuning notebook](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/Finetuning.ipynb): `notebooks/Finetuning.ipynb`
- **Qwen2.5-1.5B**
- **LoRA adapter**
- **DPO preference tuning**

### Inference and evaluation

- **Tool-call inference**
- [SFT evaluation](https://github.com/ishan-debugg/fine-tuning-lora/blob/main/notebooks/phase2sft.ipynb): `notebooks/phase2sft.ipynb`
- **JSON tool call**

### Other components

- **xLAM dataset**
- **User**

## Connections

- xLAM dataset → Dataset curation: provides examples (evidence: `Readme.md`)
- Dataset curation → Curated splits: filters and splits (evidence: `Readme.md`)
- Curated splits → QLoRA fine-tuning: trains on (evidence: `Readme.md`)
- Qwen2.5-1.5B → QLoRA fine-tuning: fine-tunes (evidence: `Readme.md`)
- QLoRA fine-tuning → LoRA adapter: produces (evidence: `Readme.md`)
- User → Tool-call inference: provides input (evidence: `Readme.md`)
- Qwen2.5-1.5B → Tool-call inference: loads with adapter (evidence: `Readme.md`)
- LoRA adapter → Tool-call inference: configures (evidence: `Readme.md`)
- Tool-call inference → JSON tool call: generates (evidence: `Readme.md`)
- QLoRA fine-tuning → SFT evaluation: evaluates outputs (evidence: `Readme.md`)
- SFT evaluation → DPO preference tuning: motivates next step (evidence: `Readme.md`)
