replicate/cog v0.18.0
replicate/cog
Captured source
source ↗published Apr 15, 2026seen Jun 26captured 8hhttp 200method plain
v0.18.0
Repository: replicate/cog
Tag: v0.18.0
Published: 2026-04-15T22:56:12Z
Prerelease: no
Release notes:
Breaking changes
- `cog run` is now `cog 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, causing
AttributeErroron 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 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)