chore: playground mutilmodel input

This commit is contained in:
jialin
2024-08-16 12:03:48 +08:00
parent 0a47c4c067
commit 1d92571d09
48 changed files with 1350 additions and 68 deletions
@@ -0,0 +1,8 @@
import { createContext } from 'react';
import { DashboardProps } from './types';
export const DashboardContext = createContext<
DashboardProps & { fetchData: () => Promise<void> }
>({} as DashboardProps & { fetchData: () => Promise<void> });
export default DashboardContext;
+23
View File
@@ -0,0 +1,23 @@
export const overviewConfigs = [
{
key: 'worker_count',
label: 'dashboard.workers',
backgroundColor: 'var(--color-white-1)'
},
{
key: 'gpu_count',
label: 'dashboard.totalgpus',
backgroundColor: 'var(--color-white-1)'
},
{
key: 'model_count',
label: 'dashboard.models',
backgroundColor: 'var(--color-white-1)'
},
{
key: 'model_instance_count',
label: 'models.form.replicas',
backgroundColor: 'var(--color-white-1)'
}
];
+46
View File
@@ -0,0 +1,46 @@
export interface DashboardProps {
resource_counts: {
worker_count: number;
gpu_count: number;
model_count: number;
model_instance_count: number;
};
system_load: {
current: {
cpu: number;
memory: number;
gpu: number;
gpu_memory: number;
};
history: {
cpu: {
timestamp: number;
value: number;
}[];
memory: {
timestamp: number;
value: number;
}[];
gpu: {
timestamp: number;
value: number;
}[];
gpu_memory: {
timestamp: number;
value: number;
}[];
};
};
model_usage: {
api_request_history: any[];
completion_token_history: any[];
prompt_token_history: any[];
top_users: {
user_id: number;
username: string;
prompt_token_count: number;
completion_token_count: number;
}[];
};
active_models: any[];
}