Skip to content

Commit b388f1d

Browse files
rickyrobinettcraigsdenniskodster28
authored
Proposal for updated Workers AI side nav (#21023)
* proposal for new ai side nav * Renames to Workers for Nav per Michelle request * Moves tools to features and removes dynamic where unnecessary * Updates name to Features * Renames once again * Hand rolled redirects instead of dynamic * Cleaned up redirects * trailing slash * remove folders with one file * more slashes * fixes * broken links --------- Co-authored-by: Craig Dennis <[email protected]> Co-authored-by: kodster28 <[email protected]>
1 parent 4f5da26 commit b388f1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+273
-204
lines changed

public/__redirects

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,38 @@
15281528
/workers/observability/baselime-integration/ /workers/observability/integrations/baselime-integration/ 301
15291529
/workers-ai/tutorials/image-generator-flux/ /workers-ai/tutorials/image-generation-playground/ 301
15301530

1531+
# Workers AI reorganization redirects
1532+
# Function calling
1533+
/workers-ai/function-calling/ /workers-ai/features/function-calling/ 301
1534+
/workers-ai/function-calling/embedded/ /workers-ai/features/function-calling/embedded/ 301
1535+
/workers-ai/function-calling/embedded/get-started/ /workers-ai/features/function-calling/embedded/get-started/ 301
1536+
/workers-ai/function-calling/embedded/api-reference/ /workers-ai/features/function-calling/embedded/api-reference/ 301
1537+
/workers-ai/function-calling/embedded/examples/ /workers-ai/features/function-calling/embedded/examples/ 301
1538+
/workers-ai/function-calling/embedded/examples/kv/ /workers-ai/features/function-calling/embedded/examples/kv/ 301
1539+
/workers-ai/function-calling/embedded/examples/openapi/ /workers-ai/features/function-calling/embedded/examples/openapi/ 301
1540+
/workers-ai/function-calling/embedded/examples/fetch/ /workers-ai/features/function-calling/embedded/examples/fetch/ 301
1541+
/workers-ai/function-calling/embedded/examples/troubleshooting/ /workers-ai/features/function-calling/embedded/examples/troubleshooting/ 301
1542+
/workers-ai/function-calling/traditional/ /workers-ai/features/function-calling/traditional/ 301
1543+
1544+
# JSON Mode
1545+
/workers-ai/json-mode/ /workers-ai/features/json-mode/ 301
1546+
1547+
# Fine-tunes
1548+
/workers-ai/fine-tunes/ /workers-ai/features/fine-tunes/ 301
1549+
/workers-ai/fine-tunes/public-loras /workers-ai/features/fine-tunes/public-loras/ 301
1550+
/workers-ai/fine-tunes/loras /workers-ai/features/fine-tunes/loras/ 301
1551+
1552+
# Prompting
1553+
/workers-ai/guides/prompting/ /workers-ai/features/prompting/ 301
1554+
1555+
# Platform section
1556+
/workers-ai/privacy/ /workers-ai/platform/privacy/ 301
1557+
/workers-ai/glossary/ /workers-ai/platform/glossary/ 301
1558+
/workers-ai/workers-ai-errors/ /workers-ai/platform/errors/ 301
1559+
1560+
# Guides section
1561+
/workers-ai/demos/ /workers-ai/guides/demos-architectures/ 301
1562+
15311563
# workflows
15321564

15331565
/workflows/reference/storage-options/ /workers/platform/storage-options/ 301
@@ -1867,6 +1899,11 @@
18671899
/workers/templates/pages/* /workers/examples/:splat 301
18681900
/workers/observability/logging/* /workers/observability/logs/:splat 301
18691901

1902+
# Workers AI
1903+
/workers-ai/demos/* /workers-ai/guides/demos-architectures/:splat 301
1904+
/workers-ai/tutorials/* /workers-ai/guides/tutorials/:splat 301
1905+
1906+
18701907
# Others
18711908
/logs/analytics-integrations/* /fundamentals/data-products/analytics-integrations/:splat 301
18721909
/fundamentals/notifications/* /notifications/:splat 301

src/content/changelog/workers-ai/2025-02-25-json-mode.mdx

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ date: 2025-02-25T15:00:00Z
66

77
import { TypeScriptExample } from "~/components";
88

9-
Workers AI now supports structured JSON outputs with [JSON mode](/workers-ai/json-mode/), which allows you to request a structured output response when interacting with AI models.
9+
Workers AI now supports structured JSON outputs with [JSON mode](/workers-ai/features/json-mode/), which allows you to request a structured output response when interacting with AI models.
1010

1111
This makes it much easier to retrieve structured data from your AI models, and avoids the (error prone!) need to parse large unstructured text responses to extract your data.
1212

@@ -23,13 +23,13 @@ interface Env {
2323

2424
// Define your JSON schema for a calendar event
2525
const CalendarEventSchema = {
26-
type: 'object',
27-
properties: {
28-
name: { type: 'string' },
29-
date: { type: 'string' },
30-
participants: { type: 'array', items: { type: 'string' } },
31-
},
32-
required: ['name', 'date', 'participants']
26+
type: "object",
27+
properties: {
28+
name: { type: "string" },
29+
date: { type: "string" },
30+
participants: { type: "array", items: { type: "string" } },
31+
},
32+
required: ["name", "date", "participants"],
3333
};
3434

3535
export default {
@@ -42,29 +42,32 @@ export default {
4242
});
4343

4444
const response = await client.chat.completions.create({
45-
model: 'gpt-4o-2024-08-06',
46-
messages: [
47-
{ role: 'system', content: 'Extract the event information.' },
48-
{ role: 'user', content: 'Alice and Bob are going to a science fair on Friday.' },
49-
],
45+
model: "gpt-4o-2024-08-06",
46+
messages: [
47+
{ role: "system", content: "Extract the event information." },
48+
{
49+
role: "user",
50+
content: "Alice and Bob are going to a science fair on Friday.",
51+
},
52+
],
5053
// Use the `response_format` option to request a structured JSON output
51-
response_format: {
54+
response_format: {
5255
// Set json_schema and provide ra schema, or json_object and parse it yourself
53-
type: 'json_schema',
54-
schema: CalendarEventSchema, // provide a schema
55-
},
56-
});
56+
type: "json_schema",
57+
schema: CalendarEventSchema, // provide a schema
58+
},
59+
});
5760

5861
// This will be of type CalendarEventSchema
5962
const event = response.choices[0].message.parsed;
6063

6164
return Response.json({
62-
"calendar_event": event,
63-
})
64-
}
65-
}
65+
calendar_event: event,
66+
});
67+
},
68+
};
6669
```
6770

6871
</TypeScriptExample>
6972

70-
To learn more about JSON mode and structured outputs, visit the [Workers AI documentation](/workers-ai/json-mode/).
73+
To learn more about JSON mode and structured outputs, visit the [Workers AI documentation](/workers-ai/features/json-mode/).

src/content/docs/reference-architecture/diagrams/ai/ai-rag.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ In the context of Retrieval-Augmented Generation (RAG), knowledge seeding involv
4949

5050
## Related resources
5151

52-
- [Tutorial: Build a RAG AI](/workers-ai/tutorials/build-a-retrieval-augmented-generation-ai/)
52+
- [Tutorial: Build a RAG AI](/workers-ai/guides/tutorials/build-a-retrieval-augmented-generation-ai/)
5353
- [Workers AI: Text embedding models](/workers-ai/models/)
5454
- [Workers AI: Text generation models](/workers-ai/models/)

src/content/docs/reference-architecture/diagrams/ai/bigquery-workers-ai.mdx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This version of the integration is aimed at workflows that require interaction w
2828

2929
1. A user makes a request to a [Worker](https://workers.cloudflare.com/) endpoint. (Which can optionally incorporate [Access](/cloudflare-one/policies/access/) in front of it to authenticate users).
3030
2. Worker fetches [securely stored](/workers/configuration/secrets/) Google Cloud Platform service account information such as service key and generates a JSON Web Token to issue an authenticated API request to BigQuery.
31-
3. Worker receives the data from BigQuery and [transforms it into a format](/workers-ai/tutorials/using-bigquery-with-workers-ai/#6-format-results-from-the-query) that will make it easier to iterate when interacting with Workers AI.
31+
3. Worker receives the data from BigQuery and [transforms it into a format](/workers-ai/guides/tutorials/using-bigquery-with-workers-ai/#6-format-results-from-the-query) that will make it easier to iterate when interacting with Workers AI.
3232
4. Using its [native integration](/workers-ai/configuration/bindings/) with Workers AI, the Worker forwards the data from BigQuery which is then run against one of Cloudflare's hosted AI models.
3333
5. The original data retrieved from BigQuery alongside the AI-generated information is returned to the user as a response to the request initiated in step 1.
3434

@@ -40,20 +40,20 @@ For periodic or longer workflows, you may opt for a batch approach. This diagram
4040

4141
1. [A Cron Trigger](/workers/configuration/cron-triggers/) invokes the Worker without any user interaction.
4242
2. Worker fetches [securely stored](/workers/configuration/secrets/) Google Cloud Platform service account information such as service key and generates a JSON Web Token to issue an authenticated API request to BigQuery.
43-
3. Worker receives the data from BigQuery and [transforms it into a format](/workers-ai/tutorials/using-bigquery-with-workers-ai/#6-format-results-from-the-query) that will make it easier to iterate when interacting with Workers AI.
43+
3. Worker receives the data from BigQuery and [transforms it into a format](/workers-ai/guides/tutorials/using-bigquery-with-workers-ai/#6-format-results-from-the-query) that will make it easier to iterate when interacting with Workers AI.
4444
4. Using its [native integration](/workers-ai/configuration/bindings/) with Workers AI, the Worker forwards the data from BigQuery to generate some content related to it.
4545
5. Optionally, you can store the BigQuery data and the AI-generated data in a variety of different Cloudflare services.
46-
* Into [D1](/d1/), a SQL database.
47-
* If in step four you used Workers AI to generate embeddings, you can store them in [Vectorize](/vectorize/). To learn more about this type of solution, please consider reviewing the reference architecture diagram on [Retrieval Augmented Generation](/reference-architecture/diagrams/ai/ai-rag/).
48-
* To [Workers KV](/kv/) if the output of your data will be stored and consumed in a key/value fashion.
49-
* If you prefer to save the data fetched from BigQuery and Workers AI into objects (such as images, files, JSONs), you can use [R2](/r2/), our egress-free object storage to do so.
46+
- Into [D1](/d1/), a SQL database.
47+
- If in step four you used Workers AI to generate embeddings, you can store them in [Vectorize](/vectorize/). To learn more about this type of solution, please consider reviewing the reference architecture diagram on [Retrieval Augmented Generation](/reference-architecture/diagrams/ai/ai-rag/).
48+
- To [Workers KV](/kv/) if the output of your data will be stored and consumed in a key/value fashion.
49+
- If you prefer to save the data fetched from BigQuery and Workers AI into objects (such as images, files, JSONs), you can use [R2](/r2/), our egress-free object storage to do so.
5050
6. You can set up an integration so a system or a user gets notified whenever a new result is available or if an error occurs. It's also worth mentioning that Workers by themselves can already provide additional [observability](/workers/observability/).
51-
* Sending an email with all the data retrieved and generated in the previous step is possible using [Email Routing](/email-routing/email-workers/send-email-workers/).
52-
* Since Workers allows you to issue HTTP requests, you can notify a webhook or API endpoint once the process finishes or if there's an error.
51+
- Sending an email with all the data retrieved and generated in the previous step is possible using [Email Routing](/email-routing/email-workers/send-email-workers/).
52+
- Since Workers allows you to issue HTTP requests, you can notify a webhook or API endpoint once the process finishes or if there's an error.
5353

5454
## Related resources
5555

56-
- [Tutorial: Using BigQuery with Workers AI](/workers-ai/tutorials/using-bigquery-with-workers-ai/)
56+
- [Tutorial: Using BigQuery with Workers AI](/workers-ai/guides/tutorials/using-bigquery-with-workers-ai/)
5757
- [Workers AI: Get Started](/workers-ai/get-started/workers-wrangler/)
5858
- [Workers: Secrets](/workers/configuration/secrets/)
5959
- [Workers: Cron Triggers](/workers/runtime-apis/handlers/scheduled/)
@@ -65,4 +65,3 @@ For periodic or longer workflows, you may opt for a batch approach. This diagram
6565
- [Workers KV](/kv/)
6666
- [R2](/r2/)
6767
- [D1](/d1/)
68-

src/content/docs/vectorize/get-started/embeddings.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,6 @@ By finishing this tutorial, you have successfully created a Vectorize index, use
279279

280280
## Next steps
281281

282-
- Build a [generative AI chatbot](/workers-ai/tutorials/build-a-retrieval-augmented-generation-ai/) using Workers AI and Vectorize.
282+
- Build a [generative AI chatbot](/workers-ai/guides/tutorials/build-a-retrieval-augmented-generation-ai/) using Workers AI and Vectorize.
283283
- Learn more about [how vector databases work](/vectorize/reference/what-is-a-vector-database/).
284284
- Read [examples](/vectorize/reference/client-api/) on how to use the Vectorize API from Cloudflare Workers.

src/content/docs/vectorize/reference/what-is-a-vector-database.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Vector databases
33
pcx_content_type: concept
44
sidebar:
55
order: 2
6-
76
---
87

98
Vector databases are a key part of building scalable AI-powered applications. Vector databases provide long term memory, on top of an existing machine learning model.
@@ -14,10 +13,10 @@ Without a vector database, you would need to train your model (or models) or re-
1413

1514
A vector database determines what other data (represented as vectors) is near your input query. This allows you to build different use-cases on top of a vector database, including:
1615

17-
* Semantic search, used to return results similar to the input of the query.
18-
* Classification, used to return the grouping (or groupings) closest to the input query.
19-
* Recommendation engines, used to return content similar to the input based on different criteria (for example previous product sales, or user history).
20-
* Anomaly detection, used to identify whether specific data points are similar to existing data, or different.
16+
- Semantic search, used to return results similar to the input of the query.
17+
- Classification, used to return the grouping (or groupings) closest to the input query.
18+
- Recommendation engines, used to return content similar to the input based on different criteria (for example previous product sales, or user history).
19+
- Anomaly detection, used to identify whether specific data points are similar to existing data, or different.
2120

2221
Vector databases can also power [Retrieval Augmented Generation](https://arxiv.org/abs/2005.11401) (RAG) tasks, which allow you to bring additional context to LLMs (Large Language Models) by using the context from a vector search to augment the user prompt.
2322

@@ -44,16 +43,17 @@ Instead of passing the prompt directly to the LLM, in the RAG approach you:
4443
1. Generate vector embeddings from an existing dataset or corpus (for example, the dataset you want to use to add additional context to the LLMs response). An existing dataset or corpus could be a product documentation, research data, technical specifications, or your product catalog and descriptions.
4544
2. Store the output embeddings in a Vectorize database index.
4645

47-
When a user initiates a prompt, instead of passing it (without additional context) to the LLM, you *augment* it with additional context:
46+
When a user initiates a prompt, instead of passing it (without additional context) to the LLM, you _augment_ it with additional context:
4847

4948
1. The user prompt is passed into the same ML model used for your dataset, returning a vector embedding representation of the query.
5049
2. This embedding is used as the query (semantic search) against the vector database, which returns similar vectors.
5150
3. These vectors are used to look up the content they relate to (if not embedded directly alongside the vectors as metadata).
5251
4. This content is provided as context alongside the original user prompt, providing additional context to the LLM and allowing it to return an answer that is likely to be far more contextual than the standalone prompt.
5352

54-
Refer to the [RAG using Workers AI tutorial](/workers-ai/tutorials/build-a-retrieval-augmented-generation-ai/) to learn how to combine Workers AI and Vectorize for generative AI use-cases.
53+
Refer to the [RAG using Workers AI tutorial](/workers-ai/guides/tutorials/build-a-retrieval-augmented-generation-ai/) to learn how to combine Workers AI and Vectorize for generative AI use-cases.
5554

56-
<sup>1</sup> You can learn more about the theory behind RAG by reading the [RAG paper](https://arxiv.org/abs/2005.11401).
55+
<sup>1</sup> You can learn more about the theory behind RAG by reading the [RAG
56+
paper](https://arxiv.org/abs/2005.11401).
5757

5858
## Terminology
5959

@@ -85,9 +85,9 @@ Refer to the [dimensions](/vectorize/best-practices/create-indexes/#dimensions)
8585

8686
The distance metric is an index used for vector search. It defines how it determines how close your query vector is to other vectors within the index.
8787

88-
* Distance metrics determine how the vector search engine assesses similarity between vectors.
89-
* Cosine, Euclidean (L2), and Dot Product are the most commonly used distance metrics in vector search.
90-
* The machine learning model and type of embedding you use will determine which distance metric is best suited for your use-case.
91-
* Different metrics determine different scoring characteristics. For example, the `cosine` distance metric is well suited to text, sentence similarity and/or document search use-cases. `euclidean` can be better suited for image or speech recognition use-cases.
88+
- Distance metrics determine how the vector search engine assesses similarity between vectors.
89+
- Cosine, Euclidean (L2), and Dot Product are the most commonly used distance metrics in vector search.
90+
- The machine learning model and type of embedding you use will determine which distance metric is best suited for your use-case.
91+
- Different metrics determine different scoring characteristics. For example, the `cosine` distance metric is well suited to text, sentence similarity and/or document search use-cases. `euclidean` can be better suited for image or speech recognition use-cases.
9292

9393
Refer to the [distance metrics](/vectorize/best-practices/create-indexes/#distance-metrics) documentation to learn how to configure a distance metric when creating a Vectorize index.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Agents
3+
pcx_content_type: navigation
4+
external_link: /agents/
5+
sidebar:
6+
order: 7
7+
---
8+
9+
import { LinkButton } from "~/components"
10+
11+
<div style={{ textAlign: 'center', marginBottom: '2rem' }}>
12+
<p>Build AI assistants that can perform complex tasks on behalf of your users using Cloudflare Workers AI and Agents.</p>
13+
<LinkButton href="/agents/">Go to Agents documentation</LinkButton>
14+
</div>

src/content/docs/workers-ai/changelog.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Changelog
44
release_notes_file_name:
55
- workers-ai
66
sidebar:
7-
order: 8
7+
order: 9
88
head: []
99
description: Review recent changes to Cloudflare Workers AI.
1010
---

src/content/docs/workers-ai/fine-tunes/index.mdx renamed to src/content/docs/workers-ai/features/fine-tunes/index.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22
pcx_content_type: navigation
33
title: Fine-tunes
44
sidebar:
5-
order: 5
6-
5+
order: 3
76
---
87

9-
import { Feature } from "~/components"
8+
import { Feature } from "~/components";
109

1110
Learn how to use Workers AI to get fine-tuned inference.
1211

13-
<Feature header="Fine-tuned inference with LoRAs" href="/workers-ai/fine-tunes/loras/" cta="Run inference with LoRAs">
12+
<Feature header="Fine-tuned inference with LoRAs" href="/workers-ai/features/fine-tunes/loras/" cta="Run inference with LoRAs">
1413

1514
Upload a LoRA adapter and run fine-tuned inference with one of our base models.
1615

17-
1816
</Feature>
1917

20-
***
18+
---
2119

2220
## What is fine-tuning?
2321

2422
Fine-tuning is a general term for modifying an AI model by continuing to train it with additional data. The goal of fine-tuning is to increase the probability that a generation is similar to your dataset. Training a model from scratch is not practical for many use cases given how expensive and time consuming they can be to train. By fine-tuning an existing pre-trained model, you benefit from its capabilities while also accomplishing your desired task.
2523

26-
[Low-Rank Adaptation](https://arxiv.org/abs/2106.09685) (LoRA) is a specific fine-tuning method that can be applied to various model architectures, not just LLMs. It is common that the pre-trained model weights are directly modified or fused with additional fine-tune weights in traditional fine-tuning methods. LoRA, on the other hand, allows for the fine-tune weights and pre-trained model to remain separate, and for the pre-trained model to remain unchanged. The end result is that you can train models to be more accurate at specific tasks, such as generating code, having a specific personality, or generating images in a specific style.
24+
[Low-Rank Adaptation](https://arxiv.org/abs/2106.09685) (LoRA) is a specific fine-tuning method that can be applied to various model architectures, not just LLMs. It is common that the pre-trained model weights are directly modified or fused with additional fine-tune weights in traditional fine-tuning methods. LoRA, on the other hand, allows for the fine-tune weights and pre-trained model to remain separate, and for the pre-trained model to remain unchanged. The end result is that you can train models to be more accurate at specific tasks, such as generating code, having a specific personality, or generating images in a specific style.

0 commit comments

Comments
 (0)