Files

32 lines
746 B
Python
Raw Permalink Normal View History

import logging
import os
import psutil
from fastapi import APIRouter
from app.schemas.system import HealthResponse, SystemInfoResponse
from app.services import facefusion_bridge
logger = logging.getLogger(__name__)
router = APIRouter(prefix='/api/v1', tags=['system'])
@router.get('/health', response_model=HealthResponse)
async def health_check():
return HealthResponse()
@router.get('/system', response_model=SystemInfoResponse)
async def system_info():
providers = facefusion_bridge.get_execution_providers()
mem = psutil.virtual_memory()
return SystemInfoResponse(
execution_providers=providers,
cpu_count=os.cpu_count(),
memory_total=mem.total,
memory_available=mem.available,
)