{"id":13695195,"url":"https://github.com/replicate/setup-cog","last_synced_at":"2025-09-04T00:07:05.264Z","repository":{"id":176345545,"uuid":"655799346","full_name":"replicate/setup-cog","owner":"replicate","description":"A GitHub Action for installing and using Cog so you can run, test, and push machine learning models ","archived":false,"fork":false,"pushed_at":"2025-02-10T14:47:31.000Z","size":44,"stargazers_count":72,"open_issues_count":6,"forks_count":47,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-08-29T04:53:16.153Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cog.run","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/replicate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-19T16:09:53.000Z","updated_at":"2025-08-17T20:16:52.000Z","dependencies_parsed_at":"2023-07-07T06:46:34.891Z","dependency_job_id":"cdc81934-f4e1-4ab8-a726-3a987de40e4f","html_url":"https://github.com/replicate/setup-cog","commit_stats":null,"previous_names":["replicate/cog-push-action","replicate/setup-cog"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/replicate/setup-cog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fsetup-cog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fsetup-cog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fsetup-cog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fsetup-cog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replicate","download_url":"https://codeload.github.com/replicate/setup-cog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replicate%2Fsetup-cog/sbom","scorecard":{"id":771354,"data":{"date":"2025-08-11","repo":{"name":"github.com/replicate/setup-cog","commit":"8a5fea3c1818b6950dcf8027285f5a9b447c0c4a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 5/24 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T02:21:24.443Z","repository_id":176345545,"created_at":"2025-08-23T02:21:24.443Z","updated_at":"2025-08-23T02:21:24.443Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273529569,"owners_count":25121830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:19.248Z","updated_at":"2025-09-04T00:07:05.179Z","avatar_url":"https://github.com/replicate.png","language":null,"funding_links":[],"categories":["Open-source tools"],"sub_categories":[],"readme":"# setup-cog\n\n[Cog](https://github.com/replicate/cog) is an open-source tool that lets you package machine learning models in a standard, production-ready container. To learn more about Cog, visit [cog.run](https://cog.run).\n\nThis repo is a GitHub Action that makes it easy to install Cog on a GitHub-hosted runner so you can run, test, and push machine learning models to Replicate, or to your own infrastructure. This action takes care of setting up prerequisites like Dockerx and NVIDIA's CUDA drivers, so you can focus on building and deploying your models without the headache.\n\n**⚡️ [Cog supports building and pushing GPU models from machines that don't have GPUs](https://github.com/replicate/cog/pull/1069) ⚡️**. So in many cases you can use this action to push your GPU model to Replicate, even if you're using a GitHub-hosted runner that doesn't have a GPU.\n\n## Usage\n\nAdd a step to your workflow that uses this action:\n\n```yml\n- name: Setup Cog\n  uses: replicate/setup-cog@v2\n  with:\n    token: ${{ secrets.REPLICATE_CLI_AUTH_TOKEN }}\n\n- name: Download weights\n  run: cog run script/download-weights\n\n- name: Push to Replicate\n  run: cog push r8.im/zeke/hello-world\n```\n\nNow you can run the `cog` CLI in subsequent steps to `cog run`, `cog push`, etc.\n\n### Inputs\n\nThis following inputs can be specified using the `with` keyword:\n\n#### `cog-version`\n\nThe version of Cog to install in the form `vX.Y.Z`. See [Cog releases](https://github.com/replicate/cog/releases) for a list of available versions.\n\nDefaults to `v0.9.8`.\n\n```yml\n- name: Setup Cog\n  uses: replicate/setup-cog@v2\n  with:\n    cog-version: \"v0.9.9-alpha\"\n```\n\n#### `token`\n\nYour Replicate CLI auth token. If set, the Action will automatically authenticate to Replicate using `cog login`. To use this feature, get your token at [replicate.com/auth/token](https://replicate.com/auth/token), copy it, then paste it into a [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) named `REPLICATE_CLI_AUTH_TOKEN` in your GitHub repo's settings.\n\n```yml\n- name: Setup Cog\n  uses: replicate/setup-cog@v2\n  with:\n    token: ${{ secrets.REPLICATE_CLI_AUTH_TOKEN }}\n```\n\n#### `install-cuda`\n\nInstall NVIDIA CUDA Toolkit. Defaults to `false`, because most Cog models can be built and pushed without requiring CUDA. [Cog supports building and pushing GPU models from machines that don't have GPUs](https://github.com/replicate/cog/pull/1069), so in many cases you can push your GPU model to Replicate without installing the toolkit.\n\nIf you need CUDA installed, set this input to `true`:\n\n```yml\n- name: Setup Cog\n  uses: replicate/setup-cog@v2\n  with:\n    install-cuda: true\n```\n\n## Example: Manual Deployment\n\nHere's an example that allows you to [trigger a workflow run manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) from the Actions tab in your repo:\n\n```yml\nname: Push to Replicate\n\non:\n  workflow_dispatch:\n    inputs:\n      model_name:\n        required: true\n        description: \"The name of the Replicate model to publish, e.g `username/modelname`. The model must already exist on Replicate.\"\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v3\n\n      - name: Setup Cog\n        uses: replicate/setup-cog@v2\n        with:\n          token: ${{ secrets.REPLICATE_CLI_AUTH_TOKEN }}\n\n      - name: Push to Replicate\n        run: |\n          cog push r8.im/${{ inputs.model_name }}\n```\n\n## Example: Continuous Deployment\n\nHere's an example that pushes to Replicate whenever your repo's `main` branch is updated:\n\n```yml\nname: Push to Replicate\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v3\n\n      - name: Setup Cog\n        uses: replicate/setup-cog@v2\n        with:\n          token: ${{ secrets.REPLICATE_CLI_AUTH_TOKEN }}\n\n      - name: Push to Replicate\n        run: |\n          cog push r8.im/zeke/hello-world\n```\n\n## Limitations\n\nGitHub's hosted runners don't have GPUs (yet?), so you can't currently run GPU models unless you [self-host your own runner](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners).\n\nThat said, Cog can still be used to `build` and `push` GPU models, even from a Linux environment that doesn't have a GPU. So you can push GPU models to Replicate, but you can't run them as part of your workflow.\n\n### Using custom hosted runners\n\nThis action works on GitHub's default runners, but **most models require more disk space and memory** than is available on the default runner.\n\nGitHub offers more powerful hosted runners that are easy to set up with just a few clicks, but you'll have to [Sign up for GitHub's Hosted Runners beta](https://github.com/features/github-hosted-runners/signup) before you can use them. Note that these runners are only available on paid Team or Enterprise plans, so you'll need to make sure your model repository is owned by a paid GitHub organization rather than an individual user account.\n\nOnce you've set up a hosted runner, you can use it by adding the [`runs-on`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on) key to your job:\n\n```yml\njobs:\n  do_cog_stuff:\n    runs-on: my-fancy-runner-with-more-disk-and-memory\n    steps:\n      - name: Check out code\n        uses: actions/checkout@v3\n\n      - name: Setup Cog\n        uses: replicate/setup-cog@v2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fsetup-cog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplicate%2Fsetup-cog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplicate%2Fsetup-cog/lists"}