# Cog

> Containers for machine learning

Source: https://talira.ai/catalog/cog-9s4m11ph
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [ai / inference / model serving](https://talira.ai/categories/ai/inference/model-serving)
- Platforms: macos, linux, cli[^3]
- Licence: Apache-2.0[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes
- API: yes[^3]
- Backed by: [Replicate](https://talira.ai/orgs/replicate.md)
- Funding: acquired by Cloudflare (2025)[^4]

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](https://talira.ai/catalog/replicate-w70p490a.md), whose team makes it. It needs Docker and runs on macOS, Linux and Windows 11 through WSL 2.

## Links

- Website: https://cog.run/
- GitHub: https://github.com/replicate/cog
- Docs: https://cog.run/

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/cog>[^1]

## 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

## Trust

Overall: 0.66 out of 1.
Signals: maintenance 0.68, adoption 0.80, momentum 0.65, community 0.79, backing 0.55, extensibility 0.40.

- last commit today
- 12 commits in the last 90 days
- latest release v0.23.1 34 days ago
- 9.5k GitHub stars
- 95 contributors
- backed by Replicate
- funding: acquired by Cloudflare (2025)

## Related

- Works with [Replicate](https://talira.ai/catalog/replicate-w70p490a.md)

## Alternatives

- [Ray Serve](https://talira.ai/catalog/ray-serve-aegjvek5.md): Scalable model serving library for building online inference APIs
- [Replicate](https://talira.ai/catalog/replicate-w70p490a.md): Run AI with an API: run, fine-tune and deploy models with one line of code
- [NVIDIA Dynamo-Triton](https://talira.ai/catalog/nvidia-dynamo-triton-fng441hm.md): Open source inference serving software that deploys AI models from any major framework

## Sources

[^1]: https://formulae.brew.sh/api/formula/cog.json (checked 24 Nov 2026)
[^2]: https://github.com/replicate/cog/blob/main/LICENSE (checked 24 Nov 2026)
[^3]: https://cog.run/ (checked 24 Nov 2026)
[^4]: https://blog.cloudflare.com/why-replicate-joining-cloudflare/ (checked 24 Nov 2026)
