Cog
$ cog Official Med RiskCog (cog) packages Python ML/AI models into reproducible, CUDA-matched Docker containers with an automatic OpenAPI/JSON HTTP prediction server. The Go CLI handles project scaffolding (cog init), local inference (cog predict -i ...), image builds (cog build), and registry pushes (cog push).
brew install cog cog builds local Docker images from cog.yaml and runs containerized GPU/CPU predictions on the host Docker daemon.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Single-binary Go CLI with --no-color, --debug, non-interactive -i key=val inputs on cog predict, and OpenAPI JSON schema generation.
- Global
--no-colorflag and non-interactivecog predict -i ... - Generates OpenAPI JSON schemas automatically for predictors
Runs predictions inside Docker containers; cog build stays local while cog push is explicit.
- Containerized execution; explicit separation between
buildandpush
Easy install via brew install cog or binary release on macOS and Linux, though Docker daemon is required.
- Single Go binary distributed via Homebrew (
brew install cog)
Eliminates CUDA/cuDNN dependency hell via declarative cog.yaml and --separate-weights layer caching.
cog.yamlhandles CUDA/Python matrix and--separate-weights
Official Replicate (replicate/cog) tool under Apache-2.0 license.
- Official
replicate/cogrepository (Apache-2.0)
Concise, well-maintained docs at cog.run and clean Go CLI --help output.
- Official docs at cog.run
Security, Auth & Guardrails
cog login stores Replicate/Docker registry credentials in ~/.docker/config.json; local cog build and cog predict need no auth.
Apache-2.0 open-source CLI from Replicate; requires Docker locally and a Replicate/OCI registry account only for cog push.
# Cog Agent Rules - Pass `--no-color` for clean log capture and verify Docker is running before `cog build` or `cog predict`. - Never run `cog push` without explicit user approval and target registry confirmation.
Agent-Ready Command Recipes
Safe Read-Only Queries
cog --help && cog build --help
Prints global --no-color, --debug, and cog build options without invoking Docker.
cog predict -i prompt="hello world" --no-color
Builds/runs the local cog.yaml container once and prints the prediction output cleanly.
Controlled Writes & Previews
cog build -t my-model:local --no-color
Compiles cog.yaml into a local Docker image tagged my-model:local without pushing remotely.
Strengths for Agents
- + Clean Go CLI with
--no-color, declarativecog.yaml, and automatic OpenAPI schema generation. - +
cog predict -i key=valruns deterministic local containerized inference in one command.
Caveats & Pitfalls
- ! Requires a running Docker daemon (and NVIDIA Container Toolkit for local GPUs).
- ! Docker image builds for CUDA ML models can consume tens of gigabytes of disk space.