Skip to content

v0.22.0

Latest

Choose a tag to compare

@github-actions github-actions released this 14 Aug 00:52
79dce1d

Breaking changes

  • Local servers now bind to 127.0.0.1 instead of 0.0.0.0. cog serve, cog run -p, cog predict, and cog train no longer expose the prediction endpoint to your whole network by default. To get the old behavior back, use cog serve --host 0.0.0.0 or cog run -p 0.0.0.0:8888-p now accepts host:port. (#2812)

New features

  • Browser playground. cog playground starts a local, schema-driven web UI for talking to a running model — a Postman-like tool that reads the model's OpenAPI schema and builds the input form for you, with a request inspector and webhook relay. Point it at anything speaking the Cog HTTP API with --target. (#3123)

  • cog serve --playground. Serve the model and the playground in one command. The playground gets its own port (--playground-port, default 9000, 0 picks a free one) and both URLs are printed on startup. (#3154)

  • @cog.concurrent decorator. Configure async runner concurrency on the method that does the work instead of in cog.yaml:

    class Runner(cog.BaseRunner):
        @cog.concurrent(max=4)
        async def run(self, prompt: str = cog.Input()) -> str:
            return await generate(prompt)

    The value is extracted statically at build time. concurrency.max in cog.yaml still works and still takes precedence, but it now warns on build — remove it when you migrate. (#3089)

  • Input validation before build and run. cog predict, cog run, and cog train now validate -i inputs against the model's OpenAPI schema before building the image or starting the container, so a typo fails in a second rather than after a full build. Covers unknown input names, missing required inputs, type mismatches, enum values, numeric bounds, string length, and regex patterns. The schema is generated statically from cog.yaml; for existing images it's read from the openapi_schema label. (#3097)

  • accept on Path and File inputs. Declare the MIME types or extensions an input takes — Input(accept="image/*"), Input(accept="audio/wav,audio/mp3"), Input(accept=".safetensors,.bin") — and Cog emits it as x-cog-accept in the OpenAPI schema so UIs and clients know what to offer. Using accept on a non-file type is a build error. (#2863)

  • Local wheels and source archives in requirements. build.python_requirements now accepts bare local paths like ./dist/mylib-0.1.0-py3-none-any.whl or ./packages/localpkg.tar.gz. Paths resolve relative to the requirements file, and only the referenced artifacts get staged into the build. .whl, .zip, .tar.gz, .tgz, .tar.bz2, and .tar.xz are supported. (#3095)

Improvements

  • Readable logs from local commands. cog serve, cog run, cog predict, and cog train now run the model with console-formatted logs instead of production JSON. Deployed models are unaffected. (#2806)
  • Download progress for cog weights. cog weights import and cog weights pull show live Docker-style progress while they populate the local weight store. (#3087)
  • Prebuilt base images are documented. New base images page covers what's on Cog's prebuilt base images, how --use-cog-base-image works, and how it interacts with --use-cuda-base-image. (#3088)

Bug fixes

  • GPU builds on CUDA base images work again. Builds on nvidia/cuda images failed with externally-managed-environment because uv-managed Python is marked PEP 668 externally managed and uv 0.9.x enforces it. Cog now passes --break-system-packages wherever it installs into a uv-managed Python, not just in cog base-image. (#3073)
  • Explicit cudnn with a CUDA minor version now validates. A config pairing cuda: "11.6" with cudnn: "8" was rejected up front even though 11.6 resolves fine to a patch-level base image like nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04. Validation now matches versions the same way image selection does. (#3070)
  • Install one-liners work on Linux arm64. uname -m reports aarch64 there, but the release asset is cog_Linux_arm64, so the documented curl command and tools/install.sh both 404'd. Both now normalize the architecture. (#3066)
  • Generated OpenAPI schemas report the real Cog version. info.version was hard-coded to 0.1.0; it now carries the version that built the schema. (#3075)
  • cog weights pull is quieter. Directory entries in weight tarballs no longer produce skipping unexpected tar entry lines. (#3076)