# kadirefeyazili/setpoint architecture

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

- Interactive diagram: https://gitdiagram.com/kadirefeyazili/setpoint
- Repository: https://github.com/kadirefeyazili/setpoint

## Overview

Setpoint is a local-inference configuration tool: its main workflow inspects a model and machine, estimates a feasible configuration, benchmarks candidates, and stores reliable results as hardware/model-specific profiles. Those profiles then inform serving, routing, exports, and regression checks. The README documents several additional command capabilities whose implementation details were not sampled; those branches are included without inferring internal call chains. Source-level links are limited to relationships shown in the index or excerpts.

Main entry points: [`src/setpoint/cli.py`](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/cli.py) (CLI commands), [`src/setpoint/panel/data.py`](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/panel/data.py) (Panel data), [`src/setpoint/hardware/__init__.py`](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/hardware/__init__.py) (Hardware probe), [`src/setpoint/profile/store.py`](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/profile/store.py) (Profile store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command interface"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_analysis["Model and hardware analysis"]
  node_modelresolve["Model resolution<br/>[index.py]"]
  node_gguf["GGUF analysis<br/>[analyze.py]"]
  node_hardware["Hardware probe<br/>[__init__.py]"]
  node_budget["VRAM budget<br/>[planner.py]"]
  node_doctor["System diagnosis<br/>[checks.py]"]
end

subgraph group_calibration["Measurement and profiles"]
  node_tuning["Tuning search<br/>[search.py]"]
  node_measurement["Benchmark execution<br/>[measure.py]"]
  node_backend["llama.cpp adapter<br/>[llamacpp.py]"]
  node_signature["Profile signature<br/>[signature.py]"]
  node_profiles[("Profile store<br/>[store.py]")]
end

subgraph group_runtime["Inference decisions"]
  node_serve["Configured server<br/>[serve.py]"]
  node_chat["Chat client<br/>[chat.py]"]
  node_routing["Model choice<br/>[route.py]"]
  node_export["Runner export<br/>[llamaswap.py]"]
end

subgraph group_insight["Monitoring and tools"]
  node_sentinel["Regression watch<br/>[sentinel.py]"]
  node_monitor["Live monitoring<br/>[monitor.py]"]
  node_paneldata["Panel data<br/>[data.py]"]
  node_panel["Interactive panel<br/>[app.py]"]
  node_quant["Quant comparison<br/>[quant.py]"]
  node_speculate["Speculation tests<br/>[speculate.py]"]
  node_chunk["Chunking benchmark<br/>[measure.py]"]
end

node_user(("Operator"))

node_user -->|"invokes"| node_cli
node_cli -->|"resolves model"| node_modelresolve
node_modelresolve -->|"analyzes model"| node_gguf
node_cli -->|"probes machine"| node_hardware
node_cli -->|"requests budget"| node_budget
node_budget -->|"uses model data"| node_gguf
node_budget -->|"uses snapshot"| node_hardware
node_cli -->|"runs checks"| node_doctor
node_cli -->|"starts tuning"| node_tuning
node_tuning -->|"searches candidates"| node_measurement
node_measurement -->|"runs benchmarks"| node_backend
node_measurement -->|"reads hardware"| node_hardware
node_cli -->|"loads and saves"| node_profiles
node_signature -->|"digests model"| node_gguf
node_signature -->|"signs machine"| node_hardware
node_cli -->|"starts configured server"| node_serve
node_serve -->|"builds server arguments"| node_backend
node_cli -->|"opens chat"| node_chat
node_chat -.->|"requests inference"| node_serve
node_cli -->|"chooses model"| node_routing
node_routing -->|"reads measured profiles"| node_profiles
node_cli -->|"exports runner config"| node_export
node_export -->|"formats profiles"| node_profiles
node_cli -->|"checks regressions"| node_sentinel
node_sentinel -->|"uses stored evidence"| node_profiles
node_cli -->|"shows live state"| node_monitor
node_cli -->|"compares quantizations"| node_quant
node_cli -->|"tests speculation"| node_speculate
node_cli -->|"measures chunking"| node_chunk
node_panel -->|"gathers views"| node_paneldata
node_paneldata -->|"reads budget"| node_budget
node_paneldata -->|"reads profiles"| node_profiles
node_paneldata -->|"reads switch costs"| node_routing
node_paneldata -->|"reads history"| node_sentinel
node_paneldata -->|"reads card state"| node_hardware
node_panel -->|"starts chat server"| node_serve
node_panel -->|"maintains conversation"| node_chat

click node_cli "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/cli.py"
click node_modelresolve "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/model/index.py"
click node_gguf "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/model/analyze.py"
click node_hardware "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/hardware/__init__.py"
click node_budget "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/budget/planner.py"
click node_doctor "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/doctor/checks.py"
click node_tuning "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/tune/search.py"
click node_measurement "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/tune/measure.py"
click node_backend "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/backend/llamacpp.py"
click node_signature "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/profile/signature.py"
click node_profiles "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/profile/store.py"
click node_serve "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/serve.py"
click node_chat "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/chat.py"
click node_routing "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/route.py"
click node_export "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/export/llamaswap.py"
click node_sentinel "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/sentinel.py"
click node_monitor "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/monitor.py"
click node_paneldata "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/panel/data.py"
click node_panel "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/panel/app.py"
click node_quant "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/quant.py"
click node_speculate "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/speculate.py"
click node_chunk "https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/chunk/measure.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_cli toneBlue
class node_modelresolve,node_gguf,node_hardware,node_budget,node_doctor toneAmber
class node_tuning,node_measurement,node_backend,node_signature,node_profiles toneMint
class node_serve,node_chat,node_routing,node_export toneRose
class node_sentinel,node_monitor,node_paneldata,node_panel,node_quant,node_speculate,node_chunk,node_user toneIndigo
```

## Components

### Command interface

- [CLI commands](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/cli.py): `src/setpoint/cli.py`

### Model and hardware analysis

- [Model resolution](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/model/index.py): `src/setpoint/model/index.py`
- [GGUF analysis](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/model/analyze.py): `src/setpoint/model/analyze.py`
- [Hardware probe](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/hardware/__init__.py): `src/setpoint/hardware/__init__.py`
- [VRAM budget](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/budget/planner.py): `src/setpoint/budget/planner.py`
- [System diagnosis](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/doctor/checks.py): `src/setpoint/doctor/checks.py`

### Measurement and profiles

- [Tuning search](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/tune/search.py): `src/setpoint/tune/search.py`
- [Benchmark execution](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/tune/measure.py): `src/setpoint/tune/measure.py`
- [llama.cpp adapter](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/backend/llamacpp.py): `src/setpoint/backend/llamacpp.py`
- [Profile signature](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/profile/signature.py): `src/setpoint/profile/signature.py`
- [Profile store](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/profile/store.py): `src/setpoint/profile/store.py`

### Inference decisions

- [Configured server](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/serve.py): `src/setpoint/serve.py`
- [Chat client](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/chat.py): `src/setpoint/chat.py`
- [Model choice](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/route.py): `src/setpoint/route.py`
- [Runner export](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/export/llamaswap.py): `src/setpoint/export/llamaswap.py`

### Monitoring and tools

- [Regression watch](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/sentinel.py): `src/setpoint/sentinel.py`
- [Live monitoring](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/monitor.py): `src/setpoint/monitor.py`
- [Panel data](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/panel/data.py): `src/setpoint/panel/data.py`
- [Interactive panel](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/panel/app.py): `src/setpoint/panel/app.py`
- [Quant comparison](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/quant.py): `src/setpoint/quant.py`
- [Speculation tests](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/speculate.py): `src/setpoint/speculate.py`
- [Chunking benchmark](https://github.com/kadirefeyazili/setpoint/blob/main/src/setpoint/chunk/measure.py): `src/setpoint/chunk/measure.py`

### Other components

- **Operator**

## Connections

- Operator → CLI commands: invokes
- CLI commands → Model resolution: resolves model (evidence: `src/setpoint/cli.py`)
- Model resolution → GGUF analysis: analyzes model (evidence: `src/setpoint/model/__init__.py`)
- CLI commands → Hardware probe: probes machine (evidence: `src/setpoint/cli.py`)
- CLI commands → VRAM budget: requests budget (evidence: `src/setpoint/cli.py`)
- VRAM budget → GGUF analysis: uses model data (evidence: `src/setpoint/budget/planner.py`)
- VRAM budget → Hardware probe: uses snapshot
- CLI commands → System diagnosis: runs checks (evidence: `src/setpoint/cli.py`)
- CLI commands → Tuning search: starts tuning (evidence: `src/setpoint/cli.py`)
- Tuning search → Benchmark execution: searches candidates (evidence: `src/setpoint/tune/search.py`)
- Benchmark execution → llama.cpp adapter: runs benchmarks (evidence: `src/setpoint/tune/measure.py`)
- Benchmark execution → Hardware probe: reads hardware (evidence: `src/setpoint/tune/measure.py`)
- CLI commands → Profile store: loads and saves (evidence: `src/setpoint/cli.py`)
- Profile signature → GGUF analysis: digests model (evidence: `src/setpoint/profile/signature.py`)
- Profile signature → Hardware probe: signs machine (evidence: `src/setpoint/profile/signature.py`)
- CLI commands → Configured server: starts configured server (evidence: `src/setpoint/cli.py`)
- Configured server → llama.cpp adapter: builds server arguments (evidence: `src/setpoint/serve.py`)
- CLI commands → Chat client: opens chat (evidence: `src/setpoint/cli.py`)
- Chat client → Configured server: requests inference
- CLI commands → Model choice: chooses model (evidence: `src/setpoint/cli.py`)
- Model choice → Profile store: reads measured profiles (evidence: `src/setpoint/route.py`)
- CLI commands → Runner export: exports runner config
- Runner export → Profile store: formats profiles (evidence: `src/setpoint/export/llamaswap.py`)
- CLI commands → Regression watch: checks regressions (evidence: `src/setpoint/cli.py`)
- Regression watch → Profile store: uses stored evidence (evidence: `src/setpoint/sentinel.py`)
- CLI commands → Live monitoring: shows live state (evidence: `src/setpoint/cli.py`)
- CLI commands → Quant comparison: compares quantizations (evidence: `src/setpoint/cli.py`)
- CLI commands → Speculation tests: tests speculation (evidence: `src/setpoint/cli.py`)
- CLI commands → Chunking benchmark: measures chunking
- Interactive panel → Panel data: gathers views (evidence: `src/setpoint/panel/app.py`)
- Panel data → VRAM budget: reads budget (evidence: `src/setpoint/panel/data.py`)
- Panel data → Profile store: reads profiles (evidence: `src/setpoint/panel/data.py`)
- Panel data → Model choice: reads switch costs (evidence: `src/setpoint/panel/data.py`)
- Panel data → Regression watch: reads history (evidence: `src/setpoint/panel/data.py`)
- Panel data → Hardware probe: reads card state (evidence: `src/setpoint/panel/data.py`)
- Interactive panel → Configured server: starts chat server (evidence: `src/setpoint/panel/app.py`)
- Interactive panel → Chat client: maintains conversation (evidence: `src/setpoint/panel/app.py`)
