# gloutchov/localagentbenchmark architecture

> Architecture diagram of the GitHub repository gloutchov/localagentbenchmark, 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/gloutchov/localagentbenchmark
- Repository: https://github.com/gloutchov/localagentbenchmark

## Overview

LocalAgent Benchmark is an offline benchmark for comparing Ollama models acting as coding agents through Pi. Users configure or discover models, select benchmark cases, execute isolated repetitions, grade and integrity-check outcomes, then inspect reports or the offline dashboard. The graph preserves the guided funnel, personal case authoring, thinking controls, OS sandboxing, metrics, exports, and dashboard capabilities documented in the README. Some links are documented capabilities rather than inspected call sites; these are marked dashed where implementation wiring was not shown.

Main entry points: [`src/localagent_bench/runner.py`](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/runner.py) (Run orchestration), [`src/localagent_bench/pi_adapter.py`](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/pi_adapter.py) (Pi adapter), [`src/localagent_bench/cli.py`](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/cli.py) (CLI), [`src/localagent_bench/guided.py`](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/guided.py) (Funnel orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_guided_ui["Guided GUI<br/>[guided_ui.py]"]
  node_guided["Funnel orchestration<br/>[guided.py]"]
end

subgraph group_setup["Configuration and cases"]
  node_config["Configuration<br/>[config.py]"]
  node_case_sdk["Case manifests<br/>[case_sdk.py]"]
  node_cases["Benchmark scenarios"]
end

subgraph group_execution["Benchmark execution"]
  node_runner["Run orchestration<br/>[runner.py]"]
  node_pi_adapter["Pi adapter<br/>[pi_adapter.py]"]
  node_sandbox["OS sandbox<br/>[sandbox.py]"]
  node_thinking["Thinking policy<br/>[thinking.py]"]
  node_ollama_client["Ollama client<br/>[ollama.py]"]
end

subgraph group_evaluation["Evaluation and reports"]
  node_grading["Task grading<br/>[grading.py]"]
  node_integrity["Integrity checks<br/>[integrity.py]"]
  node_metrics["System metrics<br/>[system_metrics.py]"]
  node_report["Reports and ranking<br/>[report.py]"]
  node_comparison["Run comparison<br/>[comparison.py]"]
end

subgraph group_results["Results interfaces"]
  node_dashboard_data["Privacy-bounded data<br/>[dashboard_data.py]"]
  node_local_dashboard["Local results app<br/>[dashboard_app.py]"]
  node_dashboard_ui["Offline dashboard UI<br/>[core.js]"]
end

node_user(("Benchmark user"))
node_pi["Pi agent runtime"]
node_ollama["Ollama service"]

node_user -->|"runs commands"| node_cli
node_user -->|"starts funnel"| node_guided_ui
node_cli -->|"loads settings"| node_config
node_cli -->|"starts runs"| node_runner
node_cli -->|"manages cases"| node_case_sdk
node_guided_ui -->|"dispatches funnel"| node_guided
node_guided_ui -->|"loads settings"| node_config
node_guided -->|"orchestrates runs"| node_runner
node_guided -->|"prepares results"| node_dashboard_data
node_config -->|"discovers cases"| node_case_sdk
node_case_sdk -->|"validates manifests"| node_cases
node_runner -->|"uses settings"| node_config
node_runner -->|"loads case specs"| node_case_sdk
node_runner -->|"runs agent"| node_pi_adapter
node_runner -->|"grades outcomes"| node_grading
node_runner -->|"checks integrity"| node_integrity
node_runner -->|"writes reports"| node_report
node_runner -->|"warms models"| node_ollama_client
node_runner -->|"selects isolation"| node_sandbox
node_runner -->|"sets policy"| node_thinking
node_pi_adapter -->|"builds launch"| node_sandbox
node_pi_adapter -->|"collects metrics"| node_metrics
node_pi_adapter -->|"applies policy"| node_thinking
node_pi_adapter -.->|"invokes runtime"| node_pi
node_pi -.->|"queries models"| node_ollama
node_report -.->|"supports comparisons"| node_comparison
node_report -.->|"exports run data"| node_dashboard_data
node_user -->|"opens results"| node_local_dashboard
node_local_dashboard -->|"loads run data"| node_dashboard_data
node_dashboard_data -.->|"supplies dashboard"| node_dashboard_ui
node_guided -.->|"discovers models"| node_ollama_client

click node_cli "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/cli.py"
click node_guided_ui "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/guided_ui.py"
click node_guided "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/guided.py"
click node_config "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/config.py"
click node_case_sdk "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/case_sdk.py"
click node_cases "https://github.com/gloutchov/localagentbenchmark/tree/main/cases"
click node_runner "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/runner.py"
click node_pi_adapter "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/pi_adapter.py"
click node_sandbox "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/sandbox.py"
click node_thinking "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/thinking.py"
click node_ollama_client "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/ollama.py"
click node_grading "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/grading.py"
click node_integrity "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/integrity.py"
click node_metrics "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/system_metrics.py"
click node_report "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/report.py"
click node_comparison "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/comparison.py"
click node_dashboard_data "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/dashboard_data.py"
click node_local_dashboard "https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/dashboard_app.py"
click node_dashboard_ui "https://github.com/gloutchov/localagentbenchmark/blob/main/dashboard/js/core.js"

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_cli,node_guided_ui,node_guided,node_user toneBlue
class node_config,node_case_sdk,node_cases toneAmber
class node_runner,node_pi_adapter,node_sandbox,node_thinking,node_ollama_client toneMint
class node_grading,node_integrity,node_metrics,node_report,node_comparison toneRose
class node_dashboard_data,node_local_dashboard,node_dashboard_ui,node_pi,node_ollama toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/cli.py): `src/localagent_bench/cli.py`
- [Guided GUI](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/guided_ui.py): `src/localagent_bench/guided_ui.py`
- [Funnel orchestration](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/guided.py): `src/localagent_bench/guided.py`

### Configuration and cases

- [Configuration](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/config.py): `src/localagent_bench/config.py`
- [Case manifests](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/case_sdk.py): `src/localagent_bench/case_sdk.py`
- [Benchmark scenarios](https://github.com/gloutchov/localagentbenchmark/tree/main/cases): `cases`

### Benchmark execution

- [Run orchestration](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/runner.py): `src/localagent_bench/runner.py`
- [Pi adapter](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/pi_adapter.py): `src/localagent_bench/pi_adapter.py`
- [OS sandbox](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/sandbox.py): `src/localagent_bench/sandbox.py`
- [Thinking policy](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/thinking.py): `src/localagent_bench/thinking.py`
- [Ollama client](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/ollama.py): `src/localagent_bench/ollama.py`

### Evaluation and reports

- [Task grading](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/grading.py): `src/localagent_bench/grading.py`
- [Integrity checks](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/integrity.py): `src/localagent_bench/integrity.py`
- [System metrics](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/system_metrics.py): `src/localagent_bench/system_metrics.py`
- [Reports and ranking](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/report.py): `src/localagent_bench/report.py`
- [Run comparison](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/comparison.py): `src/localagent_bench/comparison.py`

### Results interfaces

- [Privacy-bounded data](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/dashboard_data.py): `src/localagent_bench/dashboard_data.py`
- [Local results app](https://github.com/gloutchov/localagentbenchmark/blob/main/src/localagent_bench/dashboard_app.py): `src/localagent_bench/dashboard_app.py`
- [Offline dashboard UI](https://github.com/gloutchov/localagentbenchmark/blob/main/dashboard/js/core.js): `dashboard/js/core.js`

### Other components

- **Benchmark user**
- **Pi agent runtime**
- **Ollama service**

## Connections

- Benchmark user → CLI: runs commands (evidence: `README.md`)
- Benchmark user → Guided GUI: starts funnel (evidence: `README.md`)
- CLI → Configuration: loads settings (evidence: `src/localagent_bench/cli.py`)
- CLI → Run orchestration: starts runs (evidence: `src/localagent_bench/cli.py`)
- CLI → Case manifests: manages cases (evidence: `src/localagent_bench/cli.py`)
- Guided GUI → Funnel orchestration: dispatches funnel (evidence: `src/localagent_bench/guided_ui.py`)
- Guided GUI → Configuration: loads settings (evidence: `src/localagent_bench/guided_ui.py`)
- Funnel orchestration → Run orchestration: orchestrates runs (evidence: `src/localagent_bench/guided.py`)
- Funnel orchestration → Privacy-bounded data: prepares results (evidence: `src/localagent_bench/guided.py`)
- Configuration → Case manifests: discovers cases (evidence: `src/localagent_bench/config.py`)
- Case manifests → Benchmark scenarios: validates manifests (evidence: `src/localagent_bench/case_sdk.py`)
- Run orchestration → Configuration: uses settings (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Case manifests: loads case specs (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Pi adapter: runs agent (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Task grading: grades outcomes (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Integrity checks: checks integrity (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Reports and ranking: writes reports (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Ollama client: warms models (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → OS sandbox: selects isolation (evidence: `src/localagent_bench/runner.py`)
- Run orchestration → Thinking policy: sets policy (evidence: `src/localagent_bench/runner.py`)
- Pi adapter → OS sandbox: builds launch (evidence: `src/localagent_bench/pi_adapter.py`)
- Pi adapter → System metrics: collects metrics (evidence: `src/localagent_bench/pi_adapter.py`)
- Pi adapter → Thinking policy: applies policy (evidence: `src/localagent_bench/pi_adapter.py`)
- Pi adapter → Pi agent runtime: invokes runtime
- Pi agent runtime → Ollama service: queries models (evidence: `README.md`)
- Reports and ranking → Run comparison: supports comparisons
- Reports and ranking → Privacy-bounded data: exports run data (evidence: `README.md`)
- Benchmark user → Local results app: opens results (evidence: `README.md`)
- Local results app → Privacy-bounded data: loads run data (evidence: `src/localagent_bench/dashboard_app.py`)
- Privacy-bounded data → Offline dashboard UI: supplies dashboard (evidence: `README.md`)
- Funnel orchestration → Ollama client: discovers models (evidence: `README.md`)
