Skip to main content

AutoCog

PyPI version

Generate predict.py and cog.yaml automatically using GPT4

Install

pip install autocog

Usage

First, specify your AI provider with --ai-provider and set your OpenAI/Anthropic API key in an environment variable

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-...

In the repo you want to cog-ify, run

autocog

This will generate a cog.yaml and predict.py based on the files in the current directory. It will then run the model and if it fails to run, it will attempt to fix the error and run it again. By default it has 5 attempts to fix it, which can be changed with the --attempts flag.

If your model needs a GPU to run, you need to run AutoCog on a GPU machine.

Human in the loop

Sometimes AutoCog fails to create a working Cog configuration. In those cases you, the human, have to step in and edit the cog.yaml and predict.py files.

Once you have edited them, let AutoCog continue by running autocog again. If you'd like to recreate predict.py and cog.yaml from scratch, run autocog --initialize.

By default, AutoCog will guess a cog predict command to run the model. If you want to specify your own predict command, use the --predict-command flag.

If you want AutoCog to take the generation of cog.yaml and predict.py in a specific direction, you can use the --tell flag to prompt GPT4:

autocog --tell="Add inputs to allow for inpainting"

Release files for autocog 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autocog 0.0.11
File Size Uploaded
autocog-0.0.11.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autocog 0.0.11
File Interpreter ABI Platform
autocog-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size:41.2 kB

Release files / autocog-0.0.11.tar.gz

Download URL autocog-0.0.11.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
af7bee10c5efdf3cc8fc569cf248c67ebb367e92f386f72d42be5458ee0c5577
BLAKE2b-256 checksum
How to use checksums
7f4746ebc976d08f7059972d1b0d69713e6e5df5eac6b755e5982697a8026d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / autocog-0.0.11-py3-none-any.whl

Download URL autocog-0.0.11-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9db3b9af7a991dd04bcfc3acb34c7b241b3245340488b499f80a460a50f859b
BLAKE2b-256 checksum
How to use checksums
32062ce340dac9996952b7e18a13f8f06590d2a7331f3c239c0049990fa8a3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page