Skip to content

Commit 286d6ba

Browse files
authored
Merge pull request #102 from carlson-svg/main
Add human readable worker-config.json
2 parents 2111c9e + 8d734f8 commit 286d6ba

File tree

2 files changed

+947
-0
lines changed

2 files changed

+947
-0
lines changed

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Worker vLLM is now cached on all RunPod machines, resulting in near-instant depl
5858
- [Input Request Parameters](#input-request-parameters)
5959
- [Text Input Formats](#text-input-formats)
6060
- [Sampling Parameters](#sampling-parameters)
61+
- [Worker Config](#worker-config)
62+
- [Writing your worker-config.json](#writing-your-worker-configjson)
63+
- [Example of schema](#example-of-schema)
64+
- [Example of versions](#example-of-versions)
6165

6266
# Setting up the Serverless Worker
6367

@@ -514,3 +518,86 @@ Your list can contain any number of messages, and each message usually can have
514518
]
515519
```
516520

521+
</details>
522+
523+
# Worker Config
524+
The worker config is a JSON file that is used to build the form that helps users configure their serverless endpoint on the RunPod Web Interface.
525+
526+
Note: This is a new feature and only works for workers that use one model
527+
528+
## Writing your worker-config.json
529+
The JSON consists of two main parts, schema and versions.
530+
- `schema`: Here you specify the form fields that will be displayed to the user.
531+
- `env_var_name`: The name of the environment variable that is being set using the form field.
532+
- `value`: This is the default value of the form field. It will be shown in the UI as such unless the user changes it.
533+
- `title`: This is the title of the form field in the UI.
534+
- `description`: This is the description of the form field in the UI.
535+
- `required`: This is a boolean that specifies if the form field is required.
536+
- `type`: This is the type of the form field. Options are:
537+
- `text`: Environment variable is a string so user inputs text in form field.
538+
- `select`: User selects one option from the dropdown. You must provide the `options` key value pair after type if using this.
539+
- `toggle`: User toggles between true and false.
540+
- `number`: User inputs a number in the form field.
541+
- `options`: Specify the options the user can select from if the type is `select`. DO NOT include this unless the `type` is `select`.
542+
- `versions`: This is where you call the form fields specified in `schema` and organize them into categories.
543+
- `imageName`: This is the name of the Docker image that will be used to run the serverless endpoint.
544+
- `minimumCudaVersion`: This is the minimum CUDA version that is required to run the serverless endpoint.
545+
- `categories`: This is where you call the keys of the form fields specified in `schema` and organize them into categories. Each category is a toggle list of forms on the Web UI.
546+
- `title`: This is the title of the category in the UI.
547+
- `settings`: This is the array of settings schemas specified in `schema` associated with the category.
548+
549+
## Example of schema
550+
```json
551+
{
552+
"schema": {
553+
"TOKENIZER": {
554+
"env_var_name": "TOKENIZER",
555+
"value": "",
556+
"title": "Tokenizer",
557+
"description": "Name or path of the Hugging Face tokenizer to use.",
558+
"required": false,
559+
"type": "text"
560+
},
561+
"TOKENIZER_MODE": {
562+
"env_var_name": "TOKENIZER_MODE",
563+
"value": "auto",
564+
"title": "Tokenizer Mode",
565+
"description": "The tokenizer mode.",
566+
"required": false,
567+
"type": "select",
568+
"options": [
569+
{ "value": "auto", "label": "auto" },
570+
{ "value": "slow", "label": "slow" }
571+
]
572+
},
573+
...
574+
}
575+
}
576+
```
577+
578+
## Example of versions
579+
```json
580+
{
581+
"versions": {
582+
"0.5.4": {
583+
"imageName": "runpod/worker-v1-vllm:v1.2.0stable-cuda12.1.0",
584+
"minimumCudaVersion": "12.1",
585+
"categories": [
586+
{
587+
"title": "LLM Settings",
588+
"settings": [
589+
"TOKENIZER", "TOKENIZER_MODE", "OTHER_SETTINGS_SCHEMA_KEYS_YOU_HAVE_SPECIFIED_0", ...
590+
]
591+
},
592+
{
593+
"title": "Tokenizer Settings",
594+
"settings": [
595+
"OTHER_SETTINGS_SCHEMA_KEYS_0", "OTHER_SETTINGS_SCHEMA_KEYS_1", ...
596+
]
597+
},
598+
...
599+
]
600+
}
601+
}
602+
}
603+
```

0 commit comments

Comments
 (0)