Introduction

This document is for users who have been using Cerebrium for a while and are familiar with the legacy YAML config file format. If you are new to Cerebrium, please refer to the initial setup guide.

Your legacy YAML config file can be converted to a toml config file by answering yes to the prompt when you run cerebrium deploy as normal. This will create a cerebrium.toml file in your project directory which you can then edit as you wish. Additionally, all the dependencies in your pkglist.txt and conda_pkglist.txt files will be added to the cerebrium.toml file automatically

Legacy Folder Structure

Cortex supports the use of config YAML files to configure various aspects of your project such as hardware requirements, memory and much more. Using config files makes it easier to keep track of your Cerebrium deployments, share them and use git versioning to show changes over time.

project_name/
├── main.py
├── requirements.txt
├── pkglist.txt
├── conda_pkglist.txt
└── config.yaml

To deploy your model with a specific config file, you can use the cerebrium deploy command with the --config-file flag to specify the path to your config file. Otherwise cerebrium deploy will use the config.yaml (if there is no cerebrium.toml) in the file directory.
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.

Deploying your model with a config file is as simple as:

cerebrium deploy

Config File Format and Parameters

The parameters for your config file are the same as those which you would use as flags for a normal cerebrium deploy command. They’re tabulated below for your convenience:

ParameterDescriptionTypeDefault
nameName of the deploymentstring
api_keyAPI key for the deploymentstringnot included for safety
hardwareHardware to use for the deploymentstringGPU
gpu_countThe number of GPUs to specifyint2
cpuThe number of CPU cores to useint2
memoryThe amount of Memory to use in GBint14.5
log_levelLog level for the deploymentstringINFO
includeLocal files to include in the deploymentstring’[./*, main.py, requirements.txt, pkglist.txt, conda_pkglist.txt]’
excludeLocal Files 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 to.int*plan limit
cooldownThe number of seconds to keep your model warm after each request. It resets after every requestint60

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