# replicate/cog

Containers for machine learning

Repository: https://github.com/replicate/cog
Canonical: https://ross.abutalabs.com/products/cog
Homepage: https://cog.run
Language: Go
License: Apache-2.0
License Family: permissive
Topics: containers, cuda, docker, machine-learning, pytorch, tensorflow, ai
Last push: 2026-08-26T23:08:57+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 85, longevity 100
- inputs: {"age_days": 2014, "days_push": 7, "days_rel": 20, "gap_med": 5, "n_releases_24m": 66}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9463, forks 696 (observed 2026-08-28T04:10:31.256042+00:00)

## What it is
Cog is an open-source CLI tool that packages machine learning models into production-ready Docker containers using a simple cog.yaml configuration and a Python run interface. It automatically resolves CUDA/cuDNN/framework compatibility, generates an OpenAPI schema, and serves the model via an auto-generated HTTP inference API.

## Use cases
- package a machine learning model into a docker container
- avoid writing dockerfiles and fixing cuda version conflicts for pytorch models
- serve a model behind a rest http api
- deploy a trained model to my own gpu infrastructure
- run model inference in a reproducible environment
- build a container image for a model to deploy anywhere docker runs
- define model inputs and outputs with python type hints

## When to choose
- you want to containerize PyTorch or TensorFlow models without hand-writing Dockerfiles
- you need a standard, reproducible way to package and serve ML models
- you want an automatic HTTP inference server with input validation
- you plan to deploy models to Replicate or any Docker-capable host

## When to avoid
- you need to serve non-ML web applications rather than models
- you don't use Docker or can't run containers on your infrastructure
- you need a lightweight solution without container overhead
- your models aren't in Python

## Facets
- artifact type: cli-tool
- maturity: active
- function: machine-learning, deployment, container-runtime, http-server, api-framework, developer-tools
- domain: machine-learning, deep-learning, developer-tools
- platform: windows, cli, python, go
- tags: docker, cuda, gpu, pytorch, tensorflow, model-packaging, inference-server, openapi, replicate, containers, devops, linux, macos

## Member repositories
- replicate/cog (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:31.256042+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:22:05.755391+00:00, confidence not recorded.
  - readme: https://github.com/replicate/cog (fetched 2026-08-28T04:10:31.256042+00:00, sha 7a86103f2568)
  - homepage: https://cog.run (fetched 2026-08-29T08:21:59.735071+00:00, sha 1522f3bec325)
  - site_page: https://cog.run/getting-started-own-model (fetched 2026-08-29T08:21:59.746669+00:00, sha bbc7d1ce8a02)
  - site_page: https://cog.run/getting-started (fetched 2026-08-29T08:21:59.744673+00:00, sha ec52f19813fc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
