Skip to content

v0.21.0

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Jun 20:30
· 11 commits to main since this release
0688575

New features

  • Server-Sent Event prediction streams. HTTP prediction requests can now ask for Accept: text/event-stream to receive start, output, log, metric, and terminal completed events for predictors that explicitly opt in with @streaming / @cog.streaming. Reconnecting clients can replay retained in-flight prediction events with PUT /predictions/{id}. (#3019)
  • JSON-native union inputs. Cog now supports union-typed predictor inputs in generated schemas and HTTP request handling, allowing compatible JSON-native values to be resolved correctly. (#3048)

Improvements

  • Example models now live in the Cog repository. The example models from replicate/cog-examples have moved into this repository under examples/, with updated run.py / BaseRunner examples for common workflows including images, training, notebooks, streaming, concurrency, context, and Replicate API usage. (#3055)
  • Experimental warning for cog weights. Every cog weights subcommand 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 legacy predict() fallback behavior, and resolves inherited and imported targets more consistently. (#3027)

Bug fixes

  • cog.Secret inputs now work with coglet-backed predictions. Predictors that annotate inputs as Secret, Optional[Secret], or Secret | None now receive cog.types.Secret values at runtime again, restoring behavior that regressed in the Rust/coglet runtime rewrite. (#3057)
  • cog doctor --fix now 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 annotations no longer reject valid setup() -> None methods or accept invalid run() -> None methods because None annotations were stored as strings. (#3034)
  • cog serve now mounts weights like cog run. Models served locally now receive configured weights consistently with local prediction runs. (#3044)
  • Omitted optional inputs now resolve to None at the HTTP edge. Optional predictor inputs omitted from HTTP requests are now passed as None instead of being treated inconsistently by request handling. (#3051)