Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dream-server/extensions/services/dashboard-api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def set(self, key: str, value: object, ttl: float):
_SERVICE_POLL_INTERVAL = 10.0 # background health check interval

# --- Router imports ---
from routers import workflows, features, setup, updates, agents, privacy, extensions, gpu as gpu_router, resources
from routers import workflows, features, setup, updates, agents, privacy, extensions, gpu as gpu_router, resources, voice

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -300,6 +300,7 @@ def get_allowed_origins():
app.include_router(extensions.router)
app.include_router(gpu_router.router)
app.include_router(resources.router)
app.include_router(voice.router)


# ================================================================
Expand Down
55 changes: 55 additions & 0 deletions dream-server/extensions/services/dashboard-api/routers/voice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""Voice services status endpoint (stub)."""

import logging

from fastapi import APIRouter, Depends

from security import verify_api_key

logger = logging.getLogger(__name__)

router = APIRouter(tags=["voice"])


@router.get("/api/voice/status")
async def voice_status(api_key: str = Depends(verify_api_key)):
"""Return voice services availability status.

Stub implementation — returns service health based on the existing
service health infrastructure. Full voice API is not yet implemented.
"""
from helpers import check_service_health
from config import SERVICES

services_status = {}
for svc_key, display_name in [("whisper", "stt"), ("tts", "tts")]:
cfg = SERVICES.get(svc_key)
if cfg:
try:
result = await check_service_health(svc_key, cfg)
services_status[display_name] = {"status": result.status}
except Exception:
logger.warning("Health check failed for %s", svc_key)
services_status[display_name] = {"status": "unavailable"}
else:
services_status[display_name] = {"status": "not_configured"}

# LiveKit is optional and not in SERVICES by default
livekit_cfg = SERVICES.get("livekit")
if livekit_cfg:
try:
result = await check_service_health("livekit", livekit_cfg)
services_status["livekit"] = {"status": result.status}
except Exception:
logger.warning("Health check failed for livekit")
services_status["livekit"] = {"status": "unavailable"}
else:
services_status["livekit"] = {"status": "not_configured"}

all_healthy = all(s.get("status") == "healthy" for s in services_status.values())

return {
"available": all_healthy,
"services": services_status,
"message": "All voice services operational" if all_healthy else "Some voice services unavailable",
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default function Dashboard({ status, loading }) {
label: 'VRAM',
value: `${status.gpu.vramUsed.toFixed(1)} GB`,
subvalue: `of ${status.gpu.vramTotal} GB`,
percent: (status.gpu.vramUsed / status.gpu.vramTotal) * 100,
percent: status.gpu.vramTotal > 0 ? (status.gpu.vramUsed / status.gpu.vramTotal) * 100 : 0,
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export default function Models() {
<div className="h-2 bg-theme-border rounded-full overflow-hidden">
<div
className={`h-full rounded-full transition-all ${
(gpu.vramUsed / gpu.vramTotal) > 0.9 ? 'bg-red-500' :
(gpu.vramUsed / gpu.vramTotal) > 0.7 ? 'bg-yellow-500' : 'bg-theme-accent'
(gpu.vramTotal > 0 ? gpu.vramUsed / gpu.vramTotal : 0) > 0.9 ? 'bg-red-500' :
(gpu.vramTotal > 0 ? gpu.vramUsed / gpu.vramTotal : 0) > 0.7 ? 'bg-yellow-500' : 'bg-theme-accent'
}`}
style={{ width: `${(gpu.vramUsed / gpu.vramTotal) * 100}%` }}
style={{ width: `${gpu.vramTotal > 0 ? (gpu.vramUsed / gpu.vramTotal) * 100 : 0}%` }}
/>
</div>
<p className="text-xs text-theme-text-muted mt-2">
Expand Down
Loading