feat: add parameter format and common parameters to backend configuration
This commit is contained in:
@@ -119,6 +119,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
|
||||
onSubmit({
|
||||
...values,
|
||||
parameter_format:
|
||||
values.parameter_format === 'auto' || !values.parameter_format
|
||||
? null
|
||||
: values.parameter_format,
|
||||
default_version: defaultVersion?.version_no || '',
|
||||
// @ts-ignore
|
||||
version_configs: versionConfigs
|
||||
@@ -155,6 +159,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
return {
|
||||
...values,
|
||||
backend_name: values.backend_name.replace(/-custom$/, ''),
|
||||
parameter_format: values.parameter_format ?? 'auto',
|
||||
version_configs: versionConfigs,
|
||||
built_in_version_configs: builtInVersions
|
||||
};
|
||||
|
||||
@@ -198,6 +198,8 @@ export const customBackendFields = [
|
||||
'default_run_command',
|
||||
'version_configs',
|
||||
'default_backend_param',
|
||||
'parameter_format',
|
||||
'common_parameters',
|
||||
'default_env'
|
||||
];
|
||||
|
||||
@@ -208,6 +210,8 @@ export const builtInBackendFields = [
|
||||
'description',
|
||||
'version_configs',
|
||||
'default_backend_param',
|
||||
'parameter_format',
|
||||
'common_parameters',
|
||||
'default_env'
|
||||
];
|
||||
|
||||
@@ -293,6 +297,10 @@ default_version: v0.11.0
|
||||
health_check_path: /v1/models
|
||||
default_backend_param:
|
||||
- --host
|
||||
parameter_format: space
|
||||
common_parameters:
|
||||
- --max-model-len
|
||||
- --gpu-memory-utilization
|
||||
default_run_command: "{{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}"
|
||||
default_env:
|
||||
version_configs:
|
||||
|
||||
@@ -26,6 +26,18 @@
|
||||
},
|
||||
"description": "default backend parameter"
|
||||
},
|
||||
"parameter_format": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["space", "equal", null],
|
||||
"description": "parameter output format: 'space' -> --key value, 'equal' -> --key=value"
|
||||
},
|
||||
"common_parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "commonly used parameters shown as hints in deployment UI"
|
||||
},
|
||||
"default_run_command": {
|
||||
"type": ["string", "null"],
|
||||
"description": "default start command"
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
},
|
||||
"description": "default backend parameter"
|
||||
},
|
||||
"parameter_format": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["space", "equal", null],
|
||||
"description": "parameter output format: 'space' -> --key value, 'equal' -> --key=value"
|
||||
},
|
||||
"common_parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "commonly used parameters shown as hints in deployment UI"
|
||||
},
|
||||
"default_run_command": {
|
||||
"type": ["string", "null"],
|
||||
"description": "default start command"
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
},
|
||||
"description": "default backend parameter"
|
||||
},
|
||||
"parameter_format": {
|
||||
"type": ["string", "null"],
|
||||
"enum": ["space", "equal", null],
|
||||
"description": "parameter output format: 'space' -> --key value, 'equal' -> --key=value"
|
||||
},
|
||||
"common_parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "commonly used parameters shown as hints in deployment UI"
|
||||
},
|
||||
"default_run_command": {
|
||||
"type": ["string", "null"],
|
||||
"description": "default start command"
|
||||
|
||||
@@ -28,6 +28,8 @@ export interface FormData {
|
||||
enabled?: boolean;
|
||||
backend_source?: string;
|
||||
default_env?: Record<string, any>;
|
||||
parameter_format?: 'space' | 'equal' | 'auto' | null;
|
||||
common_parameters?: string[];
|
||||
}
|
||||
|
||||
export interface ListItem extends FormData {
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
Input as CInput,
|
||||
LabelSelector,
|
||||
ListInput,
|
||||
Select as SealSelect,
|
||||
Textarea as SealTextArea,
|
||||
useAppUtils
|
||||
} from '@gpustack/core-ui';
|
||||
@@ -148,6 +149,46 @@ const BasicForm = () => {
|
||||
})}
|
||||
></ListInput>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="parameter_format"
|
||||
initialValue="auto"
|
||||
rules={[{ required: false }]}
|
||||
>
|
||||
<SealSelect
|
||||
label={intl.formatMessage({ id: 'backend.form.parameterFormat' })}
|
||||
options={[
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
id: 'backend.form.parameterFormat.default'
|
||||
}),
|
||||
value: 'auto'
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
id: 'backend.form.parameterFormat.space'
|
||||
}),
|
||||
value: 'space'
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({
|
||||
id: 'backend.form.parameterFormat.equal'
|
||||
}),
|
||||
value: 'equal'
|
||||
}
|
||||
]}
|
||||
></SealSelect>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData>
|
||||
name="common_parameters"
|
||||
rules={[{ required: false }]}
|
||||
>
|
||||
<ListInput
|
||||
btnText={intl.formatMessage({ id: 'backend.form.addParameter' })}
|
||||
label={intl.formatMessage({
|
||||
id: 'backend.form.commonParameters'
|
||||
})}
|
||||
></ListInput>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="default_env">
|
||||
<LabelSelector
|
||||
label={intl.formatMessage({
|
||||
|
||||
Reference in New Issue
Block a user