Releases: replicate/cog
v0.19.2
v0.19.1
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
v0.19.0
New features
cog doctorcommand. Diagnose common Cog setup issues, check configuration, and verify that everything is working correctly. Runcog doctorto 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=1to 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 withNonedefaults are now correctly identified as optional in the generated schema. (#2949)
v0.18.0
Breaking changes
cog runis nowcog exec.cog runstill 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, causingAttributeErroron 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) dictandlist[dict]work as input types. These were supported as outputs but rejected as inputs, breaking chat-style message inputs. (#2928)list[X] | Noneworks 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 pushnow shows status during thedocker savephase 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_timeand thecog.prefix are reserved. (#2911)
v0.17.2
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
v0.17.0
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 TrueRuns 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_versionis now required in thebuild:section ofcog.yaml. Builds fail with a clear error if it's missing. Addpython_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 trainis 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 ofcurrent_scope().record_metric(). The old function still works as a compat shim.
v0.17.0-rc.4
v0.17.0-rc.3
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)