Skip to content

Releases: replicate/cog

v0.19.1

30 Apr 19:21
a336854

Choose a tag to compare

Bug fixes

  • Support for TypedDict in schema generation. Fixed an issue where TypedDict type annotations would cause schema generation to fail. (#2978)
  • Build order fix for resource exhaustion. Reordered coglet wheel build to run after cog/sdk builds to prevent resource exhaustion during release builds. (#2977)

Maintenance

  • Removed dead Go code. Cleaned up unused code identified by deadcode analysis. (#2979)
  • Removed accidentally committed folder. Deleted a folder that shouldn't have been in the repository. (#2972)
  • CI lockfile improvements. Switched to strict lockfile mode and regenerated mise.lock. (#2975)

Dependencies

  • Updated golang.org/x/crypto from 0.49.0 to 0.50.0 (#2965)
  • Updated golang.org/x/term from 0.41.0 to 0.42.0 (#2933)
  • Updated google.golang.org/grpc from 1.79.3 to 1.80.0 (#2967)
  • Updated rand from 0.8.5 to 0.8.6 in /crates (#2958)

v0.19.0

27 Apr 17:05
aea7995

Choose a tag to compare

New features

  • cog doctor command. Diagnose common Cog setup issues, check configuration, and verify that everything is working correctly. Run cog doctor to validate your environment. (#2923)

Improvements

  • Static schema generation is now the default. Cog now generates prediction schemas statically from your predictor's type annotations rather than importing and inspecting the Python code at build time. This makes builds faster and more reliable. Use COG_LEGACY_SCHEMA=1 to opt out if you encounter issues. (#2950)
  • Test harness improvements. The Cog integration test harness now runs tests in parallel and provides better error reporting. (#2944)

Bug fixes

  • Separate-weights builds with r8.im image names work correctly. Schema validation no longer fails when building with separate weights and using r8.im/... image names. (#2954)
  • Static schema generation handles more edge cases. Fixed issues with certain type annotation patterns in static schema generation. (#2948)
  • Secret = Input(default=None) is treated as optional. Secret inputs with None defaults are now correctly identified as optional in the generated schema. (#2949)

v0.18.0

15 Apr 22:56
4f709e7

Choose a tag to compare

Breaking changes

  • cog run is now cog exec. cog run still works as a hidden alias with a deprecation warning -- existing scripts won't break yet, but update them. (#2916)

Bug fixes

  • async def setup() actually runs now. In 0.17.x, async setup coroutines were silently dropped -- setup appeared to succeed but none of the code executed, causing AttributeError on every prediction. (#2921)
  • Async setup shares the event loop with predict. Models that create event-loop-bound resources in setup() (httpx clients, aiohttp sessions, asyncio queues) no longer crash because setup and predict run on different loops. (#2927)
  • dict and list[dict] work as input types. These were supported as outputs but rejected as inputs, breaking chat-style message inputs. (#2928)
  • list[X] | None works as an input type. The type system only had Required, Optional, and Repeated -- not optional-and-repeated. Both the Python SDK and Go schema generator now handle this correctly. (#2882)
  • Unknown prediction inputs are dropped instead of rejected. Coglet was returning 422 for unrecognized input fields, breaking backwards compatibility when models upgraded to new Cog. Unknown fields are now silently stripped and logged at warn level. (#2943)
  • Metrics bugs in coglet. Fixed precision loss for large integer increments, empty/malformed metric key panics, missing metrics in error/cancel responses, and inconsistent metrics in state snapshots. (#2896)

Improvements

  • Push progress during image export. cog push now shows status during the docker save phase instead of sitting silent while large images export to disk. (#2797)
  • Metric name validation. record_metric() enforces naming rules -- must start with a letter, no consecutive underscores, max 128 chars, max 4 segments. predict_time and the cog. prefix are reserved. (#2911)

v0.17.2

02 Apr 01:19
1cada76

Choose a tag to compare

Changelog

  • 278623a Add OpenCode reviewer skills and agent configuration (#2880)
  • 1cada76 Bump version to 0.17.2 (#2903)
  • 32cce86 bonk code reviews (#2892)
  • e5535bc chore(deps): bump github.com/docker/cli (#2885)
  • 86e2ec2 chore(deps): bump ureq from 3.2.0 to 3.3.0 in /crates (#2888)
  • 8e24f2a chore: remove unnecessary nolint directive in test (#2803)
  • 49d4daf feat(coglet): add Sentry error reporting for infrastructure errors (#2865)
  • 98f6ad2 fix(coglet): propagate metric scope to async event loop thread (#2902)
  • c354ae9 fix: address review issues in static schema generation (#2805)
  • 4330638 fix: clarify env variable deny-list error message (#2813)
  • 482b4ac fix: generate brew style-compliant cask in homebrew-tap workflow (#2898)
  • 8f142dd fix: homebrew cask postflight xattr references wrong binary name (#2899)
  • f3eaa07 fix: include custom metrics in cog predict --json output (#2897)
  • 1c88d5e fix: remove mise python venv config to silence warnings (#2879)
  • b43abea fix: replace deprecated library usage patterns (#2798)
  • 6ccf980 fix: support PEP 604 unions in File/Path coercion detection (#2878)
  • fd53328 fix: use atomic rename in setup_subprocess_double_fork test to prevent race condition (#2815)
  • 81bf6d0 fix: use signal.NotifyContext for container cleanup on SIGINT/SIGTERM (#2808)
  • f5cfe71 refactor: extract homebrew tap into standalone reusable workflow (#2881)

v0.17.1

27 Mar 18:45
eeef241

Choose a tag to compare

Changelog

  • 635fffb fix: don't coerce URL strings in str-typed inputs (regression #2868) (#2872)
  • 893e631 review: replace string tags with FieldKind enum, add Debug derives, remove redundant test assertion (#2874)

v0.17.0

25 Mar 23:36

Choose a tag to compare

This is a big release. The prediction server has been rewritten in Rust, Pydantic dependency conflicts are a thing of the past, and several long-requested QoL features are here. We've tested extensively against models on Replicate and the vast majority work without any changes. Under the hood, though, this is the foundation for what's coming next. A few things did change... see the breaking changes section at the bottom.

Highlights

New prediction server (coglet)

The Python HTTP server that ran inside Cog containers has been replaced with a Rust-based server called coglet. It uses a two-process architecture -- a Rust parent handling HTTP and orchestration, and a Python worker subprocess running your predict function. You don't need to change anything in your code. Predictions are faster to start, the server handles concurrency better, and worker crashes no longer take down the whole container. More importantly, this is the runtime we'll be building on -- it unlocks things like native streaming, smarter scheduling, and tighter hardware integration that weren't possible with the old Python server.

Custom metrics API

You can now emit custom metrics from your predict function:

from cog import current_scope

def predict(self, prompt: str) -> str:
    scope = current_scope()
    scope.record_metric("tokens_generated", 128)
    scope.record_metric("timing.inference", 0.42)
    ...

Metrics appear in the prediction response alongside predict_time. Supports "replace" (default), "incr", and "append" accumulation modes. Dot-path keys create nested objects.

User-defined healthcheck

Add a healthcheck() method to your Predictor to inject custom validation into the /health-check endpoint:

def healthcheck(self) -> bool:
    # check GPU is responsive, weights are loaded, etc.
    return True

Runs with a 5-second timeout, even when the model is busy processing predictions.

Per-prediction context

Callers can now pass a context dict with prediction requests, accessible in your predict function via current_scope().context. Useful for forwarding metadata like API tokens, region hints, or prediction IDs without changing your function signature.

Pydantic removed from default stack

Cog's type system was built on Pydantic, which meant the SDK pinned a specific Pydantic version in every container. If a package you depended on needed a different version, you were stuck. That's gone now -- cog.BaseModel is a standard Python dataclass, and Pydantic isn't installed at all unless you add it yourself. The API is unchanged (class Output(BaseModel): text: str still works), and if your predict function returns a Pydantic model it'll still be serialized correctly.

Multi-registry support

cog push and cog login now work with any OCI-compliant registry -- GHCR, GCR, ECR, Docker Hub, self-hosted. The provider is selected automatically based on the registry host in your image name.

SDK version decoupling

New build.sdk_version field in cog.yaml lets you pin the Python SDK version independently from the CLI:

build:
  sdk_version: "0.16.6"

Omit it to get the latest stable release. Set "prerelease" to opt into pre-release builds. Minimum supported version is 0.16.0.

Faster image pushes

cog push can now upload layers directly to the registry in parallel with automatic chunking (96 MB chunks, 5 concurrent uploads), blob deduplication, and retry with exponential backoff. Set COG_PUSH_OCI=1 to enable. Falls back to docker push if anything goes wrong.

uv for package management

Dockerfiles now use uv instead of pip for faster, more reliable dependency installation inside containers.

Setup timeout changes

The old hardcoded 5-minute setup timeout has been removed. You can now configure your own timeout with the COG_SETUP_TIMEOUT environment variable (in seconds). If unset, there's no internal timeout.

Pretty CLI output

CLI output now uses color-coded prefixes ( green for success, yellow for warnings, red for errors) and auto-detects color support from TTY/environment. Use --no-color or NO_COLOR=1 to disable.


Breaking changes

  • python_version is now required in the build: section of cog.yaml. Builds fail with a clear error if it's missing. Add python_version: "3.13" (or 3.10/3.11/3.12).
  • Python 3.8 and 3.9 are no longer supported. Minimum is 3.10.
  • Pydantic is no longer installed by default. If you depend on it, add it to your python_packages.
  • cog train is deprecated. It still works but prints a warning. Will be removed in a future release so we can replace it with something better.
  • emit_metric() is deprecated in favor of current_scope().record_metric(). The old function still works as a compat shim.

v0.17.0-rc.4

24 Mar 22:03

Choose a tag to compare

v0.17.0-rc.4 Pre-release
Pre-release

Changelog

  • a55abe5 Bump version to 0.17.0-rc.4
  • 7b1bc3f Fix rendering issues in architecture docs (#2861)
  • 84f2c89 Support sdk_version: "prerelease" sentinel in cog.yaml (#2862)

v0.17.0-rc.3

24 Mar 15:54

Choose a tag to compare

v0.17.0-rc.3 Pre-release
Pre-release

Changelog

  • 16b6d50 Add VERSION.txt as canonical version source (#2858)
  • 8d7d405 Bump version to 0.17.0-rc.3
  • 3b814d6 Update architecture docs to match the codebase (#2856)
  • 74856a7 chore(deps): bump actions/create-github-app-token from 2 to 3 (#2840)
  • f42aa3b chore(deps): bump docker/login-action from 3 to 4 (#2823)
  • 4790a89 chore(deps): bump github.com/moby/buildkit from 0.22.0 to 0.28.0 (#2822)
  • 401cc83 chore(deps): bump golang.org/x/sys from 0.41.0 to 0.42.0 (#2820)
  • 0e4ab38 chore(deps): bump golang.org/x/term from 0.40.0 to 0.41.0 (#2841)
  • 3234d0c chore(deps): bump google.golang.org/grpc from 1.79.1 to 1.79.3 (#2849)
  • 902c5ea chore(deps): bump jdx/mise-action from 3 to 4 (#2833)
  • 85342d1 chore(deps): bump rustls-webpki from 0.103.9 to 0.103.10 in /crates (#2859)
  • 019b890 chore(deps): bump tokio from 1.49.0 to 1.50.0 in /crates (#2835)
  • dad7f08 chore(deps): bump uuid from 1.21.0 to 1.22.0 in /crates (#2836)
  • 3867490 chore: add cargo ecosystem to dependabot config (#2830)
  • da6f756 feat(coglet): restore GET / root discovery endpoint (#2846)
  • ec70f54 feat(coglet): restore Scope.context for per-prediction context (#2853)
  • 1d69171 feat: add model test harness for validating cog SDK releases (#2851)
  • d69b763 fix(ci): handle merge_group events in change detection (#2839)
  • 4944290 fix(sdk): restore emit_metric as deprecated compat shim (#2850)
  • 6361ba9 fix: harden flaky integration timing and signal assertions (#2847)
  • e86ab49 refactor: use testify assertions in integration tests (#2848)

v0.17.0-rc.2

12 Mar 21:49

Choose a tag to compare

v0.17.0-rc.2 Pre-release
Pre-release

Changelog

  • 5ed0cee chore: bump version to 0.17.0-rc.2
  • d8769d2 fix: add -R flag to gh release download in publish workflow (#2831)

v0.17.0-rc.1

12 Mar 20:56
46ad226

Choose a tag to compare

v0.17.0-rc.1 Pre-release
Pre-release

Changelog

  • 327a490 Install SDK from PyPI and refactor release publishing (#2691)
  • 507c075 Add DeepWiki badge to README (#2756)
  • b23b0d3 Add design document (#2635)
  • 0447eb1 Add pkg/model Resolver API for build encapsulation (#2663)
  • 31a147d Build right wheel and update build instructions (#2786)
  • 1fc37d5 Bump actions/checkout from 4 to 6 (#2654)
  • 8b132a1 Bump actions/setup-go from 5 to 6 (#2520)
  • f9113f2 Bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.79.3 to 1.88.7 (#2556)
  • 6d96729 Bump github.com/getkin/kin-openapi from 0.128.0 to 0.133.0 (#2508)
  • a427f36 Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.4.0 (#2502)
  • 663d68e Bump google.golang.org/grpc from 1.71.0 to 1.76.0 (#2549)
  • cec6afb Bump jdx/mise-action from 2 to 3 (#2642)
  • 3f62e3d Deprecate train command with warning before future removal (#2818)
  • 7a63155 Fix WSL 2 install instructions
  • 5cc28fd Fix wheel auto-detection and rework install to use symlinks (#2721)
  • 1999533 Fix: cancellation wiring (#2772)
  • b9dbcdc Generate CLI docs from Go code (#2736)
  • 86bf503 Make the CLI pretty ✨ (#2793)
  • d6cb965 OCI bundle format for model weights (#2676)
  • 596f1a4 Overhaul development tooling to use mise as the single source of truth for tasks, with consistent naming conventions and intelligent caching. (#2685)
  • d8e9353 Remove --x-localimage experimental feature (#2670)
  • 22536d7 Remove cog migrate command and dead code (#2667)
  • db10efd Remove coglog analytics/telemetry package (#2690)
  • 415d87c Remove deprecated fast/monobase build system (#2675)
  • 9975eef Remove integration-tests/go.mod, consolidate into root module (#2708)
  • c989aa2 Remove making a contribution section from CONTRIBUTING.md
  • a44702a Remove pipelines functionality (#2671)
  • e362368 Remove reference to cloud storage in readme
  • d982d47 Replace docs favicon with white cog on transparent background
  • 818e74a Restructure coglet Python module to improve separation of structure and prepare for publishing (#2710)
  • e6a7b73 Revert " Install SDK from PyPI and refactor release publishing (#2691)" (#2697)
  • ed6377c Revert "Revert " Install SDK from PyPI and refactor release publishing"" (#2698)
  • e5f51b9 Symbolically merging healthcheck changes from v0.16.x series (#2759)
  • 1a0a66c Update CONTRIBUTING.md
  • faa27ae Update compatibility matrix files (#2400)
  • 76b9a2f Update getting started guide to use PyTorch ResNet50 (#2750)
  • 7180061 Update readme to use "classification"
  • b9878c5 Upgrade Go dependencies (#2686)
  • 5763ec0 Use uv and uv run pip for Dockerfile generation (#2747)
  • 028b6fe add debug logging for healthcheck and setup flows in coglet (#2828)
  • e628d78 chore(coglet): Rust safety improvements and wheel platform fix (#2717)
  • 6d4b5e7 chore(deps): bump actions/download-artifact from 4 to 7 (#2705)
  • fe81069 chore(deps): bump actions/download-artifact from 7 to 8 (#2796)
  • 97e02ea chore(deps): bump actions/upload-artifact from 4 to 6 (#2706)
  • 047fbce chore(deps): bump github.com/docker/cli (#2727)
  • a34e44c chore(deps): bump github.com/google/go-containerregistry (#2794)
  • c25519f chore(deps): bump github.com/testcontainers/testcontainers-go/modules/registry (#2723)
  • 58e2da1 chore(deps): bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0
  • ee8b60c chore(deps): bump golang.org/x/crypto from 0.46.0 to 0.48.0 (#2795)
  • ffa8fb2 chore(deps): bump golang.org/x/crypto in /integration-tests (#2684)
  • d05d8d5 chore(deps): bump golang.org/x/term from 0.38.0 to 0.40.0 (#2725)
  • 54d19bc chore(deps): bump golangci/golangci-lint-action from 8 to 9 (#2707)
  • 883c552 chore(deps): bump google.golang.org/grpc from 1.79.0 to 1.79.1
  • 2a894e0 chore(deps): bump goreleaser/goreleaser-action from 6 to 7
  • a5085b0 chore(deps): bump time from 0.3.45 to 0.3.47 in /crates (#2689)
  • 5903d05 chore: EOL python below python 3.10 (#2666)
  • 4467e40 chore: bump Go minimum version to 1.26
  • 8ed998c chore: bump for rc (#2776)
  • 0f74dfa chore: bump golangci-lint 2.8.0 -> 2.10.1 for Go 1.26 compat
  • 04e136e chore: drop coglet-alpha selection (#2669)
  • 92044a3 chore: pull over pre-release 0.17.0 improvements to main (#2762)
  • 69b05de chore: regenerate uv.lock after removing Python server dependencies (#2716)
  • 10ef2f5 chore: release-process v2 (#2761)
  • efe96d5 ci: build cog binary once and fix goreleaser snapshot detection (#2713)
  • cfde5cf ci: replace aqua tool downloads with dedicated GitHub Actions (#2712)
  • c5a97d6 cleanup: remove orphaned tests property from cog.yaml schema (#2809)
  • 25aa6b9 feat(Metrics API): custom prediction metrics via current_scope() (#2752)
  • 1525f7f feat(coglet): IPC bridge enhancements for file outputs, large payloads, and upload URL (#2746)
  • df576ff feat: Replace Pydantic with native Python dataclasses for cog.BaseModel (#2681)
  • 8d017be feat: add --no-color flag to explicitly disable colored output
  • edad085 feat: add real-time progress tracking for multipart weight uploads (#2688)
  • 63cf1d8 feat: add static schema generation with legacy fallback (0.17 gated) (#2788)
  • a610a43 feat: add weights build and push commands (#2683)
  • 567b542 feat: build artifacts API — unified pipeline for images and weights (#2695)
  • 484a30a feat: build-time schema generation in Go (tree-sitter) (#2782)
  • dfa4fc3 feat: chunked image push via OCI compatible push (#2760)
  • 259c7a6 feat: decouple container SDK version from CLI version (#2771)
  • 46ad226 feat: log coglet build info and SDK version at startup (#2829)
  • 61eedf3 feat: move input coercion & output encoding to Rust, delete dead SDK modules (#2783)
  • 06ec297 feat: registry-agnostic provider system for multi-registry support (#2668)
  • 9b3a7ac feat: require python_version in cog.yaml build section
  • 8c44a7a feat: spill large inputs to disk to prevent IPC frame overflow (#2804)
  • 4bc0162 feature: Coglet (Rust) HTTP Server Only (#2714)
  • efe9956 fix(ci): go deps run ITs pin golangci-lint version (#2734)
  • 240c1e9 fix(coglet): improve "not ready" error message (#2730)
  • ba2f009 fix: add ExperimentalFeatureWarning compat shim
  • 74f3e8c fix: add S603 to ruff per-file-ignores for python/tests
  • ba0d5c5 fix: add xattr workaround for macOS Gatekeeper warning on unsigned binaries (#2754)
  • 7f30beb fix: allow spaces in environment variable values in cog.yaml schema (#2693)
  • 85c9b9a fix: auto-detect color support from environment and TTY
  • e3d30f2 fix: coglet wheel build — pin MINIMUM_PYTHON for ABI3, deduplicate version lists
  • bf52e7c fix: cross-compile all coglet wheels from ubuntu using zig (#2701)
  • 838c013 fix: eliminate dual prediction state, wire webhooks from single source of truth (#2780)
  • b469e0c fix: ensure worker idle control message controls idle slots (#2733)
  • 65da700 fix: fix Go formatting and flaky torch_baseimage_fallback integration test (#2817)
    ...
Read more