7291b8fc42
- 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
16 lines
409 B
Python
16 lines
409 B
Python
"""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"}
|