# kennethjyang/blender-ai-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/kennethjyang/blender-ai-assistant
- Repository: https://github.com/kennethjyang/blender-ai-assistant

## Overview

This is a small Blender add-on: the user enters a plain-English request in the 3D View sidebar, submits it, and the add-on asks Ollama’s Llama 3 70b model for Blender Python. Returned code is executed in Blender; execution errors trigger bounded repair requests, and the result is displayed in the panel. The single source file implements the UI, request handling, and state updates. The README documents the Ollama dependency and model-release behavior; the excerpt does not show implementation for automatic GPU-memory release.

Main entry points: [`ai_assistant.py`](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py) (Request worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Blender interface"]
  node_panel["Assistant panel<br/>[ai_assistant.py]"]
  node_properties["Input and status<br/>[ai_assistant.py]"]
end

subgraph group_execution["Request and execution"]
  node_submit["Submit operator<br/>[ai_assistant.py]"]
  node_scene[("Blender scene")]
  node_worker["Request worker<br/>[ai_assistant.py]"]
  node_code["Blender command<br/>[ai_assistant.py]"]
  node_timer["Result timer<br/>[ai_assistant.py]"]
end

node_user(("Blender user"))
node_ollama{{"Ollama LLM"}}

node_user -->|"enters request"| node_panel
node_panel -->|"reads and displays"| node_properties
node_panel -->|"dispatches"| node_submit
node_submit -->|"reads and updates"| node_properties
node_submit -->|"reads objects"| node_scene
node_submit -->|"starts thread"| node_worker
node_worker -->|"requests generation"| node_ollama
node_worker -->|"extracts and executes"| node_code
node_code -->|"performs Blender actions"| node_scene
node_worker -->|"signals completion"| node_timer
node_timer -->|"writes response"| node_properties
node_worker -->|"requests error repair"| node_ollama

click node_panel "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py"
click node_properties "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py"
click node_submit "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py"
click node_worker "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py"
click node_code "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py"
click node_timer "https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.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_panel,node_properties,node_user toneBlue
class node_submit,node_scene,node_worker,node_code,node_timer toneAmber
class node_ollama toneIndigo
```

## Components

### Blender interface

- [Assistant panel](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`
- [Input and status](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`

### Request and execution

- [Submit operator](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`
- **Blender scene**
- [Request worker](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`
- [Blender command](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`
- [Result timer](https://github.com/kennethjyang/blender-ai-assistant/blob/main/ai_assistant.py): `ai_assistant.py`

### Other components

- **Blender user**
- **Ollama LLM**

## Connections

- Blender user → Assistant panel: enters request (evidence: `README.md`)
- Assistant panel → Input and status: reads and displays (evidence: `ai_assistant.py`)
- Assistant panel → Submit operator: dispatches (evidence: `ai_assistant.py`)
- Submit operator → Input and status: reads and updates (evidence: `ai_assistant.py`)
- Submit operator → Blender scene: reads objects (evidence: `ai_assistant.py`)
- Submit operator → Request worker: starts thread (evidence: `ai_assistant.py`)
- Request worker → Ollama LLM: requests generation (evidence: `README.md`)
- Request worker → Blender command: extracts and executes (evidence: `ai_assistant.py`)
- Blender command → Blender scene: performs Blender actions (evidence: `ai_assistant.py`)
- Request worker → Result timer: signals completion (evidence: `ai_assistant.py`)
- Result timer → Input and status: writes response (evidence: `ai_assistant.py`)
- Request worker → Ollama LLM: requests error repair (evidence: `ai_assistant.py`)
