# kenmueller/supai-hle architecture

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

- Interactive diagram: https://gitdiagram.com/kenmueller/supai-hle
- Repository: https://github.com/kenmueller/supai-hle

## Overview

This repository is an evaluation harness for Sup AI on the Humanity’s Last Exam benchmark, rather than the Sup AI product implementation itself. The primary workflow loads benchmark questions, requests model responses, judges those responses, and computes accuracy and calibration metrics. The README describes broader Sup AI capabilities—including ensemble orchestration, confidence-weighted synthesis, retries, web search, and image/PDF preprocessing—but their implementation is outside this repository. The graph shows only the harness’s evidenced runtime and documented evaluation flow.

Main entry points: [`src/run_model.py`](https://github.com/kenmueller/supai-hle/blob/main/src/run_model.py) (Model runner), [`src/run_judge.py`](https://github.com/kenmueller/supai-hle/blob/main/src/run_judge.py) (Judge runner), [`src/run_metrics.py`](https://github.com/kenmueller/supai-hle/blob/main/src/run_metrics.py) (Metrics runner), [`hle_pro.json`](https://github.com/kenmueller/supai-hle/blob/main/hle_pro.json) (Predictions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Response generation"]
  node_model_runner["Model runner<br/>[run_model.py]"]
  node_predictions[("Predictions<br/>[hle_pro.json]")]
  node_traces[("Response traces")]
end

subgraph group_judging["Answer judging"]
  node_judge_runner["Judge runner<br/>[run_judge.py]"]
  node_judged_results[("Judged results")]
end

subgraph group_analysis["Metrics and results"]
  node_metrics_runner["Metrics runner<br/>[run_metrics.py]"]
  node_metrics_data[("Metrics summary<br/>[metrics.json]")]
  node_question_table["Question results<br/>[questions.md]"]
end

node_operator(("Evaluation operator"))
node_benchmark[("HLE dataset")]
node_supai{{"Sup AI API"}}
node_openai{{"OpenAI judge API"}}

node_operator -->|"runs evaluation"| node_model_runner
node_model_runner -->|"loads questions"| node_benchmark
node_model_runner -->|"requests responses"| node_supai
node_model_runner -->|"writes predictions"| node_predictions
node_model_runner -->|"writes chunks"| node_traces
node_operator -->|"runs judging"| node_judge_runner
node_judge_runner -->|"loads questions"| node_benchmark
node_judge_runner -->|"reads predictions"| node_predictions
node_judge_runner -->|"requests judgments"| node_openai
node_judge_runner -->|"saves judgments"| node_judged_results
node_operator -->|"runs analysis"| node_metrics_runner
node_metrics_runner -->|"reads judgments"| node_judged_results
node_metrics_runner -->|"writes metrics"| node_metrics_data
node_metrics_runner -->|"writes table"| node_question_table

click node_model_runner "https://github.com/kenmueller/supai-hle/blob/main/src/run_model.py"
click node_predictions "https://github.com/kenmueller/supai-hle/blob/main/hle_pro.json"
click node_traces "https://github.com/kenmueller/supai-hle/tree/main/traces"
click node_judge_runner "https://github.com/kenmueller/supai-hle/blob/main/src/run_judge.py"
click node_judged_results "https://github.com/kenmueller/supai-hle/blob/main/judged_hle_pro.json"
click node_metrics_runner "https://github.com/kenmueller/supai-hle/blob/main/src/run_metrics.py"
click node_metrics_data "https://github.com/kenmueller/supai-hle/blob/main/metrics.json"
click node_question_table "https://github.com/kenmueller/supai-hle/blob/main/questions.md"

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_model_runner,node_predictions,node_traces toneBlue
class node_judge_runner,node_judged_results,node_benchmark toneAmber
class node_metrics_runner,node_metrics_data,node_question_table,node_supai,node_openai toneMint
class node_operator toneIndigo
```

## Components

### Response generation

- [Model runner](https://github.com/kenmueller/supai-hle/blob/main/src/run_model.py): `src/run_model.py`
- [Predictions](https://github.com/kenmueller/supai-hle/blob/main/hle_pro.json): `hle_pro.json`
- [Response traces](https://github.com/kenmueller/supai-hle/tree/main/traces): `traces`

### Answer judging

- [Judge runner](https://github.com/kenmueller/supai-hle/blob/main/src/run_judge.py): `src/run_judge.py`
- [Judged results](https://github.com/kenmueller/supai-hle/blob/main/judged_hle_pro.json): `judged_hle_pro.json`

### Metrics and results

- [Metrics runner](https://github.com/kenmueller/supai-hle/blob/main/src/run_metrics.py): `src/run_metrics.py`
- [Metrics summary](https://github.com/kenmueller/supai-hle/blob/main/metrics.json): `metrics.json`
- [Question results](https://github.com/kenmueller/supai-hle/blob/main/questions.md): `questions.md`

### Other components

- **Evaluation operator**
- **HLE dataset**
- **Sup AI API**
- **OpenAI judge API**

## Connections

- Evaluation operator → Model runner: runs evaluation (evidence: `README.md`)
- Model runner → HLE dataset: loads questions (evidence: `src/run_model.py`)
- Model runner → Sup AI API: requests responses (evidence: `src/run_model.py`)
- Model runner → Predictions: writes predictions (evidence: `src/run_model.py`)
- Model runner → Response traces: writes chunks (evidence: `src/run_model.py`)
- Evaluation operator → Judge runner: runs judging (evidence: `README.md`)
- Judge runner → HLE dataset: loads questions (evidence: `src/run_judge.py`)
- Judge runner → Predictions: reads predictions (evidence: `src/run_judge.py`)
- Judge runner → OpenAI judge API: requests judgments (evidence: `src/run_judge.py`)
- Judge runner → Judged results: saves judgments (evidence: `src/run_judge.py`)
- Evaluation operator → Metrics runner: runs analysis (evidence: `README.md`)
- Metrics runner → Judged results: reads judgments (evidence: `src/run_metrics.py`)
- Metrics runner → Metrics summary: writes metrics (evidence: `src/run_metrics.py`)
- Metrics runner → Question results: writes table (evidence: `src/run_metrics.py`)
