# janardhans56/waths architecture

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

- Interactive diagram: https://gitdiagram.com/janardhans56/waths
- Repository: https://github.com/janardhans56/waths

## Overview

Waths Arena is a browser-based LLM evaluation workbench. In dialogue mode, an operator starts a topic-based match; the client alternates model turns, presents outputs for human scoring, and ends on round limits or mathematical concession. Roleplay adds persona and scene setup through an Arena Master briefing before turns begin. Settings customize model parameters and persist locally. The graph separates these product stages and the Flask/model-call layer; provider links and capabilities not visible in sampled calls are attributed to the README rather than inferred from filenames.

Main entry points: [`static/app.js`](https://github.com/janardhans56/waths/blob/main/static/app.js) (Dialogue Match UI), [`static/roleplay.js`](https://github.com/janardhans56/waths/blob/main/static/roleplay.js) (Roleplay Match UI), [`static/settings.js`](https://github.com/janardhans56/waths/blob/main/static/settings.js) (Model Settings), [`server.py`](https://github.com/janardhans56/waths/blob/main/server.py) (Model Runners)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dialogue["Dialogue Arena"]
  node_dialogue_ui["Dialogue Match UI<br/>[app.js]"]
  node_dialogue_scoring["Human Scoring<br/>[app.js]"]
end

subgraph group_roleplay["Roleplay Arena"]
  node_roleplay_ui["Roleplay Match UI<br/>[roleplay.js]"]
  node_persona_brief["Persona Briefing<br/>[roleplay.js]"]
end

subgraph group_engine["Arena Engine"]
  node_flask_api["Flask API<br/>[server.py]"]
  node_bot_turn["Bot Turn Handler<br/>[server.py]"]
  node_model_runners["Model Runners<br/>[server.py]"]
  node_arena_master["Arena Master<br/>[server.py]"]
end

subgraph group_config["Runtime Settings"]
  node_settings["Model Settings<br/>[settings.js]"]
  node_browser_storage[("Local Settings")]
end

node_operator(("Operator"))
node_nvidia{{"NVIDIA NIM"}}
node_openrouter{{"OpenRouter"}}
node_groq{{"Groq"}}

node_operator -->|"starts match"| node_dialogue_ui
node_operator -->|"sets personas"| node_roleplay_ui
node_dialogue_ui -->|"requests ratings"| node_dialogue_scoring
node_dialogue_ui -->|"requests turns"| node_bot_turn
node_roleplay_ui -->|"requests brief"| node_persona_brief
node_persona_brief -->|"requests briefing"| node_arena_master
node_roleplay_ui -->|"requests turns"| node_bot_turn
node_bot_turn -->|"dispatches to"| node_model_runners
node_model_runners -.->|"calls model"| node_nvidia
node_model_runners -.->|"calls model"| node_openrouter
node_arena_master -.->|"generates brief"| node_groq
node_settings -->|"reads and writes"| node_browser_storage
node_settings -->|"announces updates"| node_dialogue_ui
node_settings -.->|"announces updates"| node_roleplay_ui

click node_dialogue_ui "https://github.com/janardhans56/waths/blob/main/static/app.js"
click node_dialogue_scoring "https://github.com/janardhans56/waths/blob/main/static/app.js"
click node_roleplay_ui "https://github.com/janardhans56/waths/blob/main/static/roleplay.js"
click node_persona_brief "https://github.com/janardhans56/waths/blob/main/static/roleplay.js"
click node_settings "https://github.com/janardhans56/waths/blob/main/static/settings.js"
click node_flask_api "https://github.com/janardhans56/waths/blob/main/server.py"
click node_bot_turn "https://github.com/janardhans56/waths/blob/main/server.py"
click node_model_runners "https://github.com/janardhans56/waths/blob/main/server.py"
click node_arena_master "https://github.com/janardhans56/waths/blob/main/server.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_dialogue_ui,node_dialogue_scoring toneBlue
class node_roleplay_ui,node_persona_brief toneAmber
class node_flask_api,node_bot_turn,node_model_runners,node_arena_master,node_openrouter toneMint
class node_settings,node_browser_storage toneRose
class node_operator,node_nvidia,node_groq toneIndigo
```

## Components

### Dialogue Arena

- [Dialogue Match UI](https://github.com/janardhans56/waths/blob/main/static/app.js): `static/app.js`
- [Human Scoring](https://github.com/janardhans56/waths/blob/main/static/app.js): `static/app.js`

### Roleplay Arena

- [Roleplay Match UI](https://github.com/janardhans56/waths/blob/main/static/roleplay.js): `static/roleplay.js`
- [Persona Briefing](https://github.com/janardhans56/waths/blob/main/static/roleplay.js): `static/roleplay.js`

### Arena Engine

- [Flask API](https://github.com/janardhans56/waths/blob/main/server.py): `server.py`
- [Bot Turn Handler](https://github.com/janardhans56/waths/blob/main/server.py): `server.py`
- [Model Runners](https://github.com/janardhans56/waths/blob/main/server.py): `server.py`
- [Arena Master](https://github.com/janardhans56/waths/blob/main/server.py): `server.py`

### Runtime Settings

- [Model Settings](https://github.com/janardhans56/waths/blob/main/static/settings.js): `static/settings.js`
- **Local Settings**

### Other components

- **Operator**
- **NVIDIA NIM**
- **OpenRouter**
- **Groq**

## Connections

- Operator → Dialogue Match UI: starts match (evidence: `README.md`)
- Operator → Roleplay Match UI: sets personas (evidence: `README.md`)
- Dialogue Match UI → Human Scoring: requests ratings (evidence: `static/app.js`)
- Dialogue Match UI → Bot Turn Handler: requests turns (evidence: `static/app.js`)
- Roleplay Match UI → Persona Briefing: requests brief (evidence: `static/roleplay.js`)
- Persona Briefing → Arena Master: requests briefing (evidence: `static/roleplay.js`)
- Roleplay Match UI → Bot Turn Handler: requests turns (evidence: `static/roleplay.js`)
- Bot Turn Handler → Model Runners: dispatches to (evidence: `server.py`)
- Model Runners → NVIDIA NIM: calls model (evidence: `README.md`)
- Model Runners → OpenRouter: calls model (evidence: `README.md`)
- Arena Master → Groq: generates brief (evidence: `README.md`)
- Model Settings → Local Settings: reads and writes (evidence: `static/settings.js`)
- Model Settings → Dialogue Match UI: announces updates (evidence: `static/app.js`)
- Model Settings → Roleplay Match UI: announces updates
