v0.11.0 -> v0.12.0: startup hardware self-assessment (Roadmap J)

- hardware.py: assess_hardware() probes RAM, CPU, GPU VRAM (rocm-smi),
  llama-server, Qdrant, SearXNG reachability — writes hardware_state.json
- routers/hardware.py: GET /api/hardware (no auth) returns snapshot
- app.py: calls assess_hardware() in lifespan after init_db()
- 4 new tests: all services reachable, rocm-smi absent, llama unreachable,
  HTTP endpoint
This commit is contained in:
gramps
2026-07-03 12:53:34 -07:00
parent 779d606923
commit 7291b8fc42
5 changed files with 314 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
"""JarvisChat routers — Hardware self-assessment endpoint."""
import json
from fastapi import APIRouter
import hardware
router = APIRouter()
@router.get("/api/hardware")
async def get_hardware_state():
if hardware.HARDWARE_STATE_PATH.exists():
return json.loads(hardware.HARDWARE_STATE_PATH.read_text())
return {"status": "not_ready", "message": "Hardware assessment not yet complete"}