54 lines · 1.1 KB · TypeScript
RawDownload
import type { Backend as SharedBackend, RecipePayload } from "../../shared/src"; export type View = 'dashboard' | 'recipes' | 'status' | 'config'; export interface GPU {  index: number;  name: string;  memory_used: number;  memory_total: number;  utilization: number;  temperature: number;  power_draw: number;} export type Backend = SharedBackend; export type Recipe = Pick<  RecipePayload,  "id" | "name" | "model_path" | "backend" | "tensor_parallel_size" | "max_model_len">; export interface Status {  running: boolean;  launching: boolean;  model?: string;  backend?: string;  pid?: number;  port?: number;  error?: string;} export interface Config {  port: number;  inference_port: number;  models_dir: string;  data_dir: string;} export interface LifetimeMetrics {  total_tokens: number;  total_requests: number;  total_energy_kwh: number;} export interface AppState {  view: View;  selectedIndex: number;  gpus: GPU[];  recipes: Recipe[];  status: Status;  config: Config | null;  lifetime: LifetimeMetrics;  error: string | null;}