diff --git a/.claude/context/services-catalog.md b/.claude/context/services-catalog.md index 5eb700bfeb..dbfd01f227 100644 --- a/.claude/context/services-catalog.md +++ b/.claude/context/services-catalog.md @@ -120,6 +120,44 @@ Comprehensive reference of all production services, ports, APIs, and integration - **Dependencies:** Agent Zero, DeepResearch, databases - **Compose Profile:** `orchestration` +### Model Registry +- **Ports:** 8110 +- **Port Note:** `8110` also appears in the BoTZ VPN MCP stack; these are profile-separated deployments (`orchestration` vs `vpn/remote`) and should not be exposed on the same host at the same time. +- **Purpose:** Dynamic model configuration service — central catalog for LLM/embedding model providers, mappings, and active deployments +- **Key APIs:** + - `GET /healthz` - Service health + - `GET /api/models` - List registered models + - `GET /api/providers` - List model providers + - `GET /api/deployments` - List active model deployments +- **NATS Topics:** + - Publish: `model.registry.updated.v1` (catalog mutation notifications) + - Subscribe: `mesh.gpu.model.loaded.v1`, `mesh.gpu.model.unloaded.v1` (syncs deployment state from GPU Orchestrator) +- **Dependencies:** Supabase (required), NATS +- **Docker Image:** Custom build from `services/model-registry` +- **Compose Profile:** `orchestration` +- **Lifecycle:** Formerly dormant; activated in PR #787-791 + +### GPU Orchestrator +- **Ports:** 8200 +- **Purpose:** Dynamic GPU resource management and model lifecycle controller +- **Key APIs:** + - `GET /healthz` - Service health + - `GET /api/v1/status` - GPU status (VRAM utilization, loaded models, temperature) + - `GET /api/v1/models` - List models loaded on GPU + - `GET /metrics` - Prometheus metrics +- **NATS Topics:** + - Publish: `mesh.gpu.status.v1` (every 5s), `mesh.gpu.model.loaded.v1`, `mesh.gpu.model.unloaded.v1`, `mesh.gpu.vram.warning.v1`, `mesh.gpu.command.result.v1` + - Subscribe: `mesh.gpu.command.v1` (model load/unload/optimize requests) +- **Features:** + - Bidirectional NATS wiring with model-registry + - VRAM warning rate-limited to 1/min + - Command execution results via fire-and-forget NATS (no request-reply) +- **Dependencies:** NATS (required), NVIDIA GPU runtime +- **Docker Image:** Custom build from `services/gpu-orchestrator` +- **Compose Profile:** `gpu` +- **Note:** Only started by `make up-model-management` when NVIDIA runtime is detected +- **Lifecycle:** Formerly dormant; activated in PR #787-791 + ### Open Notebook (External Integration) - **Purpose:** Knowledge base / note-taking (SurrealDB-backed) - **Access:** Via `OPEN_NOTEBOOK_API_URL` + API token @@ -257,6 +295,16 @@ Comprehensive reference of all production services, ports, APIs, and integration - **Dependencies:** Open Notebook, LangExtract, Extract Worker - **Compose Profile:** `orchestration` +### Transcribe Backend +- **Ports:** 8074 +- **Purpose:** Text transcription service (PMOVES-transcribe-and-fetch submodule) +- **Key APIs:** + - `GET /healthz` - Service health +- **Dependencies:** Supabase, NATS +- **Submodule:** `PMOVES-transcribe-and-fetch` +- **Compose Profile:** `workers` +- **Lifecycle:** Formerly dormant; activated in PR #787-791 + ## Utility & Integration Services ### Presign @@ -362,6 +410,7 @@ Comprehensive reference of all production services, ports, APIs, and integration ### BoTZ VPN MCP Server - **Port:** 8110 +- **Port Note:** Collides with Model Registry (`8110`) when both stacks are host-exposed; run this service only with `vpn/remote` profiles on hosts that are not exposing `model-registry`. - **Purpose:** MCP server exposing VPN and remote desktop tools - **Transport:** SSE - **MCP Tools:** @@ -549,6 +598,10 @@ http://localhost:8080/healthz # Agent Zero http://localhost:8091/healthz # Archon http://localhost:8097/healthz # Channel Monitor +# Model Management +http://localhost:8110/healthz # Model Registry +http://localhost:8200/healthz # GPU Orchestrator (GPU only) + # Retrieval & Knowledge http://localhost:8086/healthz # Hi-RAG v2 CPU http://localhost:8087/healthz # Hi-RAG v2 GPU @@ -569,6 +622,7 @@ http://localhost:8083/healthz # Extract Worker http://localhost:8084/healthz # LangExtract http://localhost:8092/healthz # PDF Ingest http://localhost:8095/healthz # Notebook Sync +http://localhost:8074/healthz # Transcribe Backend # CHIT & Geometry http://localhost:8103/healthz # Tokenism Simulator diff --git a/pmoves/docs/operations/MAKE_TARGETS.md b/pmoves/docs/operations/MAKE_TARGETS.md index 5ad066b88d..4ece68c26d 100644 --- a/pmoves/docs/operations/MAKE_TARGETS.md +++ b/pmoves/docs/operations/MAKE_TARGETS.md @@ -22,6 +22,20 @@ This file summarizes the most-used targets and maps them to what they do under d - `make recreate-v2-gpu` - Force-recreate v2‑GPU container without dependencies. +## Model Management +- `make up-model-management` + - Starts model-registry (`orchestration` profile), then gpu-orchestrator (`gpu` profile) if NVIDIA runtime is detected. + - GPU detection: `docker info --format '{{json .Runtimes}}' | grep -qi nvidia`. + - Idempotent — safe to re-run without stopping first. +- `make down-model-management` + - Stops model-registry and gpu-orchestrator; removes containers. + - Included in the `down-all` cascade (after `down-agents`, before `down-workers`). +- `make health-dormant` + - Container-state-aware health check for dormant/newly-activated services. + - Checks: model-registry, gpu-orchestrator, pdf-ingest, botz-gateway, tokenism-simulator, transcribe-backend. + - Reports per-service: `OK` (state is `healthy` or `running`), `STARTING`, `FAIL`, or `SKIP` (not running). + - Uses `docker inspect` instead of HTTP probes, avoiding false negatives for Docker-network-only services. + ## Model Profiles & Registry - `make model-profiles` - Lists local fallback profiles under `pmoves/models/*.yaml`. @@ -248,6 +262,10 @@ This file summarizes the most-used targets and maps them to what they do under d - `make ci-queue-drain-nonpr-apply` - Executes queued-run cancellations immediately (still threshold-guarded). - Intended for deadlock recovery when self-hosted lanes are starved by stale runs. +- `make bringup-layered` + - Deterministic local layered bring-up: minimal → model-management → workers → agents → monitoring → prod smoke. + - Model-management layer sits between minimal and workers, starting model-registry and (optionally) gpu-orchestrator before dependent workers (no explicit readiness gate). + - Respects `SUPABASE_RUNTIME` (default `cli`). - `make bringup-showtime` - Bring-up orchestration + retro diagnostics + Codex quick health in one sequence. - Starts a live readiness watcher by default (`SHOWTIME_WATCH=1`) so service transitions are visible while bring-up runs. diff --git a/pmoves/docs/operations/PORT_REGISTRY.md b/pmoves/docs/operations/PORT_REGISTRY.md index 23804c598a..39f526dd45 100644 --- a/pmoves/docs/operations/PORT_REGISTRY.md +++ b/pmoves/docs/operations/PORT_REGISTRY.md @@ -12,7 +12,7 @@ Central registry of all service ports to prevent conflicts and ensure consistenc | 6000-6999 | Vector/Search | Qdrant 6333, Meilisearch 7700† | | 7000-7999 | Core Services | Agent Zero 8080‡ | | 8000-8199 | Agent/Worker Services | session-context-worker 8100, gateway-agent 8100, github-runner-ctl 8104 | -| 8200-8999 | Orchestration Services | Archon 8181 | +| 8200-8999 | Orchestration Services | GPU Orchestrator 8200, Jellyfin AI Gateway 8300 | | 9000-9999 | Infrastructure | Prometheus 9090, NATS 4222‡ | *Postgres uses standard 5432 @@ -70,7 +70,9 @@ Central registry of all service ports to prevent conflicts and ensure consistenc | 8097 | Channel Monitor | External content watcher | | 8098 | DeepResearch | Research planner | | 8099 | SupaSerch | Multimodal search orchestrator | +| 8074 | Transcribe Backend | Text transcription (PMOVES-transcribe-and-fetch) | | 8110 | Model Registry | Dynamic model configuration service | +| 8200 | GPU Orchestrator | Dynamic GPU resource management & model lifecycle | ### Agent/Worker Services (Tier 3) diff --git a/pmoves/docs/operations/SERVICE_HEALTH_ENDPOINTS.md b/pmoves/docs/operations/SERVICE_HEALTH_ENDPOINTS.md index 60d89d17a1..1ada892263 100644 --- a/pmoves/docs/operations/SERVICE_HEALTH_ENDPOINTS.md +++ b/pmoves/docs/operations/SERVICE_HEALTH_ENDPOINTS.md @@ -31,3 +31,33 @@ POSTGREST_URL=http://localhost:3011 ``` After editing `pmoves/env.shared`, run `make -C pmoves env-setup` (or restart the console dev server) so changes apply to the UI. + +## Model Registry +- Default base URL: `http://localhost:8110` +- Health path: `/healthz` +- Additional endpoints: + - `GET /api/models` — List registered models + - `GET /api/providers` — List model providers + - `GET /api/deployments` — List active model deployments +- NATS: Publishes `model.registry.updated.v1` on catalog mutations +- Compose profile: `orchestration` + +## GPU Orchestrator +- Default base URL: `http://localhost:8200` +- Health path: `/healthz` +- Additional endpoints: + - `GET /api/v1/status` — GPU status (VRAM, loaded models) + - `GET /api/v1/models` — List models loaded on GPU + - `GET /metrics` — Prometheus metrics +- NATS subjects: + - Publishes: `mesh.gpu.status.v1` (every 5s), `mesh.gpu.model.loaded.v1`, `mesh.gpu.model.unloaded.v1`, `mesh.gpu.vram.warning.v1` + - Subscribes: `mesh.gpu.command.v1` (load/unload/optimize requests) + - Publishes: `mesh.gpu.command.result.v1` (command execution results) +- **Note:** Only available when NVIDIA GPU runtime is present. The `make up-model-management` target auto-detects this. +- Compose profile: `gpu` + +## Transcribe Backend +- Default base URL: `http://localhost:8074` +- Health path: `/healthz` +- Submodule: `PMOVES-transcribe-and-fetch` +- Compose profile: `workers`