From 94e9bb44b14c212ad14bf3484691f2787dd87f01 Mon Sep 17 00:00:00 2001 From: Matteo Benedetto Date: Tue, 18 Aug 2026 22:48:50 +0200 Subject: [PATCH] docs: sez. 11.11 istanza frigate (embedding llama.cpp) + bump v2.7.0 --- docs/playbook.md | 39 +++++++++++++++++++++++++++++++++++++++ gateway/main.py | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/playbook.md b/docs/playbook.md index 7413bf7..b4ba756 100644 --- a/docs/playbook.md +++ b/docs/playbook.md @@ -434,6 +434,45 @@ pi-local). Script: estrazione `/tmp/extract_qmem3.py` + ripristino 3. Testare le migrazioni su una collection di test con dati REALI (non solo record creati dopo il backfill) +### 11.11 Istanza frigate (copia del Memory Gateway, embedding via llama.cpp) + +> Deploy 2026-08-18 — copia del server memoria su frigate.vpn (10.8.0.18), +> con embedding forniti dal router llama.cpp locale (niente Ollama). + +**Stack** (`/home/enne2/memory-frigate/`): +- Qdrant 1.19: container `memory-frigate-qdrant`, bind 127.0.0.1:6333/6334, + API key + JWT RBAC +- Gateway: container `memory-frigate-gateway`, bind 10.8.0.18:8082 (VPN), + collection `memories` +- Embedding: **llama.cpp router** (`llama-router-vulkan.service`, porta 8081) + con modello `bge-m3` (Q8_0, 1024-dim, `doof-ferb/bge-m3-gguf`) + +**Config gateway** (env): `EMBED_API=llamacpp`, `EMBED_URL=http://host.docker.internal:8081`, +`EMBED_MODEL=bge-m3`, `EMBED_API_KEY=sta.cippa` (chiave router). + +**Modello embedding nel router** (`models.ini`): +```ini +[bge-m3] +model = /home/enne2/dev/vulkan.cpp/models/bge-m3-Q8_0.gguf +alias = bge-m3 +embedding = true +ctx-size = 8192 +pooling = cls +embd-normalize = 2 +gpu-layers = 0 ; CPU: evita contesa GPU con i modelli di generazione +``` +Dopo modifiche a models.ini: `systemctl --user restart llama-router-vulkan`. + +**Backend embedding nel gateway** (v2.7.0): `EMBED_API=ollama|llamacpp` +(OpenAI-compatible `/v1/embeddings` con Bearer key); `EMBED_URL` sostituisce +`OLLAMA_URL` (alias retrocompatibile). + +**Config estensione per usare frigate**: `~/.config/pi-qmem/config.json` +→ `{"url": "http://10.8.0.18:8082", "apiKey": ""}`. + +**Nota**: istanza indipendente (collection vuota). Per replicare i dati da +brain: snapshot Qdrant + restore (sez. 4) o re-embedding dei record. + ### 11.5 project_id obbligatorio - Dal gateway v2.4.0 / estensione v1.4.0: `project_id` è **obbligatorio** in `POST /v1/memories` (Pydantic `min_length=1`) e nello schema del tool `qmem_store` (Type.String, non più Optional) diff --git a/gateway/main.py b/gateway/main.py index e24334f..cee35ce 100644 --- a/gateway/main.py +++ b/gateway/main.py @@ -158,7 +158,7 @@ async def lifespan(_app: FastAPI): _http = None -app = FastAPI(title="Memory Gateway", version="2.6.0", lifespan=lifespan) +app = FastAPI(title="Memory Gateway", version="2.7.0", lifespan=lifespan) qdrant = QdrantClient(url=QDRANT_URL, api_key=QDRANT_API_KEY) # Request ID: generato per richiesta, loggato nell'audit e restituito in header