# botschafterspock/ai-test architecture

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

- Interactive diagram: https://gitdiagram.com/botschafterspock/ai-test
- Repository: https://github.com/botschafterspock/ai-test

## Overview

This repository builds JOJO-AI: Python tools prepare dialogue and code-training data, train small GPT models, and serve chat or code-completion requests; a separate smart server answers from searchable question-and-answer knowledge. Users interact through Java console or GUI clients. The graph keeps these distinct runtime paths and the major data-preparation branches visible. Source excerpts support the shown calls and file operations; the README is empty, so unsampled integrations and workflows are not inferred.

Main entry points: [`AI_test/src/main/java/de/jojo/ai/ChatClient.java`](https://github.com/botschafterspock/ai-test/blob/master/AI_test/src/main/java/de/jojo/ai/ChatClient.java) (Console chat), [`AI_test/python/gpt.py`](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/gpt.py) (GPT model), [`AI_test/python/data/train.txt`](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/data/train.txt) (Training dialogue data), [`AI_test/python/server_smart.py`](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server_smart.py) (Knowledge server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Java clients"]
  node_console["Console chat<br/>[ChatClient.java]"]
  node_gui["Chat GUI<br/>[GuiChatClient.java]"]
end

subgraph group_serving["Inference services"]
  node_smartserver["Knowledge server<br/>[server_smart.py]"]
  node_gptserver["GPT chat server<br/>[server.py]"]
  node_allserver["Chat and code server<br/>[server_all.py]"]
  node_gpt["GPT model<br/>[gpt.py]"]
end

subgraph group_learning["Training"]
  node_trainer["Chat trainer<br/>[train.py]"]
  node_alltrainer["Chat and code trainer<br/>[train_all.py]"]
end

subgraph group_knowledge["Data and knowledge"]
  node_templategen["Template data generator<br/>[make-data.py]"]
  node_teachergen["Teacher data generator<br/>[generate_data.py]"]
  node_trainingdata["Training dialogue data<br/>[train.txt]"]
  node_pendingdata["Pending dialogues"]
  node_knowledgestore[("Knowledge files")]
end

node_user(("User"))
node_ollama["Ollama teacher"]

node_user -->|"enters chat"| node_console
node_user -->|"enters chat"| node_gui
node_gui -->|"sends request"| node_console
node_console -->|"posts chat"| node_smartserver
node_console -->|"posts chat or code"| node_allserver
node_smartserver -->|"reads and learns"| node_knowledgestore
node_smartserver -->|"returns answer"| node_user
node_gptserver -->|"loads and generates"| node_gpt
node_allserver -->|"loads and generates"| node_gpt
node_gptserver -->|"returns answer"| node_user
node_allserver -->|"returns chat or completion"| node_user
node_trainer -->|"trains model"| node_gpt
node_alltrainer -->|"trains model"| node_gpt
node_templategen -->|"writes dialogues"| node_trainingdata
node_teachergen -->|"appends approved data"| node_trainingdata
node_teachergen -->|"stores candidates"| node_pendingdata
node_ollama -->|"generates and reviews"| node_teachergen
node_trainer -.->|"trains from"| node_trainingdata
node_alltrainer -.->|"trains from"| node_trainingdata

click node_console "https://github.com/botschafterspock/ai-test/blob/master/AI_test/src/main/java/de/jojo/ai/ChatClient.java"
click node_gui "https://github.com/botschafterspock/ai-test/blob/master/AI_test/src/main/java/de/jojo/ai/GuiChatClient.java"
click node_smartserver "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server_smart.py"
click node_gptserver "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server.py"
click node_allserver "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server_all.py"
click node_gpt "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/gpt.py"
click node_trainer "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/train.py"
click node_alltrainer "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/train_all.py"
click node_templategen "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/make-data.py"
click node_teachergen "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/generate_data.py"
click node_trainingdata "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/data/train.txt"
click node_pendingdata "https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/data/generated_pending.txt"
click node_knowledgestore "https://github.com/botschafterspock/ai-test/tree/master/AI_test/python/data"

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_console,node_gui,node_user toneBlue
class node_smartserver,node_gptserver,node_allserver,node_gpt toneAmber
class node_trainer,node_alltrainer toneMint
class node_templategen,node_teachergen,node_trainingdata,node_pendingdata,node_knowledgestore toneRose
class node_ollama toneIndigo
```

## Components

### Java clients

- [Console chat](https://github.com/botschafterspock/ai-test/blob/master/AI_test/src/main/java/de/jojo/ai/ChatClient.java): `AI_test/src/main/java/de/jojo/ai/ChatClient.java`
- [Chat GUI](https://github.com/botschafterspock/ai-test/blob/master/AI_test/src/main/java/de/jojo/ai/GuiChatClient.java): `AI_test/src/main/java/de/jojo/ai/GuiChatClient.java`

### Inference services

- [Knowledge server](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server_smart.py): `AI_test/python/server_smart.py`
- [GPT chat server](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server.py): `AI_test/python/server.py`
- [Chat and code server](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/server_all.py): `AI_test/python/server_all.py`
- [GPT model](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/gpt.py): `AI_test/python/gpt.py`

### Training

- [Chat trainer](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/train.py): `AI_test/python/train.py`
- [Chat and code trainer](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/train_all.py): `AI_test/python/train_all.py`

### Data and knowledge

- [Template data generator](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/make-data.py): `AI_test/python/make-data.py`
- [Teacher data generator](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/generate_data.py): `AI_test/python/generate_data.py`
- [Training dialogue data](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/data/train.txt): `AI_test/python/data/train.txt`
- [Pending dialogues](https://github.com/botschafterspock/ai-test/blob/master/AI_test/python/data/generated_pending.txt): `AI_test/python/data/generated_pending.txt`
- [Knowledge files](https://github.com/botschafterspock/ai-test/tree/master/AI_test/python/data): `AI_test/python/data`

### Other components

- **User**
- **Ollama teacher**

## Connections

- User → Console chat: enters chat (evidence: `AI_test/src/main/java/de/jojo/ai/ChatClient.java`)
- User → Chat GUI: enters chat (evidence: `AI_test/src/main/java/de/jojo/ai/GuiChatClient.java`)
- Chat GUI → Console chat: sends request (evidence: `AI_test/src/main/java/de/jojo/ai/GuiChatClient.java`)
- Console chat → Knowledge server: posts chat (evidence: `AI_test/src/main/java/de/jojo/ai/ChatClient.java`)
- Console chat → Chat and code server: posts chat or code (evidence: `AI_test/python/server_all.py`)
- Knowledge server → Knowledge files: reads and learns (evidence: `AI_test/python/server_smart.py`)
- Knowledge server → User: returns answer (evidence: `AI_test/python/server_smart.py`)
- GPT chat server → GPT model: loads and generates (evidence: `AI_test/python/server.py`)
- Chat and code server → GPT model: loads and generates (evidence: `AI_test/python/server_all.py`)
- GPT chat server → User: returns answer (evidence: `AI_test/python/server.py`)
- Chat and code server → User: returns chat or completion (evidence: `AI_test/python/server_all.py`)
- Chat trainer → GPT model: trains model (evidence: `AI_test/python/train.py`)
- Chat and code trainer → GPT model: trains model (evidence: `AI_test/python/train_all.py`)
- Template data generator → Training dialogue data: writes dialogues (evidence: `AI_test/python/make-data.py`)
- Teacher data generator → Training dialogue data: appends approved data (evidence: `AI_test/python/generate_data.py`)
- Teacher data generator → Pending dialogues: stores candidates (evidence: `AI_test/python/generate_data.py`)
- Ollama teacher → Teacher data generator: generates and reviews (evidence: `AI_test/python/generate_data.py`)
- Chat trainer → Training dialogue data: trains from
- Chat and code trainer → Training dialogue data: trains from
