chore: compatibility api

This commit is contained in:
jialin
2025-03-31 16:21:40 +08:00
parent f9469a1ea3
commit bd6c689d91
24 changed files with 848 additions and 374 deletions
+22
View File
@@ -439,3 +439,25 @@ export const modelLabels = [
{ label: 'reranker', value: 'reranker' },
{ label: 'Embedding', value: 'embedding_only' }
];
export const CHECK_FIELDS = new Set([
'backend',
'local_path',
'scheduleType',
'placement_strategy',
'worker_selector',
'gpu_selector',
'backend_parameters',
'backend_version',
'quantization',
'size'
]);
export const excludeFields = [
'replicas',
'categories',
'name',
'description',
'env',
'source'
];
+37
View File
@@ -175,3 +175,40 @@ export interface CatalogSpec {
quantization: string;
size: number;
}
export interface EvaluateSpec {
source?: string;
huggingface_repo_id?: string;
huggingface_filename?: string;
ollama_library_model_name?: string;
model_scope_model_id?: string;
model_scope_file_path?: string;
local_path?: string;
name?: string;
description?: string;
meta?: Record<string, any>;
replicas?: number;
ready_replicas?: number;
categories?: any[];
placement_strategy?: string;
cpu_offloading?: boolean;
distributed_inference_across_workers?: boolean;
worker_selector?: Record<string, any>;
gpu_selector?: {
gpu_ids: string[];
};
backend?: string;
backend_version?: string;
backend_parameters?: any[];
env?: Record<string, any>;
distributable?: boolean;
quantization?: string;
size?: number;
}
export interface EvaluateResult {
compatible: boolean;
compatibility_messages: string[];
scheduling_messages: string[];
default_backend_parameters: any[];
}