Cortex Config Files
Deploying your model with Cortex is a fast and simple process, however, there are a few parameters to keep track of and you may not want to type them out every time you deploy. To make this process easier, Cortex supports the use of config files. Config files are YAML files that contain all of the parameters that you would normally pass to the CLI.
Using config files also makes it easier to keep track of your Cerebrium deployments, share them and use versioning tools such as git.
Using Config Files
To deploy your model with a config file, you can use the cortex deploy
command with the --config-file
flag to specify the path to your config file.
cerebrium deploy --config-file your_config_file.yaml
Your config file can be named anything you want and can be placed anywhere on your local machine. However, remember to use the cerebrium deploy
command in the same directory as your main.py as you would normally.
You can alternatively use the cerebrium init-cortex-project
command to generate your config file and setup a Cortex project in your desired directory. See here for more info.
Config File Format and Parameters
The parameters for your config file are the same as those which you would use for a normal cerebrium deploy
command. They’re tabulated below for your convenience:
Parameter | Description | Type | Default |
---|---|---|---|
name | Name of the deployment | string | |
api_key | API key for the deployment | string | not included for safety |
hardware | Hardware to use for the deployment | string | GPU |
log_level | Log level for the deployment | string | INFO |
include | Files to include in the deployment | string | ’[./*, main.py, requirements.txt, pkglist.txt, conda_pkglist.txt]’ |
exclude | Files to exclude from the deployment | string | ’[./., ./__]’ |
disable_animation | Whether to disable the animation in the logs. | boolean | false |
python_version | The Python version you would like to run | float | 3.9 |
min_replicas | The minimum number of replicas to run. | int | 0 |
max_replicas | The maximum number of replicas to scale to. | int | *plan limit |
Config File Example
%YAML 1.2
---
name: an-optional-name
api_key: an-optional-api-key
hardware: GPU
exclude: "[./.*, ./__*]"
include: "[./*, main.py, requirements.txt, pkglist.txt, conda_pkglist.txt]"
log_level: INFO
disable_animation: false
python_version: 3.9
min_replicas: 0
max_replicas: 30