# juctxy/debate architecture

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

- Interactive diagram: https://gitdiagram.com/juctxy/debate
- Repository: https://github.com/juctxy/debate

## Overview

This repository contains a Gradio debate-argument evaluator backed by a feature-based classifier, plus a separate TinyLlama fine-tuning and inference workflow. The main user path is entering debate arguments in the app and receiving an evaluation; the sampled excerpts show the interface and analyzer, but not the complete callback-to-result path, so that connection is omitted. The training script prepares debate prompts, fine-tunes a model, and demonstrates text generation. Some runtime details and connections to the included model assets are not shown.

Main entry points: [`full_step.py`](https://github.com/juctxy/debate/blob/main/full_step.py) (Prompt preparation), [`TinyLlama-1.1B-chat-finetuned-debate/adapter_config.json`](https://github.com/juctxy/debate/blob/main/TinyLlama-1.1B-chat-finetuned-debate/adapter_config.json) (TinyLlama adapter), [`app.py`](https://github.com/juctxy/debate/blob/main/app.py) (Argument analyzer), [`debate_2/model.joblib`](https://github.com/juctxy/debate/blob/main/debate_2/model.joblib) (Classifier assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Debate evaluator"]
  node_gradio["Debate interface<br/>[app.py]"]
  node_analyzer["Argument analyzer<br/>[app.py]"]
  node_classifier["Winner classifier<br/>[app.py]"]
end

subgraph group_training["LLM workflow"]
  node_debate_data["Debate dataset"]
  node_prompt_prep["Prompt preparation<br/>[full_step.py]"]
  node_finetuning["Model fine-tuning<br/>[full_step.py]"]
  node_llm_inference["Text generation<br/>[full_step.py]"]
end

subgraph group_assets["Model assets"]
  node_joblib_assets[("Classifier assets<br/>[model.joblib]")]
  node_tinyllama_assets[("TinyLlama adapter")]
end

node_debater(("Debater"))

node_debater -.->|"enters arguments"| node_gradio
node_prompt_prep -->|"reads CSV"| node_debate_data
node_prompt_prep -->|"provides dataset"| node_finetuning
node_finetuning -->|"saves adapter"| node_tinyllama_assets
node_llm_inference -.->|"loads adapter"| node_tinyllama_assets
node_analyzer -->|"loads components"| node_joblib_assets

click node_gradio "https://github.com/juctxy/debate/blob/main/app.py"
click node_analyzer "https://github.com/juctxy/debate/blob/main/app.py"
click node_classifier "https://github.com/juctxy/debate/blob/main/app.py"
click node_joblib_assets "https://github.com/juctxy/debate/blob/main/debate_2/model.joblib"
click node_prompt_prep "https://github.com/juctxy/debate/blob/main/full_step.py"
click node_finetuning "https://github.com/juctxy/debate/blob/main/full_step.py"
click node_llm_inference "https://github.com/juctxy/debate/blob/main/full_step.py"
click node_tinyllama_assets "https://github.com/juctxy/debate/blob/main/TinyLlama-1.1B-chat-finetuned-debate/adapter_config.json"

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_gradio,node_analyzer,node_classifier toneBlue
class node_debate_data,node_prompt_prep,node_finetuning,node_llm_inference toneAmber
class node_joblib_assets,node_tinyllama_assets toneMint
class node_debater toneIndigo
```

## Components

### Debate evaluator

- [Debate interface](https://github.com/juctxy/debate/blob/main/app.py): `app.py`
- [Argument analyzer](https://github.com/juctxy/debate/blob/main/app.py): `app.py`
- [Winner classifier](https://github.com/juctxy/debate/blob/main/app.py): `app.py`

### LLM workflow

- **Debate dataset**
- [Prompt preparation](https://github.com/juctxy/debate/blob/main/full_step.py): `full_step.py`
- [Model fine-tuning](https://github.com/juctxy/debate/blob/main/full_step.py): `full_step.py`
- [Text generation](https://github.com/juctxy/debate/blob/main/full_step.py): `full_step.py`

### Model assets

- [Classifier assets](https://github.com/juctxy/debate/blob/main/debate_2/model.joblib): `debate_2/model.joblib`
- [TinyLlama adapter](https://github.com/juctxy/debate/blob/main/TinyLlama-1.1B-chat-finetuned-debate/adapter_config.json): `TinyLlama-1.1B-chat-finetuned-debate/adapter_config.json`

### Other components

- **Debater**

## Connections

- Debater → Debate interface: enters arguments
- Prompt preparation → Debate dataset: reads CSV (evidence: `full_step.py`)
- Prompt preparation → Model fine-tuning: provides dataset (evidence: `full_step.py`)
- Model fine-tuning → TinyLlama adapter: saves adapter (evidence: `full_step.py`)
- Text generation → TinyLlama adapter: loads adapter
- Argument analyzer → Classifier assets: loads components (evidence: `app.py`)
