# gfyddha/flylora architecture

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

- Interactive diagram: https://gitdiagram.com/gfyddha/flylora
- Repository: https://github.com/gfyddha/flylora

## Overview

FlyLoRA is a parameter-efficient fine-tuning method implemented as a PEFT/LoRA extension. Its documented experiment workflow covers single-task training, evaluation, and multi-task adapter merging; the minimal implementation also exposes the core method. The PEFT tree shows the adapter framework and its many alternative tuner families. The available source excerpts do not include the root experiment scripts or modified LoRA implementation, so detailed call ownership and artifact flow are not inferred.

Main entry points: [`peft/src/peft/peft_model.py`](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/peft_model.py) (PEFT model), [`peft/src/peft/mapping.py`](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/mapping.py) (Tuner mapping), [`finetune.py`](https://github.com/gfyddha/flylora/blob/main/finetune.py) (Fine-tune), [`evaluate.py`](https://github.com/gfyddha/flylora/blob/main/evaluate.py) (Evaluate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["FlyLoRA workflow"]
  node_finetune["Fine-tune<br/>[finetune.py]"]
  node_evaluate["Evaluate<br/>[evaluate.py]"]
  node_merge["Merge adapters"]
  node_minimal["Minimal FlyLoRA<br/>[flylora.py]"]
end

subgraph group_framework["PEFT runtime"]
  node_peft_model["PEFT model<br/>[peft_model.py]"]
  node_config["Adapter config<br/>[config.py]"]
  node_mapping["Tuner mapping<br/>[mapping.py]"]
  node_lora_model["LoRA tuner<br/>[model.py]"]
  node_lora_layer["LoRA layers<br/>[layer.py]"]
  node_other_tuners["Other tuners"]
  node_adapter_io["Adapter persistence<br/>[save_and_load.py]"]
end

subgraph group_analysis["Method comparison"]
  node_comparison["Comparison app<br/>[app.py]"]
  node_comparison_data["Comparison data<br/>[processing.py]"]
end

node_user(("Researcher"))
node_base_model["Foundation model"]

node_user -->|"runs training"| node_finetune
node_user -->|"runs evaluation"| node_evaluate
node_user -->|"runs merging"| node_merge
node_user -.->|"uses reference"| node_minimal
node_finetune -->|"trains with"| node_peft_model
node_evaluate -->|"evaluates with"| node_peft_model
node_merge -->|"uses adapters"| node_peft_model
node_peft_model -->|"uses config"| node_config
node_peft_model -->|"dispatches tuner"| node_mapping
node_mapping -->|"selects LoRA"| node_lora_model
node_lora_model -->|"installs layers"| node_lora_layer
node_lora_layer -->|"adapts layers"| node_base_model
node_peft_model -->|"loads and saves"| node_adapter_io
node_mapping -->|"selects alternatives"| node_other_tuners
node_user -.->|"explores results"| node_comparison
node_comparison -.->|"uses processing"| node_comparison_data

click node_finetune "https://github.com/gfyddha/flylora/blob/main/finetune.py"
click node_evaluate "https://github.com/gfyddha/flylora/blob/main/evaluate.py"
click node_merge "https://github.com/gfyddha/flylora/blob/main/merge_lora_adapters.py"
click node_minimal "https://github.com/gfyddha/flylora/blob/main/flylora.py"
click node_peft_model "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/peft_model.py"
click node_config "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/config.py"
click node_mapping "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/mapping.py"
click node_lora_model "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/tuners/lora/model.py"
click node_lora_layer "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/tuners/lora/layer.py"
click node_other_tuners "https://github.com/gfyddha/flylora/tree/main/peft/src/peft/tuners"
click node_adapter_io "https://github.com/gfyddha/flylora/blob/main/peft/src/peft/utils/save_and_load.py"
click node_comparison "https://github.com/gfyddha/flylora/blob/main/peft/method_comparison/app.py"
click node_comparison_data "https://github.com/gfyddha/flylora/blob/main/peft/method_comparison/processing.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_finetune,node_evaluate,node_merge,node_minimal toneBlue
class node_peft_model,node_config,node_mapping,node_lora_model,node_lora_layer,node_other_tuners,node_adapter_io toneAmber
class node_comparison,node_comparison_data toneMint
class node_user,node_base_model toneIndigo
```

## Components

### FlyLoRA workflow

- [Fine-tune](https://github.com/gfyddha/flylora/blob/main/finetune.py): `finetune.py`
- [Evaluate](https://github.com/gfyddha/flylora/blob/main/evaluate.py): `evaluate.py`
- [Merge adapters](https://github.com/gfyddha/flylora/blob/main/merge_lora_adapters.py): `merge_lora_adapters.py`
- [Minimal FlyLoRA](https://github.com/gfyddha/flylora/blob/main/flylora.py): `flylora.py`

### PEFT runtime

- [PEFT model](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/peft_model.py): `peft/src/peft/peft_model.py`
- [Adapter config](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/config.py): `peft/src/peft/config.py`
- [Tuner mapping](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/mapping.py): `peft/src/peft/mapping.py`
- [LoRA tuner](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/tuners/lora/model.py): `peft/src/peft/tuners/lora/model.py`
- [LoRA layers](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/tuners/lora/layer.py): `peft/src/peft/tuners/lora/layer.py`
- [Other tuners](https://github.com/gfyddha/flylora/tree/main/peft/src/peft/tuners): `peft/src/peft/tuners`
- [Adapter persistence](https://github.com/gfyddha/flylora/blob/main/peft/src/peft/utils/save_and_load.py): `peft/src/peft/utils/save_and_load.py`

### Method comparison

- [Comparison app](https://github.com/gfyddha/flylora/blob/main/peft/method_comparison/app.py): `peft/method_comparison/app.py`
- [Comparison data](https://github.com/gfyddha/flylora/blob/main/peft/method_comparison/processing.py): `peft/method_comparison/processing.py`

### Other components

- **Researcher**
- **Foundation model**

## Connections

- Researcher → Fine-tune: runs training
- Researcher → Evaluate: runs evaluation
- Researcher → Merge adapters: runs merging
- Researcher → Minimal FlyLoRA: uses reference
- Fine-tune → PEFT model: trains with
- Evaluate → PEFT model: evaluates with
- Merge adapters → PEFT model: uses adapters
- PEFT model → Adapter config: uses config
- PEFT model → Tuner mapping: dispatches tuner
- Tuner mapping → LoRA tuner: selects LoRA
- LoRA tuner → LoRA layers: installs layers
- LoRA layers → Foundation model: adapts layers
- PEFT model → Adapter persistence: loads and saves
- Tuner mapping → Other tuners: selects alternatives
- Researcher → Comparison app: explores results
- Comparison app → Comparison data: uses processing
