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 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:

nameName of the deploymentstring
api_keyAPI key for the deploymentstringnot included for safety
hardwareHardware to use for the deploymentstringGPU
log_levelLog level for the deploymentstringINFO
includeFiles to include in the deploymentstring’[./*,, requirements.txt, pkglist.txt, conda_pkglist.txt]’
excludeFiles to exclude from the deploymentstring’[./., ./__]’
disable_animationWhether to disable the animation in the logs.booleanfalse
python_versionThe Python version you would like to runfloat3.9
min_replicasThe minimum number of replicas to run.int0
max_replicasThe maximum number of replicas to scale*plan limit

Config File Example

%YAML 1.2
name: an-optional-name
api_key: an-optional-api-key
hardware: GPU
exclude: "[./.*, ./__*]"
include: "[./*,, requirements.txt, pkglist.txt, conda_pkglist.txt]"
log_level: INFO
disable_animation: false
python_version: 3.9
min_replicas: 0
max_replicas: 30