[SPRINT] Вечерний спринт: Tool Gateway 16 инструментов (ha.search, media.search/request, hub.service_detail, alerts.active, backup.status), MCP обновлён, selfcheck 24/24. LLM: CPU-тюнинг 84 ток/с (thread12/batch1024), llama.cpp CPU 81.9 — не быстрее; iGPU заблокирован render-группой, Ollama без GPU. Безопасность: пароль biglibrary из чата удалён (redaction), нужна смена; автозагрузка с biglibrary не встраивается. Открыто: свет (неясная сущность), Jellyfin 401, media.request 400
This commit is contained in:
1 parent
096b198692
commit
088f2629bd
5 files changed
+114
-2
No files matched your search
@@ -0,0 +1,69 @@
|
||||
# Вечерний спринт: P0 и ускорение LLM (17.11.2026)
|
||||
|
||||
## Сделано
|
||||
|
||||
### Tool Gateway (16 инструментов)
|
||||
|
||||
Добавлены и проверены:
|
||||
|
||||
| Инструмент | Проверка |
|
||||
|---|---|
|
||||
| `ha.search` | нашёл коридор/прихожую, состояния и время |
|
||||
| `media.search` | Clarkson's Farm (tvdb 378165) |
|
||||
| `media.request` | ловит существующий сериал; сейчас 400 от Sonarr |
|
||||
| `hub.service_detail` | n8n: up, CT108, порт 5680 |
|
||||
| `alerts.active` | 0 активных алертов |
|
||||
| `backup.status` | backup-heartbeat ok, verify-services ok |
|
||||
|
||||
MCP: новые схемы доставлены, агент видит инструменты.
|
||||
Selfcheck: **24/24**, Tool Gateway healthy, tools=16.
|
||||
|
||||
### LLM: ускорение
|
||||
|
||||
| Проверка | Результат |
|
||||
|---|---|
|
||||
| CPU-тюнинг Ollama | **84 ток/с** prefill (thread=12, batch=1024), было 65 |
|
||||
| 8k промпт | 21.5 с против 27.7 с |
|
||||
| llama.cpp CPU | prompt **81.9 ток/с**, generation 12.6 — не быстрее Ollama |
|
||||
| iGPU Intel Arc | **заблокирован правами**: `/dev/dri/renderD128` root:render, `roman` не в группе |
|
||||
| Ollama GPU | собран без GPU, `num_gpu` игнорируется |
|
||||
| Vulkan-драйверы | скачаны user-space, llama.cpp Vulkan готов; нужен `render` |
|
||||
|
||||
Вывод: CPU-потолок ~84 ток/с; iGPU требует **одного root-действия**.
|
||||
|
||||
### Безопасность
|
||||
|
||||
* В чат был отправлен пароль biglibrary — сообщение **удалено (redaction)**.
|
||||
* Пароль нужно **сменить**; бот использовал его и скачал 3 fb2.
|
||||
* Автоматическое скачивание с biglibrary **не встраиваем** (копирайт);
|
||||
можно `books.search`/`books.link`/`books.status` без логина.
|
||||
|
||||
### Проблемы из чата
|
||||
|
||||
* Свет: обе сущности `on` с 03:50, команды 200, физически нет — нужен ответ,
|
||||
какая сущность реально коридор.
|
||||
* Jellyfin: оба ключа (`-key`, `-key-new`) дают **401** — нужен новый.
|
||||
* Sonarr lookup: был 503, сейчас 200; `media.request` возвращает 400
|
||||
(нужно разобрать тело ответа Sonarr).
|
||||
* `media.recent` не работает из-за Jellyfin 401.
|
||||
|
||||
## Что нужно от владельца (когда будет доступ)
|
||||
|
||||
```bash
|
||||
sudo usermod -aG render,video roman
|
||||
sudo cpupower frequency-set -g performance
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
После этого:
|
||||
1. Перезайти под `roman` → Vulkan увидит Arc.
|
||||
2. Прогнать llama.cpp Vulkan, сравнить с 84 ток/с.
|
||||
3. Починить Jellyfin-ключ и `media.request`.
|
||||
|
||||
## Следующие шаги
|
||||
|
||||
1. Дожать iGPU (llama.cpp Vulkan) — главный шанс ускорения.
|
||||
2. Починить media.request (Sonarr 400) и Jellyfin-ключ.
|
||||
3. Добавить `books.search`/`books.link`/`books.status` (без скачивания).
|
||||
4. Решить по свету (какая сущность).
|
||||
5. Большой аудит Tool Gateway — после P0.
|
||||
@@ -1,5 +1,5 @@
|
||||
# Реестр автоматизаций Buryans Hub
|
||||
# Сгенерировано: 2026-11-17 16:22 (ops/scripts/build_automations_registry.py)
|
||||
# Сгенерировано: 2026-11-17 18:05 (ops/scripts/build_automations_registry.py)
|
||||
total: 168
|
||||
by_source:
|
||||
cron.d: 49
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"nats": "dig:sha256:b7752304692bc0612b7fbae6add53cdd14059ec83cad1795d78edade6025ef07",
|
||||
"navidrome": "dig:sha256:38dc2727bfcfd5ede290f8ada114fc90368146f265ae4701ddddbcbe2a44ee52",
|
||||
"nextcloud": "dig:sha256:8041f24690c5631da46d2391e1fd7efcde95c6cf08695047f3dd7ce7783934b4",
|
||||
"node_red": "dig:sha256:2ccd38b4066648bd5e17430c50a2f8102c566a82fd4f2fc5c342e61664d6896f",
|
||||
"node_red": "dig:sha256:0ed181c867c9ef19cf51dc4707f7fb54d1ad58a0227ab4e19732f6a3630c1b00",
|
||||
"npm-app-1": "dig:sha256:91277490a919c792aa73b8d291af1ca84d32be74df988e543137976515763534",
|
||||
"paperless_redis": "dig:sha256:7f7d30b7fdd09467bac58198a1f166dd69789d348d4fe859cccb20e0cf287fbe",
|
||||
"plex": "dig:sha256:06e07af2851e6a822e89062b148435495dd794d6d5aaf36247dee05fb3dcc4b8",
|
||||
|
||||
@@ -299,6 +299,40 @@ def t_media_request(args):
|
||||
"title": res.get("title"), "id": res.get("id"),
|
||||
"error": res if st >= 400 else None}
|
||||
|
||||
def t_hub_service_detail(args):
|
||||
name = (args.get("name") or "").lower()
|
||||
st, body = http("GET", HUB + "/status.json", timeout=30)
|
||||
d = json.loads(body)
|
||||
for svc in d.get("services", []):
|
||||
if svc.get("name", "").lower() == name:
|
||||
return svc
|
||||
matches = [x for x in d.get("services", []) if name and name in x.get("name", "").lower()]
|
||||
return {"found": False, "query": name, "matches": matches[:10]}
|
||||
|
||||
|
||||
def t_alerts_active(args):
|
||||
st, body = http("GET", "http://192.168.1.134:9093/api/v2/alerts", timeout=15)
|
||||
alerts = json.loads(body)
|
||||
out = []
|
||||
for a in alerts:
|
||||
lb = a.get("labels") or {}
|
||||
out.append({"name": lb.get("alertname"), "severity": lb.get("severity"),
|
||||
"instance": lb.get("instance"), "status": (a.get("status") or {}).get("state"),
|
||||
"startsAt": a.get("startsAt")})
|
||||
return {"count": len(out), "alerts": out[:50]}
|
||||
|
||||
|
||||
def t_backup_status(args):
|
||||
import subprocess as sp
|
||||
env = dict(os.environ, PGPASSWORD=read("/root/.pg-superuser-pass"))
|
||||
q = ("SELECT name, to_char(to_timestamp(last_run),'MM-DD HH24:MI'), "
|
||||
"last_status, fails FROM jobs WHERE name ILIKE '%backup%' OR name ILIKE '%verify%' "
|
||||
"ORDER BY name;")
|
||||
r = sp.run(["psql", "-w", "-h", "192.168.1.151", "-U", "postgres", "-d", "hermes",
|
||||
"-t", "-A", "-F", "|", "-c", q], capture_output=True, text=True, timeout=30, env=env)
|
||||
rows = [ln.split("|") for ln in (r.stdout or "").strip().splitlines() if ln]
|
||||
return {"jobs": [{"name": x[0], "last": x[1], "status": x[2], "fails": x[3]} for x in rows]}
|
||||
|
||||
TOOLS = {
|
||||
"hub.status": {"fn": t_hub_status, "scope": "read", "confirm": False},
|
||||
"hub.notify": {"fn": t_hub_notify, "scope": "write", "confirm": True,
|
||||
@@ -317,6 +351,9 @@ TOOLS = {
|
||||
"media.search": {"fn": t_media_search, "scope": "read", "confirm": False},
|
||||
"media.request": {"fn": t_media_request, "scope": "write", "confirm": True,
|
||||
"actors": ["owner", "family"]},
|
||||
"hub.service_detail": {"fn": t_hub_service_detail, "scope": "read", "confirm": False},
|
||||
"alerts.active": {"fn": t_alerts_active, "scope": "read", "confirm": False},
|
||||
"backup.status": {"fn": t_backup_status, "scope": "read", "confirm": False},
|
||||
}
|
||||
|
||||
|
||||
@@ -390,6 +427,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
"ha.search": ["query"],
|
||||
"media.search": ["query"],
|
||||
"media.request": ["query"],
|
||||
"hub.service_detail": ["name"],
|
||||
}.get(tool, [])
|
||||
missing = [k for k in required if not args.get(k)]
|
||||
if missing:
|
||||
|
||||
@@ -34,6 +34,11 @@ SCHEMAS = {
|
||||
"required": ["title", "start"]}),
|
||||
"photos.people": ("Люди в Immich", {"type": "object", "properties": {}}),
|
||||
"photos.albums": ("Альбомы Immich", {"type": "object", "properties": {}}),
|
||||
"hub.service_detail": ("Детали одной службы хаба по имени", {"type": "object", "properties": {
|
||||
"name": {"type": "string"}}, "required": ["name"]}),
|
||||
"alerts.active": ("Активные алерты Alertmanager", {"type": "object", "properties": {}}),
|
||||
"backup.status": ("Статус заданий бэкапа/проверки", {"type": "object", "properties": {}}),
|
||||
|
||||
"ha.search": ("Найти сущности Home Assistant по имени", {"type": "object", "properties": {
|
||||
"query": {"type": "string"}, "domain": {"type": "string"}}, "required": ["query"]}),
|
||||
"media.search": ("Поиск сериала или фильма в Sonarr/Radarr", {"type": "object", "properties": {
|
||||
|
||||
Reference in new issue
Block a user