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:
@@ -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"}
|
||||
Reference in New Issue
Block a user