This example is only compatible with CLI v1.20 and later. Should you be making
use of an older version of the CLI, please run
pip install --upgrade cerebrium to upgrade it to the latest version.Basic Setup
Developing on Cerebrium is similar to a virtual machine or Google Colab. Install the Cerebrium package and log in before proceeding. See the installation docs for details. First, create your project:[cerebrium.dependencies.pip] section in your cerebrium.toml file:
main.py file. This implementation fits in a single file. Start by defining the request object:
prompt parameter is required; others are optional with default values. A missing prompt triggers an automatic error message.
vLLM Implementation
Model Setup
predict function since it only needs to load once at startup. The predict function passes input parameters from the request to the model and returns generated outputs.
Deploy
Configure your compute and environment settings incerebrium.toml: