Type object
File match cog.yaml cog.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/cog-config-file/latest.json
Source https://raw.githubusercontent.com/replicate/cog/main/pkg/config/data/config_schema_v1.0.json

Versions

1.0

Validate with Lintel

npx @lintel/lintel check
Type: object

Defines how to build a Docker image and how to run predictions on your model inside that image.

Properties

build object

This stanza describes how to build the Docker image your model runs in.

10 nested properties
python_version string | number required

The minor (3.13) or patch (3.13.1) version of Python to use.

cuda string

Cog automatically picks the correct version of CUDA to install, but this lets you override it for whatever reason.

cudnn string

Cog automatically picks the correct version of cuDNN to install, but this lets you override it for whatever reason.

gpu boolean

Enable GPUs for this model. When enabled, the nvidia-docker base image will be used, and Cog will automatically figure out what versions of CUDA and cuDNN to use based on the version of Python, PyTorch, and Tensorflow that you are using.

python_packages array | null

A list of Python packages to install, in the format package==version.

pre_install array | null

A list of setup commands to run in the environment before your Python packages are installed.

python_requirements string

A pip requirements file specifying the Python packages to install.

system_packages array | null

A list of Ubuntu APT packages to install.

sdk_version string

Pin the cog Python SDK version installed in the container (e.g. "0.18.0" or "0.18.0a1"). Use "prerelease" to always install the latest pre-release. Defaults to latest stable. Overridden by the COG_SDK_WHEEL environment variable.

run array | null

A list of setup commands to run in the environment after your system packages and Python packages have been installed. If you're familiar with Docker, it's like a RUN instruction in your Dockerfile.

image string

The name given to built Docker images. If you want to push to a registry, this should also include the registry name.

predict string

The pointer to the Predictor object in your code, which defines how predictions are run on your model.

train string

The pointer to the Predictor object in your code, which defines how predictions are run on your model.

concurrency object

The concurrency settings for the model.

2 nested properties
max integer required

The maximum number of concurrent predictions.

default_target integer

The default target for number of concurrent predictions. This setting can be used by an autoscaler to determine when to scale a deployment of a model up or down.

environment array | null

A list of environment variables to make available during builds and at runtime, in the format NAME=value

weights array | null

A list of weight files or directories to include in the model.