feat(admin): LLM-/GPU-Status-Karte (read-only) — Plan-Schritt 2
- app/admin_llm.py: read-only Statusabfragen ohne sudo (docker ps, ollama ps, nvidia-smi, systemctl --user) mit sicheren Defaults bei fehlenden Tools. - GET /api/admin/llm/status (require_admin): Backend, Modell, Backend-Status, geladene Ollama-Modelle, GPU-Auslastung, Gateway-Dienst-Status. - Admin Status-Tab: LLM-Backend-Karte mit GPU-Balken. - Tests: Auth-Gate + Antwortschema (160 grün). - Doku §7.5: Status-Tab um LLM/GPU-Karte ergänzt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
bd20a308de
commit
97ae0a5d34
6 changed files with 216 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request, WebSocket, WebSo
|
|||
from fastapi.responses import FileResponse
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.admin_llm import llm_status
|
||||
from app.auth import is_admin_user, require_admin, require_admin_or_user
|
||||
from app.config import settings
|
||||
from app.dependencies import get_store
|
||||
|
|
@ -187,6 +188,14 @@ async def export_db():
|
|||
)
|
||||
|
||||
|
||||
# ── LLM-/System-Status (read-only) ──────────────────────────────────────────
|
||||
|
||||
@router.get("/admin/llm/status", dependencies=[Depends(require_admin)])
|
||||
async def get_llm_status():
|
||||
"""Read-only Status: aktives Backend, Modell, GPU-Auslastung, Dienste."""
|
||||
return await llm_status()
|
||||
|
||||
|
||||
# ── Aussprache-Lexikon CRUD ─────────────────────────────────────────────────
|
||||
|
||||
def _read_pronunciation(lang: str) -> dict:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue