Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Kirk Hadley
    Is there a way to include a config file with a model/api/deployment?
    I think I could probably go the custom image route, but seems like a lot of effort to include a single file
    David Eliahu

    Yes; Cortex makes all files in the project directory (i.e. the directory which contains cortex.yaml) available to pre and post inference handlers. There are a few file types that are excluded from this: any files and folders that start with ., Python generated files, and cortex.yaml are not passed through.

    The contents of the project directory are available in /mnt/project/ in the API containers. For example, if this is your project directory:

    ├── cortex.yaml
    ├── config.json
    ├── handler.py
    ├── ...
    └── requirements.txt

    You can access config.json in handler.py like this:

    import json
    with open('/mnt/project/config.json', 'r') as config_file:
      config = json.load(config_file)
    def pre_inference(sample, metadata):
    David Eliahu
    I just wanted to follow up - the docs for this are now live with today's release: https://www.cortex.dev/deployment-docs/request-handlers#project-files
    Hey, I couldn't see a Quickstart guide for Azure. Do you know if there is?
    Vishal Bollu
    We only support AWS at the moment @2008hsk