# devanshikansara/localaiengineering architecture

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

- Interactive diagram: https://gitdiagram.com/devanshikansara/localaiengineering
- Repository: https://github.com/devanshikansara/localaiengineering

## Overview

This small prototype turns a natural-language CAM request into deterministic calculations: the LLM interprets the request and orchestrates tool calls, Python validates inputs and calculates results, and the LLM presents the response. The README documents the local Ollama/Qwen3:4B integration and dependent calculation chain; the sampled source confirms the registry dispatches to three calculation functions. The LLM interaction implementation was not sampled, so its links are based on README statements.

Main entry points: [`test_llm.py`](https://github.com/devanshikansara/localaiengineering/blob/master/test_llm.py) (LLM interaction), [`tool_registry.py`](https://github.com/devanshikansara/localaiengineering/blob/master/tool_registry.py) (Tool registry), [`engineering_tools.py`](https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py) (Spindle speed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["LLM interaction"]
  node_assistant["LLM interaction<br/>[test_llm.py]"]
end

subgraph group_dispatch["Tool dispatch"]
  node_registry["Tool registry<br/>[tool_registry.py]"]
end

subgraph group_calculations["Engineering calculations"]
  node_spindle["Spindle speed"]
  node_feed["Feed rate"]
  node_cutting["Cutting time"]
end

node_user(("User"))
node_ollama["Ollama / Qwen3:4B"]

node_user -->|"sends request"| node_assistant
node_assistant -->|"interprets request"| node_ollama
node_ollama -->|"selects tools"| node_assistant
node_assistant -->|"requests execution"| node_registry
node_registry -->|"dispatches"| node_spindle
node_registry -->|"dispatches"| node_feed
node_registry -->|"dispatches"| node_cutting
node_assistant -->|"returns tool results"| node_ollama
node_ollama -->|"interprets results"| node_assistant
node_assistant -->|"presents result"| node_user
node_ollama -->|"chains dependent tools"| node_assistant

click node_assistant "https://github.com/devanshikansara/localaiengineering/blob/master/test_llm.py"
click node_registry "https://github.com/devanshikansara/localaiengineering/blob/master/tool_registry.py"
click node_spindle "https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py"
click node_feed "https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py"
click node_cutting "https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.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_assistant,node_user toneBlue
class node_registry toneAmber
class node_spindle,node_feed,node_cutting toneMint
class node_ollama toneIndigo
```

## Components

### LLM interaction

- [LLM interaction](https://github.com/devanshikansara/localaiengineering/blob/master/test_llm.py): `test_llm.py`

### Tool dispatch

- [Tool registry](https://github.com/devanshikansara/localaiengineering/blob/master/tool_registry.py): `tool_registry.py`

### Engineering calculations

- [Spindle speed](https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py): `engineering_tools.py`
- [Feed rate](https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py): `engineering_tools.py`
- [Cutting time](https://github.com/devanshikansara/localaiengineering/blob/master/engineering_tools.py): `engineering_tools.py`

### Other components

- **User**
- **Ollama / Qwen3:4B**

## Connections

- User → LLM interaction: sends request (evidence: `README.md`)
- LLM interaction → Ollama / Qwen3:4B: interprets request (evidence: `README.md`)
- Ollama / Qwen3:4B → LLM interaction: selects tools (evidence: `README.md`)
- LLM interaction → Tool registry: requests execution (evidence: `README.md`)
- Tool registry → Spindle speed: dispatches (evidence: `tool_registry.py`)
- Tool registry → Feed rate: dispatches (evidence: `tool_registry.py`)
- Tool registry → Cutting time: dispatches (evidence: `tool_registry.py`)
- LLM interaction → Ollama / Qwen3:4B: returns tool results (evidence: `README.md`)
- Ollama / Qwen3:4B → LLM interaction: interprets results (evidence: `README.md`)
- LLM interaction → User: presents result (evidence: `README.md`)
- Ollama / Qwen3:4B → LLM interaction: chains dependent tools (evidence: `README.md`)
