Containers for machine learning
open sourceApache-2.0self-hostablefree
Cog packages machine learning models in standard, production-ready Docker containers. You describe the environment in a cog.yaml file (GPU, system packages, Python version and requirements) and the model's inputs and outputs in ordinary Python, and Cog builds an image with Nvidia base images, cached dependencies and compatible CUDA, cuDNN, PyTorch and TensorFlow versions. It generates an OpenAPI schema, validates inputs and outputs, and serves the model through an HTTP inference server written in Rust on Axum. Images run anywhere Docker does, or on Replicate, whose team makes it. It needs Docker and runs on macOS, Linux and Windows 11 through WSL 2.
Ways to install
Package managers
Problems it solves
- package a machine learning model in a standard, production-ready container
- stop fighting CUDA, cuDNN and PyTorch version mismatches when I containerise a model
- put an HTTP API in front of my PyTorch model without writing a web server
- write a Dockerfile for a GPU model without learning every best practice
- ship a model as a Docker image my ops team can run anywhere
Features
- cog.yaml to define the environment, with GPU and Python version
- Docker images with Nvidia base images and cached dependencies
- picks compatible CUDA, cuDNN, PyTorch and TensorFlow versions
- generated OpenAPI schema with input and output validation
- HTTP inference server in Rust on Axum, plus a training API
- cog run and cog build commands
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Has official SDKs | plan not known |
Alternatives
The same job
These do what Cog does.
- Ray Serve Scalable model serving library for building online inference APIs
- Replicate Run AI with an API: run, fine-tune and deploy models with one line of code
- NVIDIA Dynamo-Triton Open source inference serving software that deploys AI models from any major framework