# dheeraj1918/llm-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/dheeraj1918/llm-analyzer
- Repository: https://github.com/dheeraj1918/llm-analyzer

## Overview

LLM-Analyzer is a provider-agnostic Python library and local observability dashboard. An application captures a response directly or wraps a synchronous/asynchronous LLM call; the analyzer measures latency, extracts available metadata, records successes or errors, and can optionally evaluate responses using supplied evidence or a custom evaluator. Captures and evaluation results are stored in temporary SQLite, then served through dashboard APIs and a browser UI, with CSV export. The CLI starts the dashboard or reports the database path. The workflow is supported by sampled core, extraction, evaluation, storage, and dashboard code; other README capabilities are represented only where their module path or documentation supports them.

Main entry points: [`llm_analyzer/core.py`](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/core.py) (Capture orchestration), [`llm_analyzer/dashboard/server.py`](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/dashboard/server.py) (Dashboard server), [`llm_analyzer/storage.py`](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/storage.py) (SQLite telemetry store), [`llm_analyzer/cli.py`](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/cli.py) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and evaluation"]
  node_analyzer_core["Capture orchestration<br/>[core.py]"]
  node_metadata["Metadata extraction<br/>[extractor.py]"]
  node_evaluation["Response evaluation<br/>[evaluation.py]"]
end

subgraph group_storage["Local persistence"]
  node_sqlite_store[("SQLite telemetry store<br/>[storage.py]")]
end

subgraph group_dashboard["Dashboard and export"]
  node_dashboard_server["Dashboard server<br/>[server.py]"]
  node_dashboard_ui["Dashboard UI<br/>[ui.py]"]
end

subgraph group_access["Library and CLI"]
  node_analyzer_api["Analyzer API<br/>[__init__.py]"]
  node_cli["CLI commands<br/>[cli.py]"]
end

node_application(("Application"))
node_llm_provider(("LLM provider"))
node_browser_user(("Dashboard user"))

node_application -->|"calls"| node_analyzer_api
node_analyzer_api -->|"delegates"| node_analyzer_core
node_analyzer_core -->|"invokes callback"| node_llm_provider
node_analyzer_core -->|"extracts metadata"| node_metadata
node_analyzer_core -->|"writes captures"| node_sqlite_store
node_analyzer_core -.->|"optionally evaluates"| node_evaluation
node_evaluation -->|"records scores"| node_sqlite_store
node_analyzer_core -.->|"starts dashboard"| node_dashboard_server
node_cli -->|"creates analyzer"| node_analyzer_core
node_cli -->|"starts server"| node_dashboard_server
node_dashboard_server -->|"queries and exports"| node_sqlite_store
node_dashboard_server -->|"serves HTML"| node_dashboard_ui
node_browser_user -->|"requests views"| node_dashboard_server

click node_analyzer_api "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/__init__.py"
click node_analyzer_core "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/core.py"
click node_metadata "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/extractor.py"
click node_evaluation "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/evaluation.py"
click node_sqlite_store "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/storage.py"
click node_cli "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/cli.py"
click node_dashboard_server "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/dashboard/server.py"
click node_dashboard_ui "https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/dashboard/ui.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_analyzer_core,node_metadata,node_evaluation,node_browser_user toneBlue
class node_sqlite_store toneAmber
class node_dashboard_server,node_dashboard_ui toneMint
class node_analyzer_api,node_cli toneRose
class node_application,node_llm_provider toneIndigo
```

## Components

### Capture and evaluation

- [Capture orchestration](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/core.py): `llm_analyzer/core.py`
- [Metadata extraction](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/extractor.py): `llm_analyzer/extractor.py`
- [Response evaluation](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/evaluation.py): `llm_analyzer/evaluation.py`

### Local persistence

- [SQLite telemetry store](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/storage.py): `llm_analyzer/storage.py`

### Dashboard and export

- [Dashboard server](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/dashboard/server.py): `llm_analyzer/dashboard/server.py`
- [Dashboard UI](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/dashboard/ui.py): `llm_analyzer/dashboard/ui.py`

### Library and CLI

- [Analyzer API](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/__init__.py): `llm_analyzer/__init__.py`
- [CLI commands](https://github.com/dheeraj1918/llm-analyzer/blob/main/llm_analyzer/cli.py): `llm_analyzer/cli.py`

### Other components

- **Application**
- **LLM provider**
- **Dashboard user**

## Connections

- Application → Analyzer API: calls
- Analyzer API → Capture orchestration: delegates
- Capture orchestration → LLM provider: invokes callback
- Capture orchestration → Metadata extraction: extracts metadata
- Capture orchestration → SQLite telemetry store: writes captures
- Capture orchestration → Response evaluation: optionally evaluates
- Response evaluation → SQLite telemetry store: records scores
- Capture orchestration → Dashboard server: starts dashboard
- CLI commands → Capture orchestration: creates analyzer
- CLI commands → Dashboard server: starts server
- Dashboard server → SQLite telemetry store: queries and exports
- Dashboard server → Dashboard UI: serves HTML
- Dashboard user → Dashboard server: requests views
