Initial version of gui for our T-SQL AI framework.

This commit is contained in:
2026-02-19 14:46:03 +01:00
commit c28cce4086
8 changed files with 708 additions and 0 deletions

73
README.md Normal file
View File

@@ -0,0 +1,73 @@
# JR SQL AI GUI (Ollama)
Schlanke, stabile GUI für **Arch Linux / Hyprland (Wayland)**, um ein Ollama-Modell (z.B. `jr-sql-expert:latest`) bequem zu nutzen.
## Features
- Zwei Bereiche:
- **Prompt/Kontext** (links)
- **Antwort** (rechts) inkl. **Markdown Rendering**
- **Streaming** (Antwort läuft live ein)
- Buttons:
- **An AI senden**
- **Antwort kopieren** (Markdown)
- **Copy SQL only** (extrahiert SQL aus ```sql```-Blöcken bzw. SQL-ähnlichen Code-Fences)
- **Modell aktualisieren (pull)** über Ollama API
- **Ollama Runtime updaten** (optional) via Docker (`docker pull` + `docker restart`)
## Voraussetzungen
- Ein laufender Ollama Server (bei dir z.B. Docker Container auf `127.0.0.1:11434`)
- Python 3.11+ empfohlen
## Installation (Arch Linux)
### Systempakete (minimal)
```bash
sudo pacman -S pyside6 python-requests
```
### Optional: venv (isoliert)
```bash
python -m venv .venv
source .venv/bin/activate
pip install PySide6 requests
```
## Start
```bash
python sql_ai_gui.py
```
Falls Qt/Wayland zickt (selten), erzwingen:
```bash
QT_QPA_PLATFORM=wayland python sql_ai_gui.py
```
## Konfiguration
Per Environment Variablen (optional):
- `OLLAMA_BASE_URL` (Default: `http://127.0.0.1:11434`)
- `OLLAMA_MODEL` (Default: `jr-sql-expert:latest`)
- `OLLAMA_DOCKER_CONTAINER` (Default: `ollama`)
Beispiel:
```bash
OLLAMA_MODEL="jr-sql-expert:latest" OLLAMA_BASE_URL="http://127.0.0.1:11434" python sql_ai_gui.py
```
## Sicherheit
- Standardmäßig wird nur auf `127.0.0.1` gearbeitet.
- Runtime-Update nutzt `docker`. Wenn dein User keine Docker-Rechte hat, wird das fehlschlagen.
## Repo Layout
- `sql_ai_gui.py` die App (single-file)
- `docs/` kurze Doku (Markdown)
- `requirements.txt` falls du lieber via pip installierst
## License
MIT (siehe LICENSE)