9e8f1bbeed
Dashboard / frontend (push) Failing after 0s
Dashboard / api (push) Failing after 0s
Lint PowerShell / powershell-lint (ubuntu-latest) (push) Failing after 1s
Python Lint / Lint Python with Ruff (push) Failing after 1s
ShellCheck / Lint shell scripts (push) Failing after 1s
Matrix Smoke / linux-smoke (push) Failing after 1s
Matrix Smoke / distro: cachyos (push) Failing after 15s
Matrix Smoke / distro: linux-mint-21.3 (push) Failing after 15s
Matrix Smoke / distro: debian-12 (push) Failing after 5m21s
Matrix Smoke / distro: fedora-41 (push) Failing after 4m56s
Matrix Smoke / distro: ubuntu-24.04 (push) Failing after 2m13s
Matrix Smoke / distro: rocky-9 (push) Failing after 10m39s
Matrix Smoke / distro: manjaro (push) Failing after 12m11s
Matrix Smoke / distro: opensuse-tw (push) Failing after 11m53s
Matrix Smoke / distro: archlinux (push) Failing after 20m3s
Matrix Smoke / distro: ubuntu-22.04 (push) Failing after 13m49s
Validate .env Schema / tier-1-env-validation (push) Successful in 52s
Validate .env Schema / tier-2-env-validation (push) Successful in 44s
Validate .env Schema / tier-3-env-validation (push) Successful in 52s
Validate .env Schema / tier-4-env-validation (push) Successful in 51s
Validate Extensions Catalog / Check catalog is up-to-date (push) Failing after 9m47s
Secret Scan / Scan for secrets (push) Failing after 21m4s
Validate Docker Compose / Validate Docker Compose files (push) Has been cancelled
Python Type Check / Type check with mypy (push) Has been cancelled
Validate .env Schema / tier-0-env-validation (push) Has been cancelled
Test Linux / integration-smoke (push) Has been cancelled
Lint PowerShell / powershell-lint (windows-latest) (push) Has been cancelled
Matrix Smoke / macos-smoke (push) Has been cancelled
201 lines
4.9 KiB
Python
201 lines
4.9 KiB
Python
"""Pydantic response models for ODS Dashboard API."""
|
|
|
|
from typing import Annotated, Any, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from config import GPU_BACKEND
|
|
|
|
|
|
class GPUInfo(BaseModel):
|
|
name: str
|
|
memory_used_mb: int
|
|
memory_total_mb: int
|
|
memory_percent: float
|
|
utilization_percent: int
|
|
temperature_c: int
|
|
power_w: Optional[float] = None
|
|
memory_type: str = "discrete"
|
|
gpu_backend: str = GPU_BACKEND
|
|
|
|
|
|
class ServiceStatus(BaseModel):
|
|
id: str
|
|
name: str
|
|
port: int
|
|
external_port: int
|
|
status: str # "healthy", "unhealthy", "unknown", "down", "not_deployed"
|
|
response_time_ms: Optional[float] = None
|
|
|
|
|
|
class DiskUsage(BaseModel):
|
|
path: str
|
|
used_gb: float
|
|
total_gb: float
|
|
percent: float
|
|
|
|
|
|
class ModelInfo(BaseModel):
|
|
name: str
|
|
size_gb: float
|
|
context_length: int
|
|
quantization: Optional[str] = None
|
|
|
|
|
|
class BootstrapStatus(BaseModel):
|
|
active: bool
|
|
model_name: Optional[str] = None
|
|
percent: Optional[float] = None
|
|
downloaded_gb: Optional[float] = None
|
|
total_gb: Optional[float] = None
|
|
speed_mbps: Optional[float] = None
|
|
eta_seconds: Optional[int] = None
|
|
|
|
|
|
class FullStatus(BaseModel):
|
|
timestamp: str
|
|
gpu: Optional[GPUInfo] = None
|
|
services: list[ServiceStatus]
|
|
disk: DiskUsage
|
|
model: Optional[ModelInfo] = None
|
|
bootstrap: BootstrapStatus
|
|
uptime_seconds: int
|
|
|
|
|
|
PortNumber = Annotated[int, Field(ge=1, le=65535)]
|
|
|
|
|
|
class PortCheckRequest(BaseModel):
|
|
ports: list[PortNumber]
|
|
|
|
|
|
class PortConflict(BaseModel):
|
|
port: int
|
|
service: str
|
|
in_use: bool
|
|
|
|
|
|
class PersonaRequest(BaseModel):
|
|
persona: str
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
message: str = Field(..., max_length=100000)
|
|
system: Optional[str] = Field(None, max_length=10000)
|
|
|
|
|
|
class VersionInfo(BaseModel):
|
|
current: str
|
|
latest: Optional[str] = None
|
|
update_available: bool = False
|
|
changelog_url: Optional[str] = None
|
|
checked_at: Optional[str] = None
|
|
|
|
|
|
class UpdateAction(BaseModel):
|
|
action: str # "check", "backup", "update"
|
|
|
|
|
|
class PrivacyShieldStatus(BaseModel):
|
|
enabled: bool
|
|
container_running: bool
|
|
port: int
|
|
target_api: str
|
|
pii_cache_enabled: bool
|
|
message: str
|
|
|
|
|
|
class PrivacyShieldToggle(BaseModel):
|
|
enable: bool
|
|
|
|
|
|
class IndividualGPU(BaseModel):
|
|
index: int
|
|
uuid: str
|
|
name: str
|
|
memory_used_mb: int
|
|
memory_total_mb: int
|
|
memory_percent: float
|
|
utilization_percent: int
|
|
temperature_c: int
|
|
power_w: Optional[float] = None
|
|
assigned_services: list[str] = []
|
|
|
|
|
|
class MultiGPUStatus(BaseModel):
|
|
gpu_count: int
|
|
backend: str # "nvidia", "amd", "apple"
|
|
gpus: list[IndividualGPU]
|
|
topology: Optional[dict] = None
|
|
assignment: Optional[dict] = None
|
|
split_mode: Optional[str] = None
|
|
tensor_split: Optional[str] = None
|
|
aggregate: GPUInfo
|
|
|
|
|
|
class AmdRuntimeStatus(BaseModel):
|
|
available: bool
|
|
reason: Optional[str] = None
|
|
runtime: str = "none"
|
|
location: str = "none"
|
|
runtimeMode: str = "unknown"
|
|
managedByODS: bool = False
|
|
selectedBackend: str = "none"
|
|
supportedBackends: list[str] = Field(default_factory=list)
|
|
defaultBackend: str = "none"
|
|
apiBase: Optional[str] = None
|
|
healthUrl: Optional[str] = None
|
|
health: Optional[str] = None
|
|
version: str = "unknown"
|
|
loadedModel: Optional[str] = None
|
|
modelCount: Optional[int] = None
|
|
capabilities: list[str] = Field(default_factory=list)
|
|
warnings: list[str] = Field(default_factory=list)
|
|
|
|
|
|
class ModelLibraryEntry(BaseModel):
|
|
id: str
|
|
name: str
|
|
gguf: Optional[str] = None
|
|
ggufParts: Optional[list[dict[str, Any]]] = None
|
|
downloadUrl: Optional[str] = None
|
|
downloadSha256: Optional[str] = None
|
|
llmModelName: Optional[str] = None
|
|
size: str
|
|
sizeGb: float
|
|
vramRequired: float
|
|
estimatedRequired: Optional[float] = None
|
|
contextLength: int
|
|
specialty: str
|
|
description: str
|
|
tokensPerSec: Optional[float] = None
|
|
tokensPerSecEstimate: Optional[float] = None
|
|
quantization: Optional[str] = None
|
|
architecture: Optional[str] = None
|
|
activeParamsB: Optional[float] = None
|
|
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
status: str # "loaded", "downloaded", "available"
|
|
recommended: bool = False
|
|
configured: bool = False
|
|
recommendation: Optional[dict[str, Any]] = None
|
|
fitsVram: bool
|
|
fitsCurrentVram: bool
|
|
performance: Optional[dict[str, Any]] = None
|
|
performanceLabel: Optional[str] = None
|
|
|
|
|
|
class ModelLibraryGpu(BaseModel):
|
|
vramTotal: float
|
|
vramUsed: float
|
|
vramFree: float
|
|
|
|
|
|
class ModelLibraryResponse(BaseModel):
|
|
models: list[ModelLibraryEntry]
|
|
gpu: Optional[ModelLibraryGpu] = None
|
|
currentModel: Optional[str] = None
|
|
loadedModel: Optional[str] = None
|
|
configuredModel: Optional[str] = None
|
|
recommendationPolicy: Optional[str] = None
|
|
recommendationAlternatives: list[dict[str, Any]] = Field(default_factory=list)
|