Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to set up a development environme
- [Get started with your own model](docs/getting-started-own-model.md)
- [Using Cog with notebooks](docs/notebooks.md)
- [Using Cog with Windows 11](docs/wsl2/wsl2.md)
- [Take a look at some examples of using Cog](https://github.com/replicate/cog-examples)
- [Browse the example models in this repo](docs/examples.md)
- [Deploy models with Cog](docs/deploy.md)
- [`cog.yaml` reference](docs/yaml.md) to learn how to define your model's environment
- [Run interface reference](docs/python.md) to learn how the `Runner` interface works
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ that handles HTTP requests, worker process management, and run execution.

This guide assumes you have a model packaged with Cog.
If you don't, [follow our getting started guide](getting-started-own-model.md),
or use [an example model](https://github.com/replicate/cog-examples).
or start from one of the [examples in the Cog repository](examples.md).

## Getting started

Expand Down
41 changes: 41 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Examples

Cog's example models now live in the main Cog repository under
[`examples/`](https://github.com/replicate/cog/tree/main/examples).

If you want a working project to copy from, start with one of these:

- [`hello-world`](https://github.com/replicate/cog/tree/main/examples/hello-world):
minimal string input/output example
- [`hello-image`](https://github.com/replicate/cog/tree/main/examples/hello-image):
returns a static image
- [`hello-context`](https://github.com/replicate/cog/tree/main/examples/hello-context):
shows how to read prediction context
- [`hello-concurrency`](https://github.com/replicate/cog/tree/main/examples/hello-concurrency):
demonstrates the `concurrency` setting in `cog.yaml`
- [`hello-train`](https://github.com/replicate/cog/tree/main/examples/hello-train):
defines a training interface
- [`hello-replicate`](https://github.com/replicate/cog/tree/main/examples/hello-replicate):
uses `cog.Secret` inputs and calls the Replicate API
- [`blur`](https://github.com/replicate/cog/tree/main/examples/blur):
simple image-to-image transformation
- [`resnet`](https://github.com/replicate/cog/tree/main/examples/resnet):
GPU image classification with ResNet50
- [`streaming-text`](https://github.com/replicate/cog/tree/main/examples/streaming-text):
streaming text generation with server-sent events
- [`z-image-turbo`](https://github.com/replicate/cog/tree/main/examples/z-image-turbo):
a generative image model example
- [`notebook`](https://github.com/replicate/cog/tree/main/examples/notebook):
runs a Jupyter notebook with Cog
- [`canary`](https://github.com/replicate/cog/tree/main/examples/canary):
small streaming output example used for validation
- [`managed-weights`](https://github.com/replicate/cog/tree/main/examples/managed-weights):
managed weights pipeline fixture

There is also an experimental example:

- [`experimental/resnet-managed-weights`](https://github.com/replicate/cog/tree/main/examples/experimental/resnet-managed-weights):
ResNet50 packaged with managed weights

For a quick summary of every example in the tree, see
[`examples/README.md`](https://github.com/replicate/cog/blob/main/examples/README.md).
2 changes: 2 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Getting started

This guide will walk you through what you can do with Cog by using an example model.
If you'd rather start from a complete example, browse the
[examples in the Cog repository](examples.md).

> [!TIP]
> Using a language model to help you write the code for your new Cog model?
Expand Down
51 changes: 49 additions & 2 deletions docs/llms.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Examples

Cog's example models now live in this repository under `examples/`.

## Examples

- [`blur`](blur): image-to-image box blur example
- [`canary`](canary): simple streaming string output example
- [`hello-concurrency`](hello-concurrency): demonstrates the `concurrency`
setting in `cog.yaml`
- [`hello-context`](hello-context): shows how to read prediction context
- [`hello-image`](hello-image): returns a static image
- [`hello-replicate`](hello-replicate): uses `cog.Secret` inputs and calls the
Replicate API
- [`hello-train`](hello-train): defines a training interface
- [`hello-world`](hello-world): minimal string input/output example
- [`managed-weights`](managed-weights): managed weights pipeline fixture
- [`notebook`](notebook): runs a Jupyter notebook with Cog
- [`resnet`](resnet): GPU image classification with ResNet50
- [`streaming-text`](streaming-text): streaming text generation example
- [`z-image-turbo`](z-image-turbo): generative image model example

## Experimental examples

- [`experimental/resnet-managed-weights`](experimental/resnet-managed-weights):
ResNet50 packaged with managed weights
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ docs_dir: docs/
nav:
- README: README.md
- Getting Started: getting-started.md
- Examples: examples.md
- Using your own model: getting-started-own-model.md
- Deploy your model: deploy.md
- YAML spec: yaml.md
Expand Down
Loading