# microsoft/obeaver architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/obeaver
- Repository: https://github.com/microsoft/obeaver

## Overview

oBeaver is a local-first LLM inference toolkit. Engineers configure local model storage, then use interactive CLI chat or send OpenAI-compatible HTTP requests; requests are handled by a selected chat engine and streamed or returned to the caller. Separate capabilities include embeddings for retrieval, tool calling for agent workflows, model conversion, and a browser dashboard with system-resource monitoring. The source index supports several internal call relationships; other capability links below rely on README documentation, since unsampled implementation details were not inspected.

Main entry points: [`obeaver/server.py`](https://github.com/microsoft/obeaver/blob/main/obeaver/server.py) (HTTP API), [`obeaver/cli.py`](https://github.com/microsoft/obeaver/blob/main/obeaver/cli.py) (CLI Commands), [`obeaver/chat.py`](https://github.com/microsoft/obeaver/blob/main/obeaver/chat.py) (Terminal Chat), [`obeaver/engine_ort.py`](https://github.com/microsoft/obeaver/blob/main/obeaver/engine_ort.py) (ORT Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_cli["CLI Commands<br/>[cli.py]"]
  node_chat["Terminal Chat<br/>[chat.py]"]
  node_api["HTTP API<br/>[server.py]"]
  node_dashboard["Web Dashboard<br/>[server.py]"]
end

subgraph group_runtime["Chat Inference"]
  node_ort["ORT Engine<br/>[engine_ort.py]"]
  node_foundry["Foundry Engine"]
end

subgraph group_capabilities["Model Capabilities"]
  node_tool_utils["Tool Calling<br/>[tools.py]"]
  node_embeddings["Embedding Engine"]
  node_conversion["Model Conversion<br/>[convert_vl.py]"]
end

subgraph group_operations["Configuration and Monitoring"]
  node_monitor["Resource Monitor<br/>[monitor.py]"]
  node_config[("Model Configuration<br/>[config.py]")]
end

node_engineer(("Developer"))
node_foundry_service{{"Foundry Local"}}
node_ort_runtime{{"ONNX Runtime GenAI"}}

node_engineer -->|"runs commands"| node_cli
node_engineer -->|"chats locally"| node_chat
node_engineer -->|"sends requests"| node_api
node_engineer -->|"opens dashboard"| node_dashboard
node_cli -->|"configures models"| node_config
node_cli -->|"starts chat"| node_chat
node_chat -->|"uses engine"| node_ort
node_chat -->|"uses engine"| node_foundry
node_api -->|"serves inference"| node_ort
node_api -->|"serves inference"| node_foundry
node_foundry -->|"requests generation"| node_foundry_service
node_ort -->|"runs generation"| node_ort_runtime
node_ort -->|"uses utilities"| node_tool_utils
node_foundry -->|"uses utilities"| node_tool_utils
node_api -->|"serves embeddings"| node_embeddings
node_cli -->|"runs conversion"| node_conversion
node_api -->|"reads metrics"| node_monitor
node_dashboard -->|"uses dashboard routes"| node_api
node_cli -->|"reads model paths"| node_config

click node_cli "https://github.com/microsoft/obeaver/blob/main/obeaver/cli.py"
click node_chat "https://github.com/microsoft/obeaver/blob/main/obeaver/chat.py"
click node_api "https://github.com/microsoft/obeaver/blob/main/obeaver/server.py"
click node_dashboard "https://github.com/microsoft/obeaver/blob/main/obeaver/server.py"
click node_ort "https://github.com/microsoft/obeaver/blob/main/obeaver/engine_ort.py"
click node_foundry "https://github.com/microsoft/obeaver/blob/main/obeaver/engine_foundrylocal.py"
click node_tool_utils "https://github.com/microsoft/obeaver/blob/main/obeaver/tools.py"
click node_embeddings "https://github.com/microsoft/obeaver/blob/main/obeaver/engine_embedding.py"
click node_conversion "https://github.com/microsoft/obeaver/blob/main/obeaver/convert_vl.py"
click node_monitor "https://github.com/microsoft/obeaver/blob/main/obeaver/monitor.py"
click node_config "https://github.com/microsoft/obeaver/blob/main/obeaver/config.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,node_chat,node_api,node_dashboard toneBlue
class node_ort,node_foundry toneAmber
class node_tool_utils,node_embeddings,node_conversion toneMint
class node_monitor,node_config toneRose
class node_engineer,node_foundry_service,node_ort_runtime toneIndigo
```

## Components

### User Interfaces

- [CLI Commands](https://github.com/microsoft/obeaver/blob/main/obeaver/cli.py): `obeaver/cli.py`
- [Terminal Chat](https://github.com/microsoft/obeaver/blob/main/obeaver/chat.py): `obeaver/chat.py`
- [HTTP API](https://github.com/microsoft/obeaver/blob/main/obeaver/server.py): `obeaver/server.py`
- [Web Dashboard](https://github.com/microsoft/obeaver/blob/main/obeaver/server.py): `obeaver/server.py`

### Chat Inference

- [ORT Engine](https://github.com/microsoft/obeaver/blob/main/obeaver/engine_ort.py): `obeaver/engine_ort.py`
- [Foundry Engine](https://github.com/microsoft/obeaver/blob/main/obeaver/engine_foundrylocal.py): `obeaver/engine_foundrylocal.py`

### Model Capabilities

- [Tool Calling](https://github.com/microsoft/obeaver/blob/main/obeaver/tools.py): `obeaver/tools.py`
- [Embedding Engine](https://github.com/microsoft/obeaver/blob/main/obeaver/engine_embedding.py): `obeaver/engine_embedding.py`
- [Model Conversion](https://github.com/microsoft/obeaver/blob/main/obeaver/convert_vl.py): `obeaver/convert_vl.py`

### Configuration and Monitoring

- [Resource Monitor](https://github.com/microsoft/obeaver/blob/main/obeaver/monitor.py): `obeaver/monitor.py`
- [Model Configuration](https://github.com/microsoft/obeaver/blob/main/obeaver/config.py): `obeaver/config.py`

### Other components

- **Developer**
- **Foundry Local**
- **ONNX Runtime GenAI**

## Connections

- Developer → CLI Commands: runs commands (evidence: `README.md`)
- Developer → Terminal Chat: chats locally (evidence: `README.md`)
- Developer → HTTP API: sends requests (evidence: `README.md`)
- Developer → Web Dashboard: opens dashboard (evidence: `README.md`)
- CLI Commands → Model Configuration: configures models (evidence: `obeaver/cli.py`)
- CLI Commands → Terminal Chat: starts chat (evidence: `obeaver/cli.py`)
- Terminal Chat → ORT Engine: uses engine (evidence: `obeaver/chat.py`)
- Terminal Chat → Foundry Engine: uses engine (evidence: `obeaver/chat.py`)
- HTTP API → ORT Engine: serves inference (evidence: `obeaver/server.py`)
- HTTP API → Foundry Engine: serves inference (evidence: `obeaver/server.py`)
- Foundry Engine → Foundry Local: requests generation (evidence: `obeaver/engine_foundrylocal.py`)
- ORT Engine → ONNX Runtime GenAI: runs generation (evidence: `README.md`)
- ORT Engine → Tool Calling: uses utilities (evidence: `obeaver/engine_ort.py`)
- Foundry Engine → Tool Calling: uses utilities (evidence: `obeaver/engine_foundrylocal.py`)
- HTTP API → Embedding Engine: serves embeddings (evidence: `obeaver/server.py`)
- CLI Commands → Model Conversion: runs conversion (evidence: `obeaver/cli.py`)
- HTTP API → Resource Monitor: reads metrics (evidence: `obeaver/server.py`)
- Web Dashboard → HTTP API: uses dashboard routes (evidence: `obeaver/server.py`)
- CLI Commands → Model Configuration: reads model paths (evidence: `obeaver/cli.py`)
