Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions src/content/docs/ai-gateway/providers/workersai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ Workers AI supports the following parameters for AI gateways:
- `id` string
- Name of your existing [AI Gateway](/ai-gateway/get-started/#create-gateway). Must be in the same account as your Worker.
- `skipCache` boolean(default: false)
- Controls whether the request should [skip the cache](/ai-gateway/configuration/caching/#skip-cache-cf-skip-cache).
- Controls whether the request should [skip the cache](/ai-gateway/configuration/caching/#skip-cache-cf-aig-skip-cache).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page: http://localhost:1111/ai-gateway/providers/workersai/
has a broken internal link to: http://localhost:1111/ai-gateway/configuration/caching/. The fragment #skip-cache-cf-skip-cache does not exist.

By looking at the page: /ai-gateway/configuration/caching/
The best fragment to use seems to be: #skip-cache-cf-aig-skip-cache

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bllchmbrs
Would resolving this comment have any effect in the future behavior of Hyperlint? This is slightly different from Hyperlint suggestions in PRs not authored by Hyperlint (in this case, Hyperlint authored the PR and added the comments).
I'm leaving this comment unresolved in the PR because the change makes sense (and is already included in the PR).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unresolved comments are no problem (don't affect the review / merge). They're just included for context for the reviewer.

- `cacheTtl` number
- Controls the [Cache TTL](/ai-gateway/configuration/caching/#cache-ttl-cf-cache-ttl).
- Controls the [Cache TTL](/ai-gateway/configuration/caching/#cache-ttl-cf-aig-cache-ttl).
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Let's start implementing step-by-step.

### Bind Workers AI and Vectorize to your Worker

This API requires the use of Workers AI and Vectorize. To use these resources from a Worker, you will need to first create the resources then [bind](/workers/runtime-apis/bindings/#what-is-a-binding) them to a Worker. First, let's create a Vectorize index with Wrangler using the command `wrangler vectorize create {index_name} --dimensions={number_of_dimensions} --metric={similarity_metric}`. The values for `dimensions` and `metric` depend on the type of [Text Embedding Model](/workers-ai/models/#text-embeddings) you are using for data vectorization (Embedding). For example, if you are using the `bge-large-en-v1.5` model, the command is:
This API requires the use of Workers AI and Vectorize. To use these resources from a Worker, you will need to first create the resources then [bind](/workers/runtime-apis/bindings/#what-is-a-binding) them to a Worker. First, let's create a Vectorize index with Wrangler using the command `wrangler vectorize create {index_name} --dimensions={number_of_dimensions} --metric={similarity_metric}`. The values for `dimensions` and `metric` depend on the type of [Text Embedding Model](/workers-ai/models/#) you are using for data vectorization (Embedding). For example, if you are using the `bge-large-en-v1.5` model, the command is:

```sh
npx wrangler vectorize create stripe-products --dimensions=1024 --metric=cosine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Example uses of such compositions of AI models can be employed to generation vis
![Figure 1:Content-based asset generation](~/assets/images/reference-architecture/ai-asset-generation-diagrams/ai-asset-generation.svg "Figure 1: Content-based asset generation")

1. **Client upload**: Send POST request with content to API endpoint.
2. **Prompt generation**: Generate prompt for later-stage text-to-image model by calling [Workers AI](/workers-ai/) [text generation models](/workers-ai/models/#text-generation) with content as input.
2. **Prompt generation**: Generate prompt for later-stage text-to-image model by calling [Workers AI](/workers-ai/) [text generation models](/workers-ai/models/#) with content as input.
3. **Safety check**: Check for compliance with safety guidelines by calling [Workers AI](/workers-ai/) [text classification models](/workers-ai/models/#text-classification) with the previously generated prompt as input.
4. **Image generation**: Generate image by calling [Workers AI](/workers-ai/) [text-to-image models](/workers-ai/models/#text-to-image) previously generated prompt.

## Related resources

- [Community project: content-based asset creation demo](https://auto-asset.pages.dev/)
- [Workers AI: Text generation models](/workers-ai/models/#text-generation)
- [Workers AI: Text generation models](/workers-ai/models/#)
- [Workers AI: Text-to-image models](/workers-ai/models/#text-to-image)
- [Workers AI: llamaguard-7b-awq](/workers-ai/models/llamaguard-7b-awq/)
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can [download the Workers AI Text Generation Exploration notebook](/workers-

Models come in different shapes and sizes, and choosing the right one for the task, can cause analysis paralysis.

The good news is that on the [Workers AI Text Generation](/workers-ai/models/#text-generation) interface is always the same, no matter which model you choose.
The good news is that on the [Workers AI Text Generation](/workers-ai/models/#) interface is always the same, no matter which model you choose.

In an effort to aid you in your journey of finding the right model, this notebook will help you get to know your options in a speed dating type of scenario.

Expand Down Expand Up @@ -130,7 +130,7 @@ def speed_date(models, questions):

Who better to tell you about the specific models than themselves?!

The timing here is specific to the entire completion, but remember all Text Generation models on [Workers AI support streaming](/workers-ai/models/#text-generation).
The timing here is specific to the entire completion, but remember all Text Generation models on [Workers AI support streaming](/workers-ai/models/#).

```python
models = [
Expand Down
2 changes: 1 addition & 1 deletion src/content/partials/workers-ai/openai-compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

---

Workers AI supports OpenAI compatible endpoints for [text generation](/workers-ai/models/#text-generation) (`/v1/chat/completions`) and [text embedding models](/workers-ai/models/#text-embeddings) (`/v1/embeddings`). This allows you to use the same code as you would for your OpenAI commands, but swap in Workers AI easily.
Workers AI supports OpenAI compatible endpoints for [text generation](/workers-ai/models/#text-generation) (`/v1/chat/completions`) and [text embedding models](/workers-ai/models/#) (`/v1/embeddings`). This allows you to use the same code as you would for your OpenAI commands, but swap in Workers AI easily.
Loading