Releases: replicate/cog
Releases · replicate/cog
v0.21.0-rc.3
v0.21.0-rc.2
v0.21.0-rc.1
New features
- Server-Sent Event prediction streams. HTTP prediction requests can now ask for
Accept: text/event-streamto receivestart,output,log,metric, and terminalcompletedevents for predictors that explicitly opt in with@streaming/@cog.streaming. Reconnecting clients can replay retained in-flight prediction events withPUT /predictions/{id}. (#3019)
Improvements
- Experimental warning for
cog weights. Everycog weightssubcommand now prints a warning that the weights workflow is experimental and should not be relied on in production workflows yet. (#3025) - Static schema parser target resolution. The static Python schema parser now uses
run()as the primary prediction entry point while preserving legacypredict()fallback behavior, and resolves inherited and imported targets more consistently. (#3027)
Bug fixes
cog doctor --fixnow shows available remediation text. Findings without an auto-fix now display their remediation message instead of incorrectly saying no auto-fix is available. (#3031)- Cog-managed weight uploads now send the correct layer media type. Weight layer uploads now propagate the Cog weight media type during registry finalization while preserving regular image-layer behavior. (#3033)
- Predictor validation now handles PEP 563 string annotations. Predictor files using
from __future__ import annotationsno longer reject validsetup() -> Nonemethods or accept invalidrun() -> Nonemethods becauseNoneannotations were stored as strings. (#3034)
v0.20.0
New features
cog runcommand. Thecog predictcommand has been renamed tocog runwith full backward compatibility.cog predictstill works as an alias. (#3015)- Model refs for
cog pushand weights commands. You can now reference models by name (e.g.,r8.im/user/model) instead of full image URLs when pushing or managing weights. (#3018) - Multi-source weights and HTTPS weight sources. Weights can now be fetched from multiple sources, including direct HTTPS URLs. (#3008)
- Opaque annotations in schema generation. Predictor inputs can use the new
Opaqueannotation to exclude fields from the generated schema. (#3001)
Improvements
- Runtime schema generation fully removed. The legacy runtime Python schema generation path has been completely removed. Cog exclusively uses static schema generation, making builds faster and more reliable. (#3003)
- Centralized build state and cleaner Docker context. Cog now stores build state in a dedicated
.cog/directory that is automatically filtered from the Docker build context. (#3000) - Support durable base-image build context. Base image builds now support a durable build context for better caching and reliability. (#3004)
- Support uv-managed Python installs in generated Dockerfiles. Generated Dockerfiles now properly handle Python installations managed by
uv. (#2999)
Bug fixes
- Pushing a model with a version tag now emits a clean URL. The Replicate model URL printed after
cog pushno longer includes the image tag (e.g.,:latest), preventing 404 errors when users click the link. (#3020) - Prefer latest torch patch when resolving unpatched versions. When resolving PyTorch compatibility, Cog now correctly selects the latest available patch version for unpatched version specs. (#3009)
- Deterministic compatibility matrix output. Compatibility matrices are now sorted for consistent, deterministic output. (#3006)
v0.19.3
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)