Example

You can deploy an API by providing a project directory. Cortex will save the project directory and make it available during API initialization.

project/
  ├── model.py
  ├── util.py
  ├── handler.py
  ├── requirements.txt
  └── ...

You can define your Handler class in a separate python file and import code from your project.

# handler.py

from model import MyModel

class Handler:
    def __init__(self, config):
        model = MyModel()

    def handle_post(payload):
        return model(payload)

Deploy using the Python Client

Deploy using the CLI

Last updated