# manikanta2834/dbms-tutor architecture

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

- Interactive diagram: https://gitdiagram.com/manikanta2834/dbms-tutor
- Repository: https://github.com/manikanta2834/dbms-tutor

## Overview

DBMS Tutor is a QLoRA fine-tuning and tutoring application. Its main lifecycle validates and splits curated conversations, trains a LoRA adapter, evaluates baseline and adapted models, then serves tutoring through a terminal or browser. The README documents the benchmark and web curriculum features; sampled code confirms dataset handling, model loading, generation, and HTTP chat. Some internal web routes and training details were not sampled, so the graph shows only documented or source-supported connections.

Main entry points: [`train_qwen_ft.py`](https://github.com/manikanta2834/dbms-tutor/blob/main/train_qwen_ft.py) (QLoRA Trainer), [`outputs`](https://github.com/manikanta2834/dbms-tutor/tree/main/outputs) (LoRA Adapter), [`scripts/evaluate_model.py`](https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/evaluate_model.py) (DBMS Benchmark), [`scripts/prepare_dataset.py`](https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/prepare_dataset.py) (Dataset Splitter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data Preparation"]
  node_curated["Curated Q&amp;A<br/>[dbms_tutor.jsonl]"]
  node_validator["Dataset Validator"]
  node_splitter["Dataset Splitter<br/>[prepare_dataset.py]"]
  node_trainset["Training Split<br/>[train.jsonl]"]
  node_valset["Validation Split<br/>[validation.jsonl]"]
end

subgraph group_training["Model Training"]
  node_trainer["QLoRA Trainer<br/>[train_qwen_ft.py]"]
  node_base["Qwen Base Model"]
  node_adapter["LoRA Adapter"]
end

subgraph group_evaluation["Model Evaluation"]
  node_benchmark["DBMS Benchmark<br/>[evaluate_model.py]"]
  node_report["Evaluation Report"]
end

subgraph group_serving["Tutor Interfaces"]
  node_cli["Terminal Tutor<br/>[inference.py]"]
  node_web["Web Chat Server<br/>[web_chat.py]"]
  node_browser["Browser Chat UI<br/>[web_chat.py]"]
end

node_user(("Learner / Operator"))

node_curated -->|"validates"| node_validator
node_curated -->|"splits"| node_splitter
node_splitter -->|"writes"| node_trainset
node_splitter -->|"writes"| node_valset
node_trainset -->|"trains on"| node_trainer
node_valset -->|"validates with"| node_trainer
node_base -->|"adapts"| node_trainer
node_trainer -->|"saves"| node_adapter
node_benchmark -->|"loads baseline"| node_base
node_benchmark -->|"loads adapter"| node_adapter
node_benchmark -->|"writes"| node_report
node_user -->|"asks"| node_cli
node_cli -->|"loads if available"| node_adapter
node_cli -->|"falls back to"| node_base
node_user -->|"asks"| node_browser
node_browser -->|"posts chat"| node_web
node_web -->|"loads if available"| node_adapter
node_web -->|"falls back to"| node_base

click node_curated "https://github.com/manikanta2834/dbms-tutor/blob/main/data/dbms_tutor.jsonl"
click node_validator "https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/validate_dataset.py"
click node_splitter "https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/prepare_dataset.py"
click node_trainset "https://github.com/manikanta2834/dbms-tutor/blob/main/data/train.jsonl"
click node_valset "https://github.com/manikanta2834/dbms-tutor/blob/main/data/validation.jsonl"
click node_trainer "https://github.com/manikanta2834/dbms-tutor/blob/main/train_qwen_ft.py"
click node_adapter "https://github.com/manikanta2834/dbms-tutor/tree/main/outputs"
click node_benchmark "https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/evaluate_model.py"
click node_report "https://github.com/manikanta2834/dbms-tutor/tree/main/outputs"
click node_cli "https://github.com/manikanta2834/dbms-tutor/blob/main/inference.py"
click node_web "https://github.com/manikanta2834/dbms-tutor/blob/main/web_chat.py"
click node_browser "https://github.com/manikanta2834/dbms-tutor/blob/main/web_chat.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_curated,node_validator,node_splitter,node_trainset,node_valset toneBlue
class node_trainer,node_base,node_adapter toneAmber
class node_benchmark,node_report toneMint
class node_cli,node_web,node_browser toneRose
class node_user toneIndigo
```

## Components

### Data Preparation

- [Curated Q&A](https://github.com/manikanta2834/dbms-tutor/blob/main/data/dbms_tutor.jsonl): `data/dbms_tutor.jsonl`
- [Dataset Validator](https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/validate_dataset.py): `scripts/validate_dataset.py`
- [Dataset Splitter](https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/prepare_dataset.py): `scripts/prepare_dataset.py`
- [Training Split](https://github.com/manikanta2834/dbms-tutor/blob/main/data/train.jsonl): `data/train.jsonl`
- [Validation Split](https://github.com/manikanta2834/dbms-tutor/blob/main/data/validation.jsonl): `data/validation.jsonl`

### Model Training

- [QLoRA Trainer](https://github.com/manikanta2834/dbms-tutor/blob/main/train_qwen_ft.py): `train_qwen_ft.py`
- **Qwen Base Model**
- [LoRA Adapter](https://github.com/manikanta2834/dbms-tutor/tree/main/outputs): `outputs`

### Model Evaluation

- [DBMS Benchmark](https://github.com/manikanta2834/dbms-tutor/blob/main/scripts/evaluate_model.py): `scripts/evaluate_model.py`
- [Evaluation Report](https://github.com/manikanta2834/dbms-tutor/tree/main/outputs): `outputs`

### Tutor Interfaces

- [Terminal Tutor](https://github.com/manikanta2834/dbms-tutor/blob/main/inference.py): `inference.py`
- [Web Chat Server](https://github.com/manikanta2834/dbms-tutor/blob/main/web_chat.py): `web_chat.py`
- [Browser Chat UI](https://github.com/manikanta2834/dbms-tutor/blob/main/web_chat.py): `web_chat.py`

### Other components

- **Learner / Operator**

## Connections

- Curated Q&A → Dataset Validator: validates
- Curated Q&A → Dataset Splitter: splits
- Dataset Splitter → Training Split: writes
- Dataset Splitter → Validation Split: writes
- Training Split → QLoRA Trainer: trains on
- Validation Split → QLoRA Trainer: validates with
- Qwen Base Model → QLoRA Trainer: adapts
- QLoRA Trainer → LoRA Adapter: saves
- DBMS Benchmark → Qwen Base Model: loads baseline
- DBMS Benchmark → LoRA Adapter: loads adapter
- DBMS Benchmark → Evaluation Report: writes
- Learner / Operator → Terminal Tutor: asks
- Terminal Tutor → LoRA Adapter: loads if available
- Terminal Tutor → Qwen Base Model: falls back to
- Learner / Operator → Browser Chat UI: asks
- Browser Chat UI → Web Chat Server: posts chat
- Web Chat Server → LoRA Adapter: loads if available
- Web Chat Server → Qwen Base Model: falls back to
